Basically Im trying to make something happen when a Villager with the name test is right clicked. Im stuck on this, help would be appreciated.
john2342 Using the PlayerInteractEntityEvent. PHP: if (e.getRightClicked() instanceof Villager) { // Checks if the entity right clicked is a villager Villager v = (Villager) e.getRightClicked(); // Creating the villager variable String name = v.getCustomName(); // Getting the villagers displayname if (name.equalsIgnoreCase("test")) { // Checks villager displayname }}