neither does the code below doesn't give out any console error nor does the Teleportation work. The JoinEvent works though. PHP: <?phpnamespace RumDaDuMCPE;use pocketmine\math\Vector3;use pocketmine\plugin\PluginBase;use pocketmine\event\Listener;use pocketmine\event\server\DataPacketReceiveEvent;use pocketmine\event\player\PlayerJoinEvent;use pocketmine\item\Item;use pocketmine\Player;use pocketmine\Server;class Main extends PluginBase implements Listener { public function onEnable() { $this->getServer()->getPluginManager()->registerEvents($this, $this); } public function onTap(DataPacketReceiveEvent $e) { $p = $e->getPlayer(); $pk = $e->getPacket(); $level = $this->getServer()->getLevelByName("world"); if ($pk instanceof UseItemPacket and $pk->face === 0xff) { if ($p->getInventory()->getItemInHand()->getId() == 264 and $p->getInventory()->getItemInHand()->hasCustomName()) { $p->Teleport(new Vector3(-441, 8, 263)); } } } public function onJoin(PlayerJoinEvent $e) { $p = $e->getPlayer(); $item = Item::get(264, 0, 1); $item->setCustomName("test"); $test = $item; $p->getInventory()->addItem($test); }} Aye! Thanks for your help <3
I think they're referring to functions that are implemented in the PHP language, not custom functions on your code.
No, they're not. Moreover, he said no errors on the console, which means nothing is wrong by calling $player->Teleport(). I also just found another link to prove it: http://www.robert-gonzalez.com/2009/03/06/did-you-know-php-function-names-are-case-insensitive/
Wow, this is cool, I didn't know it was possible Does the custom name actually show up? If not that might be the problem.
well it would be a good idea to log when an event is called like ontap //log it to console ontap have been called
When you dont receive errors, it mostly means that the thing you wanted didnt get called. To check whether something was called do PHP: var_dump("Called: ".__LINE__); __LINE__ is a Magic consant, so dont wonder why it's not a variable nor a function. Paste it after every every if() check in your code.