1. Wiki
  2. /Entities
  3. /minecraft:behavior.sniff

minecraft:behavior.sniff

Don't want to write this by hand? GodCraft sets minecraft:behavior.sniff for you with a switch.Get GodCraft

Overview

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

FieldTypeDefaultDescription
durationnumber1How long one sniff lasts, in seconds.
sniffing_radiusnumber5How far the mob can sniff out a player.
suspicion_radius_horizontalnumber3Players closer than this sideways make the mob angrier at them.
suspicion_radius_verticalnumber3Players closer than this up or down make the mob angrier at them.Range: 1 to …
cooldown_rangeFloatRange{"max":10,"min":3}Random wait, in seconds, between sniffs.
priorityinteger0Decides which goal wins when several want to run: lower numbers run first.Range: 0 to …
control_flagsGoal's control flags[]noneLists 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": []
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more