minecraft:mob_effect for you with a switch.Get GodCraftOverview
minecraft:mob_effect is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Gives a potion effect to nearby entities, like a pufferfish poisoning anything that gets close.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
ambient | Boolean | "false" | Treats the effect like a beacon effect, with fainter particles. |
cooldown_time | Integer | "0" | Seconds to wait between applying the effect. |
effect_range | Decimal | "0.2" | How close in blocks an entity must be to get the effect. |
effect_time | Integer | "10" | How many seconds the effect lasts, or "infinite". |
entity_filter | Minecraft Filter | none | Which entities can receive the effect. |
mob_effect | String | none | The effect to give, such as poison. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:mob_effect": {
"ambient": "false",
"cooldown_time": "0",
"effect_range": "0.2",
"effect_time": "10",
"entity_filter": {},
"mob_effect": ""
}
}