CreatureSpawnEvent getting who used the spawnegg

Discussion in 'Plugin Development' started by welsar55, Feb 7, 2013.

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

    welsar55

    i need to get who used the spawnegg but i need to get the mob as well so im useing CreatureSpawnEvent instead of PlayerInteractEvent a ty for your fast post:)
     
  2. Offline

    skore87

    Have you considered using the interact event to simulate its use instead so that you have full control of the creature spawn? You would spawn the creature and then remove the item from hand and because you are the one spawning it you would have access to the creature object itself.

    Otherwise you'd have to hope you'd get it correct by checking the spawnreason and writing some data on the interact event. I would really hope you don't try this method as it is hackish at best and likely to fail for you.
     
  3. Offline

    chasechocolate

    Yeah, just use PlayerInteractEvent and check if the event.getAction() is Action.RIGHT_CLICK_BLOCK.
     
Thread Status:
Not open for further replies.

Share This Page