Make an Iron Golem target players

Discussion in 'Spigot Help' started by Gush, Jun 27, 2015.

  1. http://bukkit.org/threads/tutorial-1-7-creating-a-custom-entity.212849/

    I'm working on an arena plugin and I'm trying my hand at the custom mobs tutorial with the link above. I guess something's aren't as clear to me as some of you guys.

    I'm curious as how to create a listener for these mobs like how would I get if a mob was hit.

    Specifically, how would I get an irongolem custommob class to never attack another mob and only attack other players
     
  2. We'll I figured out the listener you would just do event.getentity() instanceof custommobclass I think.

    But can I get someone's example code of doing something with the mob like how I said making so my custom irongolem will just attack players or would I create a method in customirongolem to cancel when targeting an entity other than a player? Is it wrong to have methods in the custommobclass called by the events?