minecraft:behavior.dragonstrafeplayer for you with a switch.Get GodCraftOverview
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
| Field | Type | Default | Description |
|---|---|---|---|
switch_direction_probability | number | 0.125 | Chance 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_time | number | 0.25 | Seconds the target must stay in range and in clear view before a fireball is shot. |
fireball_range | number | 64 | How far the fireball attack can reach. |
view_angle | number | 10 | The target must be within this many degrees of where the dragon faces to be shot at. |
active_speed | number | 0.6 | Speed while this goal is running.Range: 0 to … |
flight_speed | number | 0.6 | Speed while this goal is not running.Range: 0 to … |
turn_speed | number | 0.7 | How fast the dragon turns during this goal.Range: 0 to … |
target_zone | FloatRange | {"max":150,"min":10} | Closest and farthest distance from the target where this goal can be used. |
priority | integer | 0 | Lower numbers run first: when two goals compete, the one with the smaller priority wins.Range: 0 to … |
control_flags | Goal's control flags[] | none | Which 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
}
}
}