Hi I started to work on a plugin and it was working and I did something with it (I don't know what) and now its not working. I'm using the new api for 0.11.0 . PHP: <?phpnamespace ButterPack;use pocketmine\Player;use pocketmine\Entity;use pocketmine\Server;use pocketmine\plugin\PluginBase;use pocketmine\event\Listener;use pocketmine\event\player\PlayerInteractEvent;class Main extends PluginBase implements Listener{ public function onEnable(){ $this->getLogger()->info("ButterPack enabled"); } public function onDisable(){ $this->getLogger()->info("ButterPack disabled"); } class PlayerListener implements Listener{ public function onPlayerInteract(PlayerInteractEvent $event) { if($event->getItem()->getId() === 280){ if($event->getBlock()->getId() === 1){ if($event->getFace() === 1){ $this->getLogger()->info(" Touched stone" ); } } } } } }
First of all, if you want to handle events in PlayerListener class why did you implement the Listener interface also in the main class? Second: you forgot to register events
I removed the player listener class, what events a forgot to register. (I'm new to plugin developing and php)
PHP: public function onEnable() { $this->getServer()->getPluginManager()->registerEvents($this,$this); } without that no events will be called