minecraft:behavior.tempt for you with a switch.Get GodCraftOverview
minecraft:behavior.tempt is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Makes the mob follow a player who holds an item it likes, such as wheat for cows. Great for leading animals home.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
can_get_scared | Boolean | "false" | If true, the mob stops following if the player moves too fast close to it. |
can_tempt_vertically | Boolean | "false" | If true, height difference also counts when checking how close the player is. |
can_tempt_while_ridden | Boolean | "false" | If true, the mob can be tempted even with a rider on it. |
items | Array | "[]" | Which items the mob will follow. |
sound_interval | Range [a, b] | "[0.0, 0.0]" | Random wait, in ticks, between tempt sounds. |
speed_multiplier | Decimal | "1.0" | Speeds the mob up or slows it down while this goal runs: 1 is normal speed. |
stop_distance | Decimal | "1.5" | How close the mob gets to the player before it stops moving. |
tempt_sound | String | none | Sound the mob makes while being tempted. |
within_radius | Decimal | "0.0" | How close the player must be for the item to tempt the mob. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:behavior.tempt": {
"can_get_scared": "false",
"can_tempt_vertically": "false",
"can_tempt_while_ridden": "false",
"items": "[]",
"sound_interval": "[0.0, 0.0]",
"speed_multiplier": "1.0",
"stop_distance": "1.5",
"tempt_sound": ""
}
}