Spawning a sheep with a custom drop

Discussion in 'Plugin Development' started by BladeFireTurtle, Jul 9, 2015.

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

    BladeFireTurtle

    Good afternoon!

    For a plugin I'm making I need to be able to spawn sheep in a region (not a WG region) that have custom item drops that are set when the sheep is first spawned. I have thought of using the entity death event but this would change the item drop server wide (I can't insure the sheep would stay in the region because it may run out) and it would also not allow me to spawn several sheep at the same time with different drops.

    Also is there a fairly easy way to stop the sheep running out of the region or being hit out by a player?

    Thanks,
    BladeFireTurtle.
     
  2. Offline

    mine-care

    @BladeFireTurtle when spawned, hold the entity's id in a Collection, and uppon death check if the dead entity's id is in the collection, if so set the drops to whatever. Otherwise you can check if the death took place in the region you mentioned and if the entity is a sheep and then customise the drops (EntityDeathEvent).
     
Thread Status:
Not open for further replies.

Share This Page