I'm stuck

Discussion in 'Plugin Development' started by john2342, Jul 26, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    john2342

    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.
     
  2. Offline

    Niknea

    john2342 Using the PlayerInteractEntityEvent.
    PHP:
    if (e.getRightClicked() instanceof Villager) { // Checks if the entity right clicked is a villager
                
    Villager v = (Villagere.getRightClicked(); // Creating the villager variable
                
    String name v.getCustomName(); // Getting the villagers displayname
                
    if (name.equalsIgnoreCase("test")) { // Checks villager displayname
             
        
    }
    }
     
    john2342 likes this.
Thread Status:
Not open for further replies.

Share This Page