minecraft:mob_effect

Dynamic value

Properties

This component has no properties in the official schema: add it as an empty object {} to switch the behaviour on.

Example from the game files

This is how vanilla Pufferfish uses it in Minecraft Bedrock 1.26.60.5:

{
  "minecraft:mob_effect": {
    "effect_range": 0.2,
    "effect_time": 10,
    "entity_filter": {
      "any_of": [
        {
          "all_of": [
            {
              "subject": "other",
              "test": "is_family",
              "value": "mob"
            },
            {
              "any_of": [
                {
                  "subject": "other",
                  "test": "is_family",
                  "value": "axolotl"
                },
                {
                  "all_of": [
                    {
                      "operator": "not",
                      "test": "is_family",
                      "subject": "other",
                      "value": "aquatic"
                    },
                    {
                      "operator": "not",
                      "test": "is_family",
                      "subject": "other",
                      "value": "undead"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "all_of": [
            {
              "subject": "other",
              "test": "is_family",
              "value": "player"
            },
            {
              "operator": "not",
              "test": "has_ability",
              "subject": "other",
              "value": "instabuild"
            }
          ]
        }
      ]
    },
    "mob_effect": "poison"
  }
}

Used by 4

Vanilla entities with minecraft:mob_effect in their definition:

Related components