I'm working on two plugins that are supposedly needing an entity to follow a player... (on move) So the straightforward way to achieve that would be on PlayerMoveEvent, teleport an entity dedicated for a player to the player's position... well for some odd reason, that doesn't work. pseudocode is as follows... PHP: public function onMove(PlayerMoveEvent $ev){ if(isset($this->plugin->follow[$ev->getPlayer()->getId()])){ $follower = $this->plugin->follow[$ev->getPlayer()->getId()]; if($follower instanceof FollowerEntity){ $follower->teleport($ev->getPlayer()); } }} But it does work when I use this <see code below>, with one catch, it can't transfer between worlds PHP: $follower->x = $player->x;$follower->y = $player->y;$follower->z = $player->z; It returns the correct position (in any means of displaying data) when Entity->asVector3() is used but it doesn't seem to work when viewed client-side as the entity doesn't move an inch. This might be a PMMP issue as I've tried this with only two plugins... DevTools and the plugin that's supposed to teleport a 'follower entity' around...
This code also reproduces the bug: PHP: public function onAttack(EntityDamageEvent $event){ if(!($event instanceof EntityDamageByEntityEvent)){ return; } if($event->getDamager() instanceof Player){ var_dump($event->getEntity()->asVector3()); $event->getEntity()->teleport($event->getDamager()); var_dump($event->getEntity()->asVector3()); }} I'm not sure what is causing this yet.