minecraft:mob_effect_immunity for you with a switch.Get GodCraftOverview
minecraft:mob_effect_immunity is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Makes the entity immune to the listed status effects, so they are never applied to it. Use it for a fire mob that ignores poison or a boss that can't be slowed.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
mob_effects | Array | none | Names of the effects this entity ignores, such as poison or wither. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:mob_effect_immunity": {
"mob_effects": {}
}
}