PHP: <?phpnamespace _0110\CallFunction;use pocketmine\plugin\PluginBase;use pocketmine\event\player\PlayerJoinEvent;use pocketmine\event\Listener;class CallFunction extends PluginBase implements Listener{ public function onEnable(){ } public function onPlayerJoin(PlayerJoinEvent $event){ $event->getPlayer()->sendMessage("Hello"); }} Ok, obviously, I wrote this just to test event stuff, but nothing really happens when I join. What have I forgot?
You forgot to register the events. Add $this->getServer()->getPluginManager()->registerEvents($this, $this); into onEnable().
Well that is all I have above I was trying to write a plugin, but the functions werent triggered, so I tried to write even simpler code but it didnt work. And that simpler code is that above.
What functions were you trying to use? + You need to register events. Show the errors you were getting.
PHP: <?phpnamespace _0110\CallFunction;use pocketmine\plugin\PluginBase;use pocketmine\event\player\PlayerJoinEvent;use pocketmine\event\Listener;class CallFunction extends PluginBase implements Listener{ public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this, $this); } public function onPlayerJoin(PlayerJoinEvent $event){ $event->getPlayer()->sendMessage("Hello"); }} This will work.