Hey Guys! I have a question, i want to code a command and i dont know how i did it if a player usw the command second he disable the Commando... Also if i make command if the Sender use the command, he can build and break Blocks but when he use the Command again he dont can build and break Blocks but how can i say if the player use the Command again, than ... You know what i mean? XD Thanks for answers Bye
I think he wants a command that allow him to disable or enable block breaking? Very complicated way he explained it but thats the just of it.
he can create a config to store if the player is able to build and break And to check if he can in event PHP: public function onPlace(BlockPlaceEvent $event){$player = $event->getPlayer();$config = new Config($this->getDataFolder()."buildandbreak.yml",Config::YAML);#Name the config on what you wantif($config->get($player->getName()) =="true"){return;}else{$player->sendPopup("You can't build Here");$event->setCancelled(true);return;}}public function onBreak(BlockBreakEvent $event){$player = $event->getPlayer();$config = new Config($this->getDataFolder()."buildandbreak.yml",Config::YAML);#Name the config on what you wantif($config->get($player->getName()) =="true"){return;}else{$player->sendPopup("You can't break block Here");$event->setCancelled(true);return;}} I think this could work
He means that say a player does /b it enables the player to break blocks, then when the player does /b the second time, it enables the player to place blocks again. Sort of like a T flip flop redstone circuit, but in php. (The best example I could give)