PHP: public function onMove(EntityMoveEvent $event){ if($event->getEntity() instanceof Player) { $playerobject = $event->getEntity(); $username = $player->getName(); }} Sorry for mistakes, this was written on my phone.
EntityMoveEvent is called every tick for each player with speedX, speedY or speedZ not equal to 0. EntityMotionEvent is called only when a player's speedX, speedY or speedZ is changed. If you use PhpStorm, you will find out that warnings will still come out if you do it like this. So, store $event->getEntity() in a variable first to let your IDE know that $playerobject is the same one seen at $event->getEntity(). PHP: public function onMove(EntiyMoveEvent $event){ if(($playerobject = $event->getEntity()) instanceof Player){ $username = $playerobject->getName(); }}
Obviously not. EntityMoveEvent is when a player moves. This event is triggered whether the player's speed changes or not. It is called every tick for each entity unless the entity is not moving. "Move" includes rotating head. EntityMotionEvent is the event about the change of direction and/or speed of an entity.