minecraft:behavior.float_tempt
Allows a mob to be tempted by a player holding a specific item. Uses point-to-point movement. Designed for mobs that are floating (e.g. use the "minecraft:navigation.float" component).
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 Happy Ghast uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.float_tempt": {
"priority": 4,
"can_tempt_vertically": true,
"items": [
"minecraft:snowball",
"minecraft:black_harness",
"minecraft:blue_harness",
"minecraft:brown_harness",
"minecraft:cyan_harness",
"minecraft:gray_harness",
"minecraft:green_harness",
"minecraft:light_blue_harness",
"minecraft:light_gray_harness",
"minecraft:lime_harness",
"minecraft:magenta_harness",
"minecraft:orange_harness",
"minecraft:pink_harness",
"minecraft:purple_harness",
"minecraft:red_harness",
"minecraft:white_harness",
"minecraft:yellow_harness"
],
"within_radius": 16,
"stop_distance": 7,
"on_tempt_end": {
"event": "minecraft:on_stop_tempting"
}
}
}Used by 1
Vanilla entities with minecraft:behavior.float_tempt in their definition:
Related components
behavior.look_at_playerbehavior.temptbehavior.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_interest