Good day! I didn’t find information in the API, how to get a player by right-clicking on him? PHP: public function onTap(PlayerInteractEvent $event){ $anotherPlayerName = $event->get.... }
its impossible whit PlayerInteractEvent . use EntityDamageByEntityEvent . $event->getEntity() is the player who you damaged $event->getDamager() is you you can use $event->setCancelled() to disable damage
It is. You can get all the entities in the whole level and check if player is looking at them (maybe there is some voxel ray trace api)... Then just get simply the player