I got this Problem with my plugin when I Start my Server: [11:34:25] [Server thread/CRITICAL]: ParseError: "syntax error, unexpected 'public function onAttack' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)" (EXCEPTION) in "plugins/command/src/hunger/hunger" at line 12 This is my Code: <?php namespace hunger; use pocketmine\entity\Entity; use pocketmine\event\entity\EntityDamageByEntityEvent; use pocketmine\event\entity\EntityDamageEvent; use pocketmine\event\Listener; class onAttack extends PluginBase implements Listener{ public function onAttack(\pocketmine\event\entity\EntityDamageEvent $e) { if($e instanceof \pocketmine\event\entity\EntityDamageByEntityEvent){ if($event->getEntity() instanceof Player && $event->getDamager() instanceof Player){ if($e->getDamager()->getInventory()->getItemInHand()->getId() == 1){ $e->getEntity()->sendMessage("You have been spotted with a stone"); $e->getDamager()->sendMessage("You spot a player with stone!"); } } } } }
I don't think that error comes from the code you sent there, I ran it through a syntax checker and it shows no errors.