[Un-Solved] Monsters not attacking until hit? ( EntityTargetEvent)

Discussion in 'Plugin Development' started by stantheman68, Oct 15, 2012.

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

    stantheman68

    Hi,

    I need some help with a plugin I am creating. I am wanting to make a plugin where until a monster or mob is hit, it will not attack the player. For example, if I got up to a creeper it will not explode, but if I hit it, it will then explode. If you have an idea, may you please put the code or just give me a link to the correct event, A tutorial will also be great.
    Thank You.
     
  2. Offline

    travja

    When the entity is damaged, put it in an array list, then on TargetEvent check if the entity is in the list, if not, cancel the target event.
     
  3. Offline

    stantheman68

    Can I have the code? ;)
     
  4. Offline

    travja

    Use EntityDamageEvent to get who attacked, put them in an array, if they are in the Array on the target event let it be, if not cancel the event... not hard..
     
  5. Offline

    ZeusAllMighty11

    CreativeMode does this automatically, you could probably check in and see how that's done
     
  6. Offline

    Taco

    No offense, but can I slap you for that question? There are loads of tutorials on making plugins, use them! I realize that this comment may be a bit asinine, but really, this is a huge pet peeve of mine.
     
    travja likes this.
  7. Offline

    ZeusAllMighty11

    Scrape some code from google search, most won't give to you when asked.
     
    Taco likes this.
Thread Status:
Not open for further replies.

Share This Page