Hello, How would i make that when you right click with compass it tracks nearest person to you and shows with compass where to go.
This *should* work (haven't tested it much) Code: public class PlayerInteractController implements Listener { @EventHandler(priority = EventPriority.MONITOR) public void onPlayerInteract(PlayerInteractEvent e) { if (e.getPlayer().getItemInHand().getData().getItemType() == Material.COMPASS) { List<Entity> playerList = (List<Entity>) e.getPlayer().getNearbyEntities(1000, 50, 1000); int i=0; int p=playerList.size()-1; while(playerList.get(i).getType()!=EntityType.PLAYER && i<p){i++;} if (i!=p){ e.getPlayer().setCompassTarget(playerList.get(i).getLocation()); } } } }