I need help this plugin doesnt work for some reason well you need to set in sever properties Spawn protection 1 to make it work PHP: <?php/*__PocketMine Plugin__name=PVPprotectordescription=Players cant damage in PVP zonesversion=πauthor=MegaSamNinjaclass=PVPprotectorapiversion=9,10,11,12,13*/ class PVPprotector implements Plugin { private $api, $path, $config; public function __construct(ServerAPI $api, $server = false) { $this->api = $api; $this->server = ServerAPI::request(); $this->path = $this->api->plugin->createConfig($this, array()); $this->config = $this->api->plugin->readYAML($this->path . "config.yml"); } public function init() { $this->api->addHandler("entity.health.change", array($this, "eventHandler")); $this->api->console->register("pvpprotect", "Set a no pvp zone.", array($this, "commandH")); } public function eventHandler($data) { $target = $data['entity']; $t = new Vector2($target->x, $target->z); $s = new Vector2($this->server->spawn->x, $this->server->spawn->z); if($t->distance($s) <= $this->api->getProperty('spawn-protection')){ if(is_numeric($data['cause'])){ $e = $this->api->entity->get($data['cause']); if(($e !== false) and ($e->class === ENTITY_PLAYER)){ $e->player->sendChat('PvP is not allowed in this area');if(!isset($target))return; if ($this->config[$target->level]['min'][0] <= $target->x and $target->x <= $this->config[$target->level]['max'][0]) { if ($this->config[$target->level]['min'][1] <= $target->y and $target->y <= $this->config[$target->level]['max'][1]) { if ($this->config[$target->level]['min'][2] <= $target->z and $target->z <= $this->config[$target->level]['max'][2]) { return false; } } } } public function commandH($cmd, $params, $issuer, $alias) { $output = ""; switch ($cmd) { case "pvpprotect": if ($issuer != "console") { $output .= "THIS IS AWESOME why dosent it work cause you need todo it ingame"; break; } if (count($params) == 8) { $level = array_shift($params); $pos1 = array(array_shift($params), array_shift($params), array_shift($params)); $pos2 = array(array_shift($params), array_shift($params), array_shift($params)); $minX = min($pos1[0], $pos2[0]); $maxX = max($pos1[0], $pos2[0]); $minY = min($pos1[1], $pos2[1]); $maxY = max($pos1[1], $pos2[1]); $minZ = min($pos1[2], $pos2[2]); $maxZ = max($pos1[2], $pos2[2]); $max = array($maxX, $maxY, $maxZ); $min = array($minX, $minY, $minZ); $this->config[$level] = array("pvp" => true, "min" => $min, "max" => $max); $this->writeConfig($this->config); $output .= "This area is now has NO PVP ($minX, $minY, $minZ)-($maxX, $maxY, $maxZ) : $level\n"; } else { $output .= "usage pvpprotect x1 y1 z1 x2 y2 z2"; } break; } return $output; } public function __destruct() { } }