Invincible Mobs

Discussion in 'Plugin Development' started by CapitanChewbacca, Jun 14, 2014.

Thread Status:
Not open for further replies.
  1. How can I make a mob invincible without using the EntityDamageEvent or EntityDamageByEntityEvent?
    Like with the vanilla command "/summon <x> <y> <z> <Entity> {Invulnerable: 1}"
     
  2. Offline

    Garris0n

    Well, you could use some NMS and reflection to set the value in the NMS Entity class.

    Or you could just use the damage event because it's easier.
     
  3. Offline

    rfsantos1996

    I belive you can't do that without checking if the entity is allowed to receive damage (with a real entity).

    With a fake entity, you can easily do that using Packets
     
  4. Offline

    Garris0n

    With a fake entity, it doesn't take any damage because it doesn't exist...
     
  5. Offline

    rfsantos1996

    Yeah, I should said that. Depending on his purposes, it is useful
     
  6. Offline

    Garris0n

    He just wants an invulnerable entity. The NMS Entity class actually does have an "invulnerable" private boolean field (which corresponds with the "Invulnerable" NBT tag), but I'd recommend the Bukkit solution to somebody who clearly didn't know how to find that in the first place.
     
    ZeusAllMighty11 likes this.
Thread Status:
Not open for further replies.

Share This Page