minecraft:behavior.sniff for you with a switch.Get GodCraftOverview
minecraft:behavior.sniff is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Makes the mob sniff the air to find the nearest player and grow more suspicious of players close by. The warden uses it together with minecraft:suspect_tracking.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
duration | number | 1 | How long one sniff lasts, in seconds. |
sniffing_radius | number | 5 | How far the mob can sniff out a player. |
suspicion_radius_horizontal | number | 3 | Players closer than this sideways make the mob angrier at them. |
suspicion_radius_vertical | number | 3 | Players closer than this up or down make the mob angrier at them.Range: 1 to … |
cooldown_range | FloatRange | {"max":10,"min":3} | Random wait, in seconds, between sniffs. |
priority | integer | 0 | Decides which goal wins when several want to run: lower numbers run first.Range: 0 to … |
control_flags | Goal's control flags[] | none | Lists the body parts this goal takes control of (such as move, look or jump), so goals that need the same part don't run together. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:behavior.sniff": {
"duration": 1,
"sniffing_radius": 5,
"suspicion_radius_horizontal": 3,
"suspicion_radius_vertical": 3,
"cooldown_range": {
"max": 10,
"min": 3
},
"priority": 0,
"control_flags": []
}
}