I have this code: PHP: public function onDamage(EntityDamageEvent $event){ $player = $event->getEntity(); $map = $player->getLevel()->getName(); if(in_array($map, $this->setting->get("pvp_disabled_worlds"))){ $event->setCancelled(); } } But if I PVP in a world that is not in the array, I STILL can not PVP. What is the reason?
Are you sure that this code is cancelling it, not another plugin? And how did you define $this->setting?
Hello! Everything is processed with strtolower already. Yes, I have PvP on. I only have one bad solution: setCancelled(false); The config file is an array.
You can. Then that means another plugin, or PocketMine itself, wants the plugin to be cancelled. Check your spawn protection, difficulty, PvP mode, etc. in server.properties.