Destroying sheep

Discussion in 'Plugin Development' started by Nojus, May 20, 2014.

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

    Nojus

    How can i create and destroy sheep?
    i know how i can create it but i don't know how to destroy it

    code:
    Code:java
    1. Sheep p = world.spawn(loc, Sheep.class);
    2. p.setCustomName("§aS§bp§ca§dl§ev§fo§at§ba §favis!");
    3. p.setCustomNameVisible(true);
     
  2. Offline

    DxDy

    p.remove() ? Although I'm not sure whether that is the mandated way of doing it.
     
  3. Offline

    Nojus

    How can i remove entity by name?
     
  4. Offline

    DxDy

    Search through all the entites in a world until you find the one with the required name ;)
     
  5. Offline

    macboinc

    Get the Sheep meta and then get the meta name (meta.getName("<name>"))

    Then remove it.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
Thread Status:
Not open for further replies.

Share This Page