minecraft:behavior.tempt
Allows a mob to be tempted by a player holding a specific item. Uses pathfinding for movement.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
speed_multiplier | Decimal | 1 | Movement speed multiplier of the mob when using this AI Goal |
can_get_scared | Boolean | false | If true, the mob can stop being tempted if the player moves too fast while close to this mob. |
can_tempt_vertically | Boolean | false | If true, vertical distance to the player will be considered when tempting. |
can_tempt_while_ridden | Boolean | false | If true, the mob can be tempted even if it has a passenger (i.e. if being ridden). |
tempt_sound | Textitem.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_interval | Object | {"max": 0, "min": 0} | Range of random ticks to wait between tempt sounds. |
min | Decimal | 0 | |
max | Decimal | 0 | |
items | List of text or object | [] | List of items that can tempt the mob. |
within_radius | Decimal | 0 | Distance in blocks this mob can get tempted by a player holding an item they like. |
stop_distance | Decimal | — | The distance at which the mob will stop following the player. |
on_tempt_start | Object | {"event": "", "filters": {"AND": null, "NOT": null, "OR":… | Event to trigger when this mob starts being tempted. |
event | Text | "" | |
target | Textself, other, player, target, parent, baby, block, damager, holder, item | "self" | |
filters | Object 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. |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
on_tempt_end | Object | {"event": "", "filters": {"AND": null, "NOT": null, "OR":… | Event to trigger when this mob stops being tempted. |
event | Text | "" | |
target | Textself, other, player, target, parent, baby, block, damager, holder, item | "self" | |
filters | Object 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. |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
priority | Integermin 0 | 0 | |
control_flags | List 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
behavior.look_at_playerbehavior.breedbehavior.mount_pathingbehavior.follow_parentbehavior.player_ride_tamedbehavior.find_mountbehavior.celebratebehavior.follow_ownerbehavior.stay_while_sittingbehavior.look_at_trading_playerbehavior.random_look_around_and_sitbehavior.take_flowerbehavior.trade_with_playerbehavior.celebrate_survivebehavior.controlled_by_playerbehavior.follow_caravanbehavior.follow_mobbehavior.make_lovebehavior.ocelot_sit_on_blockbehavior.playbehavior.receive_lovebehavior.share_itemsbehavior.trade_interestbehavior.admire_item