Hey everyone, I've encountered an issue with my server, my players that are in survival are able to fly. I have no idea if this is due to a plugin allowing it or something in the server files. How do I change this?
I think can it work PHP: use pocketmine\event\player\PlayerMoveEvent;public function onMove(PlayerMoveEvent $ev){ $p = $ev->getPlayer();if($p->getGamemode() === 0){ $p->setAllowFight(false);}}
PHP: <?phpnamespace Yournamespace;use pocketmine\plugin\PluginBase;use pocketmine\event\Listener;use pocketmine\evenr\player\PlayerMoveEvent;use pocketmine\Player;use pocketmine\Serverclass YourClass extends PluginBase implements Listener{ public function onEnable (){ $this->getServer()->getPluginManager()->registerEvents($this, $this); }public function onMove(PlayerMoveEvent $ev){ $p = $ev->getPlayer();if($p->getGamemode() === 0){ $p->setAllowFight(false); } }}
Dude, he's not a programmer don't you see it's the Help thread? Also what does your answer have to do with what he asked? You're just giving useless code. There is probably a plugin allowing them to. Check running the server without any plugins and see what happens.
Ok so I went through all my plugins, removing them and putting them back in and seeing if they allowed it and the one that did it is Festival. I had plans to use that plugin to build out PVP zones and non PVP zones but I'm not going to use it until they fix this flying in survival issue.