I want it so ops or any player with a certain permision to get a secret message on join in my plugin. How can i do this and what do i have to use?
try this: you create a onjoin handler, when on join try get all config, foreach if has permission for value, send message config get value with permission like this example, DO NOT COPY, this is only meant to be an example Code: function onJoin(){ foreach $config->getall as perm if playerhasperm(perm) player->tell(config->get(perm)) } so your config would be perm as keys and messages as value
PHP: public functiom onJoin(PlayerJoinEvent $event) { $players = $this->getServer()->getOnlinePlayers(); foreach($players as $player) { if($player->hasPermission("anything") || $player->isOp()) { $player->tell("Anything"); } }}
this wont be a good idea as you will be spammed when others join also a bad idea if you want to edit things
Well i just needed an example actually. So i could add it for different things. it was very helpful actually