minecraft:behavior.tempt

Allows a mob to be tempted by a player holding a specific item. Uses pathfinding for movement.

Properties

PropertyTypeDefaultWhat it does
speed_multiplierDecimal1Movement speed multiplier of the mob when using this AI Goal
can_get_scaredBooleanfalseIf true, the mob can stop being tempted if the player moves too fast while close to this mob.
can_tempt_verticallyBooleanfalseIf true, vertical distance to the player will be considered when tempting.
can_tempt_while_riddenBooleanfalseIf true, the mob can be tempted even if it has a passenger (i.e. if being ridden).
tempt_soundTextitem.use.on, hit, step, step.baby, fly, jump, jump.prevent, break, place, heavy.step, gallop, fall, hurt, hurt.baby, hurt.in.water, death, death.baby, death.in.water, death.to.zombie, ambient, ambient.baby, ambient.in.water, ambient.in.air, ambient.tame …"undefined"Sound to play while the mob is being tempted.
sound_intervalObject{"max": 0, "min": 0}Range of random ticks to wait between tempt sounds.
minDecimal0
maxDecimal0
itemsList of text or object[]List of items that can tempt the mob.
within_radiusDecimal0Distance in blocks this mob can get tempted by a player holding an item they like.
stop_distanceDecimal—The distance at which the mob will stop following the player.
on_tempt_startObject{"event": "", "filters": {"AND": null, "NOT": null, "OR":…Event to trigger when this mob starts being tempted.
eventText""
targetTextself, other, player, target, parent, baby, block, damager, holder, item"self"
filtersObject or List of object{"AND": null, "NOT": null, "OR": null, "all": null, "all_…Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects.
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.
on_tempt_endObject{"event": "", "filters": {"AND": null, "NOT": null, "OR":…Event to trigger when this mob stops being tempted.
eventText""
targetTextself, other, player, target, parent, baby, block, damager, holder, item"self"
filtersObject or List of object{"AND": null, "NOT": null, "OR": null, "all": null, "all_…Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects.
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 Zombie Nautilus uses it in Minecraft Bedrock 1.26.60.5:

{
  "minecraft:behavior.tempt": {
    "items": [
      "pufferfish_bucket",
      "cod_bucket",
      "salmon_bucket",
      "tropical_fish_bucket",
      "pufferfish",
      "fish",
      "salmon",
      "clownfish",
      "cooked_fish",
      "cooked_salmon"
    ],
    "on_tempt_end": {
      "event": "minecraft:on_stop_tempting"
    },
    "priority": 3,
    "speed_multiplier": 1.3
  }
}

Used by 31

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

Related components