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

minecraft:behavior.play_dead

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

Overview

minecraft:behavior.play_dead is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Makes the mob flop over and pretend to be dead after getting hurt, so attackers lose interest. Axolotls use it and heal while doing so.

Fields

FieldTypeDefaultDescription
durationnumber1How long, in seconds, the mob stays playing dead.
random_start_chancenumber1Chance that taking damage starts playing dead.
force_below_healthinteger0If the mob's health drops below this, any damage makes it play dead.
random_damage_rangeIntRange{"max":0,"min":0}Damage below the min never starts the goal, damage above the max always does, and in between it is random.
damage_sourcesActorDamageCause[]noneWhich kinds of damage can make the mob play dead.
apply_regenerationbooleanfalseIf true, the mob gets Regeneration while playing dead.
filtersFilter Group{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Extra conditions that must be true for the mob to play dead.
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.play_dead": {
    "duration": 1,
    "random_start_chance": 1,
    "force_below_health": 0,
    "random_damage_range": {
      "max": 0,
      "min": 0
    },
    "damage_sources": [],
    "apply_regeneration": false,
    "filters": {
      "AND": null,
      "NOT": null,
      "OR": null,
      "all": null,
      "all_of": null,
      "any": null,
      "any_of": null,
      "none_of": null
    },
    "priority": 0
  }
}

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