minecraft:behavior.drink_potion

Allows the mob to drink potions based on specified environment conditions.

Properties

PropertyTypeDefaultWhat it does
speed_modifierDecimal0The movement speed modifier to apply to the entity while it is drinking a potion. A value of 0 represents no change in speed.
potionsList of object[]A list of potions that this entity can drink. Each potion entry has the following parameters:
idInteger-1The registry ID of the potion to use
chanceDecimal1The percent chance (from 0.0 to 1.0) of this potion being selected when searching for a potion to use.
filtersObject or List of object{"AND": null, "NOT": null, "OR": null, "all": null, "all_…The filters to use when determining if this potion can be selected.
testText—The name of the test to apply.
subjectBoolean or Integer or Decimal or Text—The subject of this filter test.
operatorBoolean or Integer or Decimal or Text—The comparison to apply with 'value'.
domainBoolean or Integer or Decimal or Text—The domain the test should be performed in.
valueBoolean or Integer or Decimal or Text—The value being compared with the test.
priorityIntegermin 00
control_flagsList of text[]

Example from the game files

This is how vanilla Wandering Trader uses it in Minecraft Bedrock 1.26.60.5:

{
  "minecraft:behavior.drink_potion": {
    "potions": [
      {
        "chance": 1,
        "filters": {
          "all_of": [
            {
              "any_of": [
                {
                  "operator": ">=",
                  "test": "hourly_clock_time",
                  "value": 18000
                },
                {
                  "operator": "<",
                  "test": "hourly_clock_time",
                  "value": 12000
                }
              ]
            },
            {
              "subject": "self",
              "test": "is_visible",
              "value": true
            },
            {
              "any_of": [
                {
                  "subject": "self",
                  "test": "is_avoiding_mobs",
                  "value": true
                },
                {
                  "all_of": [
                    {
                      "subject": "self",
                      "test": "has_component",
                      "value": "minecraft:angry"
                    },
                    {
                      "operator": "!=",
                      "test": "is_family",
                      "subject": "target",
                      "value": "player"
                    }
                  ]
                }
              ]
            }
          ]
        },
        "id": 7
      },
      {
        "chance": 1,
        "filters": {
          "all_of": [
            {
              "operator": ">=",
              "test": "hourly_clock_time",
              "value": 12000
            },
            {
              "operator": "<",
              "test": "hourly_clock_time",
              "value": 18000
            },
            {
              "subject": "self",
              "test": "is_visible",
              "value": true
            },
            {
              "any_of": [
                {
                  "subject": "self",
                  "test": "is_avoiding_mobs",
                  "value": true
                },
                {
                  "subject": "self",
                  "test": "has_component",
                  "value": "minecraft:angry"
                }
              ]
            }
          ]
        },
        "id": 8
      }
    ],
    "priority": 1,
    "speed_modifier": -0.2
  }
}

Used by 2

Vanilla entities with minecraft:behavior.drink_potion in their definition:

Related components