Spawn mob and keep track of it

Discussion in 'Plugin Development' started by YuzkoCode, Jun 27, 2013.

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

    YuzkoCode

    Hello, I was just wondering if someone could help me out.

    I want to be able to type (EXAMPLE) /pig.

    This pig will go into the world and you will be able to keep track of the pig.

    When the pig is killed, the player will be given 10 diamonds.
     
  2. Offline

    bubba1234119

    Get the pigs entity id when it is spawned and then whenever an entity of type pig is killed check to see if it is that id if it is give the player 10 diamonds.
     
  3. Offline

    Steffion

    Save the UUID and on entity death check if the uuid is the Same?
     
  4. Offline

    Minnymin3

    If you do not want to keep the pig there on restart its easy. If you do its more difficult.

    Store the pig entity in a variable then listen for EntityDeathEvent and if the entity is equal to the pig and the killer is a player then give the killer 10 diamonds.

    To store the entity on restart I would remove the entity on disable and write the location to a config. Then on enable spawn the pig at that location.
     
Thread Status:
Not open for further replies.

Share This Page