minecraft:behavior.drink_milk

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

Properties

PropertyTypeDefaultWhat it does
cooldown_secondsDecimal5Time (in seconds) that the goal is on cooldown before it can be used again.
filtersObject or List of object{"AND": null, "NOT": null, "OR": null, "all": null, "all_…Conditions that need to be met for the behavior to start.
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_milk": {
    "filters": {
      "AND": [
        {
          "test": "is_daytime",
          "subject": 0,
          "operator": 0,
          "value": true
        },
        {
          "test": "is_visible",
          "subject": 0,
          "operator": 0,
          "value": false
        },
        {
          "test": "is_avoiding_mobs",
          "subject": 0,
          "operator": 0,
          "value": false
        }
      ]
    },
    "priority": 5
  }
}

Used by 1

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

Related components