Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Tag an Entity by it's ID alone

Comments in 'Plugin Development' started by jasonwynn10, May 11, 2016.

  1. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    I have been making a plugin for pets. So far all works good except that I need to be able to tag a pet by it's ID so I can remove it from the world. The plugin is here: https://github.com/thelucyclub/Pets
  2. basprohop
    Offline

    basprohop Active Member Plugin Developer

    Joined:
    Aug 8, 2015
    Posts:
    128
    Plugins:
    3
    Minecraft User:
    basprohop
    $entity->getID();
    and store it into an array with the player
  3. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    I have the ID code, I just need to tag the specific entity that owns it
  4. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Why don't you just use
    PHP:
    Entity::close();
    # or
    Entity::despawnFromAll();
    # or
    # RemoveEntityPacket
    If you wan't to set owner of entity, I suggest to create a new class and implement function getOwner();
    Or you can just set your own variable inside entity
    e.g.
    PHP:
    $entity->owner $player;
    Although that's more like hacking.
  5. basprohop
    Offline

    basprohop Active Member Plugin Developer

    Joined:
    Aug 8, 2015
    Posts:
    128
    Plugins:
    3
    Minecraft User:
    basprohop
    You can get entity by id via: getLevel()->getEntity($id);
  6. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10

Share This Page

Advertisement