How to clear the inventory when someone changes its gamemode. Please no php codes i cant code in php. Is there any plugin for that?
sorry PHP: public function onPlayerGameModeChangeEvent(PlayerGameModeChangeEvent $event){ $event->getPlayer()->getInventory()->clearAll(); } This is more for ppl who wants to do it x) I think it's the right way...not sure don't forget to PHP: use pocketmine\event\player\PlayerGameModeChangeEvent;
Unhandled exception executing command 'reload' in reload: syntax error, unexpected 'public function onPlayerGam e' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) [12:37:28] [Server thread/CRITICAL]: ParseError: "syntax error, unexpected 'public function onPlayerGame' (T_STRING), expecting function (T_FUNCTION ) or const (T_CONST)" (EXCEPTION) in "Example.phar/src/Example/Example" at line 21