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

minecraft:behavior.dragonstrafeplayer

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

Overview

minecraft:behavior.dragonstrafeplayer is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Ender Dragon only: makes the dragon fly around a player and shoot fireballs at them.

Fields

FieldTypeDefaultDescription
switch_direction_probabilitynumber0.125Chance to flip between circling clockwise and counterclockwise, checked each time a new target is picked.Range: 0 to 1
target_in_range_and_in_view_timenumber0.25Seconds the target must stay in range and in clear view before a fireball is shot.
fireball_rangenumber64How far the fireball attack can reach.
view_anglenumber10The target must be within this many degrees of where the dragon faces to be shot at.
active_speednumber0.6Speed while this goal is running.Range: 0 to …
flight_speednumber0.6Speed while this goal is not running.Range: 0 to …
turn_speednumber0.7How fast the dragon turns during this goal.Range: 0 to …
target_zoneFloatRange{"max":150,"min":10}Closest and farthest distance from the target where this goal can be used.
priorityinteger0Lower numbers run first: when two goals compete, the one with the smaller priority wins.Range: 0 to …
control_flagsGoal's control flags[]noneWhich body parts this goal takes over (move, look, jump), so goals using the same parts cannot run together.

Example

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

BP/entities/<name>.json
{
  "minecraft:behavior.dragonstrafeplayer": {
    "switch_direction_probability": 0.125,
    "target_in_range_and_in_view_time": 0.25,
    "fireball_range": 64,
    "view_angle": 10,
    "active_speed": 0.6,
    "flight_speed": 0.6,
    "turn_speed": 0.7,
    "target_zone": {
      "max": 150,
      "min": 10
    }
  }
}

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