if command is used /pvp off it doesnt turn off PHP: public function EnablePvP(){ $plugin = $this->plugin; $plugin->getServer()->setConfigInt("difficulty", 1); $pk = new SetDifficultyPacket(); $pk->difficulty = $plugin->getServer()->getDifficulty(); } public function DisablePvP(){ $plugin = $this->plugin; $plugin->getServer()->setConfigInt("difficulty", 0); $pk = new SetDifficultyPacket(); $pk->difficulty = $plugin->getServer()->getDifficulty(); } here is when the command PHP: if($sender->isOp()){ foreach($this->plugin->getServer()->getOnlinePlayers() as $pl){ if($args[0] == "on"){ $this->EnablePvP(); }else if($args[0] == "off"){ $this->DisablePvP();
PHP: if($sender->isOp()){ foreach($this->plugin->getServer()->getOnlinePlayers() as $pl){ if($args[0] == "on"){ $pl->dataPacket($pk); $plugin = $this->plugin; $plugin->getServer()->setConfigInt("difficulty", 1); $pk = new SetDifficultyPacket(); $pk->difficulty = $plugin->getServer()->getDifficulty();