1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

stackin'

Discussion in 'Development' started by Angel, Jul 31, 2018.

  1. Angel

    Angel Spider Jockey

    Messages:
    44
    GitHub:
    aimjel
    I am trying to make a Mob Stacker plugin but i've ran into a small problem. When the entity dies i have no idea how to cancel the entity from dying. Please help.
     
  2. DaPigGuy

    DaPigGuy Slime

    Messages:
    86
    GitHub:
    DaPigGuy
    You can't cancel the death event of entities or players. You can, however, check if the damage dealt to an enemy is enough to kill them, and if so, cancel the damage, and set their health back to max, and remove one mob from the stack.
     
    corytortoise, Muqsit and Angel like this.
  3. Angel

    Angel Spider Jockey

    Messages:
    44
    GitHub:
    aimjel
    Thanks!
     
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Don't forget to listen to the EntityDamageEvent on the HIGHEST priority (or a priority higher than any other plugins that listen to it).
     
    Last edited: Jul 31, 2018
    corytortoise likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.