isInvulnerable

abstract var isInvulnerable: Boolean

If this entity should not take damage from any source.

When this is true, the following statements are also true:

  • If this entity is living, it cannot be moved by fishing rods, attacks, explosions, or projectiles.

  • Objects such as vehicles and item frames cannot be destroyed unless their support is also removed.

  • If this entity is a player, it will also be ignored by any hostile mobs.

Setting this to true, however, will not prevent this entity from being damaged by a player in creative mode.