Hello Guys, im trying to play with setting the time in a plugin, but when i got here, i don't know how to establish the time into night (the action to get executed), please respond, thanks this is my code so far, thanks. PHP: public function onCommand(\pocketmine\command\CommandSender $sender, \pocketmine\command\Command $command, $label, array $args) { if($sender instanceof Player){ $time = $sender->getServer()->getLevel("world")->getTime(); switch(strtolower($command ->getName())){ case 'time': if($args == "night"){ } break;
Assuming you want to change the time on the world where there is the command sender: PHP: $sender->getLevel()->setTime(15000); //I don't remember if 15000 is the night on MCPE. Just change that parameter with any other
No, I was just trying to point it that the command already exists and you'll have trouble to unregister the original one.