Hey guys! I need the code for SW Cages! The code should have the ff. - Remove when the game has started
Can you show what you have already tried--if you have tried anything? I am not going to outright give you the code unless you at least attempt it on your own. However, I can guide you in the right direction: You could build the cages when the plugin is enabled using setBlock() and then teleport players into the cages and setImmobile() when they join the game. Then when you would like the game to start you could use setBlock() to remove the cages around the players and use setImmobile() again to allow them to move, and when the game ends you can use setBlock to rebuild the cages in the locations you would like them to be.
P.S. Because setImmobile() at it's current stage disables movement only client-sided, you will need to write a small PlayerMoveEvent handler. PHP: public function onMove(PlayerMoveEvent $event){ if($event->getPlayer()->isImmobile() && !$event->getTo()->equals($event->getFrom())){ $event->setCancelled(); }}