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

minecraft:behavior.panic

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

Overview

minecraft:behavior.panic is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Makes the mob run around in a hurry, away from whatever hurt it. Animals like cows and chickens use it when hit.

Fields

FieldTypeDefaultDescription
damage_sourcesList"[campfire, fire, fire_tick, freezing, lava, lightning, magma, soul_campfire, temperature, entity_attack, entity_explosion, fireworks, magic, projectile, ram_attack, sonic_boom, wither, mace_smash]"Which kinds of damage make the mob panic, such as "fire" or "entity_attack".
forceBoolean"false"If true, the mob keeps panicking until it can't move or the goal is removed.
ignore_mob_damageBoolean"false"If true, damage from other mobs never causes panic, even if listed in damage_sources.
prefer_waterBoolean"false"If true, the panicking mob tries to run toward water.
speed_multiplierDecimal"1.0"Speeds the mob up or slows it down while this goal runs: 1 is normal speed.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

BP/entities/<name>.json
{
  "minecraft:behavior.panic": {
    "damage_sources": "[campfire, fire, fire_tick, freezing, lava, lightning, magma, soul_campfire, temperature, entity_attack, entity_explosion, fireworks, magic, projectile, ram_attack, sonic_boom, wither, mace_smash]",
    "force": "false",
    "ignore_mob_damage": "false",
    "prefer_water": "false",
    "speed_multiplier": "1.0"
  }
}

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