I need help with my plugin here is the main code: public function onPlayerGameModeChangeEvent(PlayerGameModeChangeEvent $event){ for($i = 0; $i getPlayer()->getInventory()->getSize(); $i++) { $event->getPlayer()->getInventory()->clear($i); } } Error: ,unexpected 'public function onPlayerGame' (T_STRING) , expecting function (T_FUNCTION) or const (T_CONST)" (EXCEPTION) in "Example.phar/src/Example/Example" at line 14 Whats wrong with my code?
Look at the second expression of your for loop, there's something missing... And why not simply using Inventory::clearAll() ? And maybe don't forget to clear armorInventory too.