Removing a Horse with a custom name-tag help!

Discussion in 'Plugin Development' started by 123ang, Jul 5, 2014.

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

    123ang

    *Post Deleted By User*
     
  2. Offline

    JasonDL13

    Use Entity.setCustomName or Entity.setCustomNameVisable. You can get the entity by using e.getRightClicked(). Make sure to do a null check though.
     
  3. Offline

    123ang

    JasonDL13 No if the any horse in the world has the nametag of: player.getName + "'s" + " Mount Donkey" I want to remove the whole horse.
     
  4. Offline

    xTigerRebornx

    123ang Loop through all Entities in the Player's World, and remove them if they have the name
     
  5. Offline

    123ang

    xTigerRebornx How might one do that by right clicking the saddle? (Could you give me some code?)
     
  6. Offline

    xTigerRebornx

  7. Offline

    123ang

    xTigerRebornx Well I understand absolutely none of this so I'll wait for someone else.
     
  8. Offline

    SuperOriginal

    Use the PlayerInteractEvent to check if the player is holding a saddle(You did that.) Then use a for loop to get all the entities in a world. Then use the getCustomName method to check if the entity has the name you want.
     
  9. Offline

    tommyhoogstra

    They are just pages full of methods you can use, e.g. getEntities () is a part of the World documentation.
    That method creates a list of all entities in a world, then you just loop through them, check if the index is instance of LivingEntity, if the living entity has that name, kill them.
     
  10. Offline

    123ang

  11. Offline

    tommyhoogstra

    We arent going to spoon feed you an entire snippet. You should know how to use basic bukkit methods
     
Thread Status:
Not open for further replies.

Share This Page