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

minecraft:behavior.controlled_by_player

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

Overview

minecraft:behavior.controlled_by_player is an entity component: it goes in the components object of a custom mob, or in one of its component groups. AI goal that lets a rider steer the mob while holding the right item, like a carrot on a stick for pigs. Also needs minecraft:item_controllable, minecraft:movement and minecraft:rideable.

Fields

FieldTypeDefaultDescription
fractional_rotationnumber0.5Share of the gap between where the mob faces and where the rider looks that is turned each tick.Range: 0.5 to 1
fractional_rotation_limitnumber5The most degrees the mob may turn in one tick.
mount_speed_multipliernumber1Speed multiplier while a player steers it.
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.controlled_by_player": {
    "fractional_rotation": 0.5,
    "fractional_rotation_limit": 5,
    "mount_speed_multiplier": 1,
    "priority": 0,
    "control_flags": []
  }
}

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