Health & Combat
minecraft:health
Defines the health pool for an entity, measured in health points (1 point = half a heart). Typical values: cow (10), zombie (20), iron golem (100), wither (600).
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Integer | 20 | Starting health for this entity in health points. |
max | Integer | 20 | Maximum health this entity can have. Can be higher than starting value to allow healing beyond initial health. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:health', { value: 30, max: 30 });
minecraft:attack
Defines an entity's melee attack damage and any additional status effects applied on hit. Typical damage values range from 3 (zombie, creeper) to 7–21 (iron golem).
| Parameter | Type | Default | Description |
|---|---|---|---|
damage | Range of floats | not set | Range of the random amount of damage the melee attack deals. Can be a number, an array [min, max], or an object with range_min and range_max. |
effect_name | String | not set | Identifier of the status ailment to apply to an entity attacked by this entity's melee attack. |
effect_duration | Decimal | 0 | Duration in seconds of the status ailment applied to the damaged entity. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:attack', { damage: [3, 5] });
minecraft:attack_damage
Specifies how much damage is dealt by the entity when it attacks.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Range of integers | not set | How much an attack should damage a target. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:attack_damage', { value: 5 });
minecraft:attack_cooldown
Adds a cooldown to an entity to prevent it from attempting to acquire new attack targets.
| Parameter | Type | Default | Description |
|---|---|---|---|
attack_cooldown_time | Range of floats | not set | Amount of time in seconds for the cooldown. Can be a number or a pair (min and max). |
attack_cooldown_complete_event | Object | String | not set | Event to be run when the cooldown is complete. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:attack_cooldown', { attack_cooldown_time: [0.5, 1.0] });
minecraft:area_attack
A component that does damage to entities that get within range.
| Parameter | Type | Default | Description |
|---|---|---|---|
cause | String | not set | The type of damage that is applied to entities that enter the damage range (e.g. "entity_attack"). |
damage_per_tick | Integer | 2 | How much damage per tick is applied to entities that enter the damage range. |
damage_range | Integer | 0.2 | How close a hostile entity must be to have the damage applied. |
damage_cooldown | Decimal | 0 | Attack cooldown in seconds for how often this entity can attack a target. |
entity_filter | Minecraft filter | not set | The set of entities that are valid to apply the damage to when within range. |
play_attack_sound | Boolean | true | If the entity should play their attack sound when attacking a target. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:area_attack', { cause: 'entity_attack', damage_per_tick: 4, damage_range: 0.5 });
minecraft:damage_sensor
Defines what events to call when this entity is damaged by specific entities or items.
| Parameter | Type | Default | Description |
|---|---|---|---|
triggers | Object | Array | not set | List of triggers with the events to call when taking specific kinds of damage. Each trigger can specify cause, damage_modifier, damage_multiplier, deals_damage, filters, and on_damage. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:damage_sensor', {
triggers: { cause: 'fall', deals_damage: 'no' }
});
minecraft:knockback_resistance
Determines an entity's resistance to knockback from melee attacks. A value of 0.0 means no resistance, while 1.0 provides full immunity to knockback.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Decimal | not set | The amount of knockback resistance, from 0.0 (none) to 1.0 (full immunity). |
max | Decimal | not set | Maximum potential knockback resistance for this entity. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:knockback_resistance', { value: 0.5 });
minecraft:shooter
Defines the entity's ranged attack behavior. The minecraft:behavior.ranged_attack goal uses this component to determine which projectiles to shoot.
| Parameter | Type | Default | Description |
|---|---|---|---|
def | String | not set | Actor definition to use as the default projectile. Must have the projectile component. |
power | Decimal | 0 | Velocity at which projectiles will be shot. A power of 0 uses the default throw power. |
aux_val | Integer | -1 | ID of the Potion effect for the default projectile to be applied on hit. |
sound | String | not set | Sound that is played when the shooter shoots a projectile. |
magic | Boolean | false | Sets whether the projectiles being used are flagged as magic. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:shooter', { def: 'minecraft:arrow', sound: 'bow' });
minecraft:projectile
Allows the entity to be a thrown entity.
| Parameter | Type | Default | Description |
|---|---|---|---|
power | Decimal | 1.3 | Determines the velocity of the projectile. |
gravity | Decimal | 0.05 | The gravity applied to this entity when thrown. Higher values cause faster falling. |
hit_sound | String | not set | The sound that plays when the projectile hits something. |
catch_fire | Boolean | false | Determines whether the entity hit will be set on fire. |
knockback | Boolean | true | If true, the projectile will knock back the entity it hits. |
uncertainty_base | Decimal | 0 | The base accuracy of the projectile. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:projectile', { power: 1.5, gravity: 0.05 });
minecraft:explode
Defines how the entity explodes.
| Parameter | Type | Default | Description |
|---|---|---|---|
power | Decimal | 3 | The radius of the explosion in blocks and the amount of damage it deals. |
breaks_blocks | Boolean | true | If true, the explosion will destroy blocks in the explosion radius. |
causes_fire | Boolean | false | If true, blocks in the explosion radius will be set on fire. |
fuse_length | Range of integers | not set | The range for the random amount of time the fuse will be lit before exploding. |
fuse_lit | Boolean | false | If true, the fuse is already lit when this component is added. |
damage_scaling | Decimal | 1 | A scale factor applied to the explosion's damage to entities. 0 prevents damage; negatives heal. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:explode', { power: 4, breaks_blocks: true, causes_fire: false });
Movement
minecraft:movement
Defines the base movement speed of an entity. Typical values: creeper (0.2), cow (0.25), zombie baby (0.35).
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Decimal | not set | The base movement speed value. Higher values result in faster movement. |
max | Decimal | not set | Maximum movement speed this entity can have. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:movement', { value: 0.25 });
minecraft:flying_speed
Speed in blocks that this entity flies at.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Decimal | 0.02 | Flying speed in blocks per tick. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:flying_speed', { value: 0.1 });
minecraft:underwater_movement
Defines the speed with which an entity can move through water.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Decimal | not set | Movement speed of the entity under water. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:underwater_movement', { value: 0.15 });
minecraft:lava_movement
Allows a custom movement speed across lava blocks.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Decimal | not set | The speed the mob moves over a lava block. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:lava_movement', { value: 0.32 });
minecraft:water_movement
Customizes how the entity moves through water by adjusting drag coefficient. Lower values let entities glide easily; higher values create resistance.
| Parameter | Type | Default | Description |
|---|---|---|---|
drag_factor | Decimal | 0.8 | Drag factor to determine movement speed when in water. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:water_movement', { drag_factor: 0.98 });
minecraft:friction_modifier
Defines how much friction affects this entity.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Decimal | 1 | The higher the number, the more friction affects this entity. 1.0 means regular friction. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:friction_modifier', { value: 0.5 });
minecraft:jump.static
Gives the entity the ability to jump.
| Parameter | Type | Default | Description |
|---|---|---|---|
jump_power | Decimal | 0.42 | The initial vertical velocity for the jump. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:jump.static', { jump_power: 0.42 });
minecraft:jump.dynamic
Defines a dynamic type jump control that will change jump properties based on the speed modifier of the mob. Requires minecraft:movement.skip.
| Parameter | Type | Default | Description |
|---|---|---|---|
fast_skip_data | Object | not set | The jump data used for the fast skip (animation_duration, distance_scale, height, jump_delay). |
regular_skip_data | Object | not set | The jump data used for the regular skip. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:jump.dynamic', {});
minecraft:dash
Ability for a rideable entity to dash.
| Parameter | Type | Default | Description |
|---|---|---|---|
cooldown_time | Decimal | 1 | The dash cooldown in seconds. |
horizontal_momentum | Decimal | 1 | Horizontal momentum of the dash. |
vertical_momentum | Decimal | 1 | Vertical momentum of the dash. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:dash', { cooldown_time: 2.75, horizontal_momentum: 20, vertical_momentum: 0.6 });
minecraft:can_fly
Marks the entity as being able to fly; the pathfinder won't be restricted to paths where a solid block is required underneath it.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:can_fly', {});
minecraft:can_climb
Allows an entity to climb ladders.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:can_climb', {});
minecraft:can_power_jump
Allows the entity to power jump like the Horse does in Vanilla.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:can_power_jump', {});
minecraft:block_climber
Allows the entity to detect and maneuver on the scaffolding block.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:block_climber', {});
Navigation
minecraft:preferred_path
Specifies costing information for mobs that prefer to walk on preferred paths.
| Parameter | Type | Default | Description |
|---|---|---|---|
default_block_cost | Decimal | 0 | Cost for non-preferred blocks. |
jump_cost | Integer | 0 | Added cost for jumping up a node. |
max_fall_blocks | Integer | 3 | Distance mob can fall without taking damage. |
preferred_path_blocks | Array | not set | A list of block types with their associated pathfinding costs. Each entry has blocks (array) and cost (integer). |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:preferred_path', {
default_block_cost: 1.5,
jump_cost: 5,
preferred_path_blocks: [{ blocks: ['grass_path'], cost: 0 }]
});
Physics & Collision
minecraft:physics
Defines physics properties of an actor, including if it is affected by gravity or if it collides with objects.
| Parameter | Type | Default | Description |
|---|---|---|---|
has_collision | Boolean | true | Whether or not the entity collides with things. |
has_gravity | Boolean | true | Whether or not the entity is affected by gravity. |
push_towards_closest_space | Boolean | false | Whether or not the entity should be pushed towards the nearest open area when stuck inside a block. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:physics', { has_gravity: false });
minecraft:collision_box
Sets the width and height of the entity's collision box.
| Parameter | Type | Default | Description |
|---|---|---|---|
width | Decimal | 1 | Width of the collision box in blocks. A negative value will be assumed to be 0. |
height | Decimal | 1 | Height of the collision box in blocks. A negative value will be assumed to be 0. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:collision_box', { width: 0.6, height: 1.8 });
minecraft:pushable
Defines what can push an entity between other entities and pistons.
| Parameter | Type | Default | Description |
|---|---|---|---|
is_pushable | Boolean | true | Whether the entity can be pushed by other entities. |
is_pushable_by_piston | Boolean | true | Whether the entity can be pushed by pistons safely. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:pushable', { is_pushable: true, is_pushable_by_piston: true });
minecraft:push_through
Sets the distance through which the entity can push through.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Decimal | 0 | The value of the entity's push-through, in blocks. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:push_through', { value: 1 });
minecraft:buoyant
Enables an entity to float on the specified liquid blocks.
| Parameter | Type | Default | Description |
|---|---|---|---|
liquid_blocks | Array of strings | not set | List of blocks this entity can float on. Must be liquid blocks. |
base_buoyancy | Decimal | 1 | Base buoyancy used to calculate how much the entity will float. |
apply_gravity | Boolean | true | Applies gravity each tick outside liquids. |
movement_type | String | "waves" | Type of vertical movement: "waves", "bobbing", or "none". |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:buoyant', {
liquid_blocks: ['minecraft:water', 'minecraft:flowing_water'],
apply_gravity: false
});
minecraft:floats_in_liquid
Sets that this entity can float in liquid blocks.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:floats_in_liquid', {});
Appearance
minecraft:scale
Sets the entity's visual size multiplier. A value of 1.0 means normal size, 0.5 is half size (commonly used for baby mobs).
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Decimal | 1 | The scale multiplier for visual size. 1.0 = normal, 0.5 = half, 2.0 = double. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:scale', { value: 0.5 });
minecraft:scale_by_age
Defines the entity's size interpolation based on the entity's age.
| Parameter | Type | Default | Description |
|---|---|---|---|
start_scale | Decimal | 1 | Initial scale of the newborn entity. |
end_scale | Decimal | 1 | Ending scale of the entity when it's fully grown. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:scale_by_age', { start_scale: 0.5, end_scale: 1.0 });
minecraft:color
Defines the entity's main color. Only works on vanilla entities that have predefined color values (sheep, llama, shulker).
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Integer | 0 | The Palette Color value of the entity. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:color', { value: 1 });
minecraft:color2
Defines the entity's second texture color. Only works on vanilla entities that have a second predefined color value (tropical fish).
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Integer | 0 | The second Palette Color value of the entity. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:color2', { value: 2 });
minecraft:variant
Variant is used as a per-type way to express a different visual form of the same mob (e.g. cat breeds). Required for setting up multiple entity variants.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Integer | 0 | The Id of the variant. By convention, 0 is the base entity/default appearance. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:variant', { value: 1 });
minecraft:mark_variant
An additional per-type way (besides variant) to express a different visual form of the same mob.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Integer | 0 | The Id of the mark_variant. By convention, 0 is the base entity. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:mark_variant', { value: 1 });
minecraft:skin_id
Skin ID value. Can be used to differentiate skins, such as base skins for villagers. Requires multiple texture sets to be set up for the entity.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Integer | 0 | The ID of the skin. By convention, 0 is the ID of the base skin. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:skin_id', { value: 1 });
minecraft:walk_animation_speed
Sets the speed multiplier for this entity's walk animation speed.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Decimal | 1 | The higher the number, the faster the animation for walking plays. 1.0 = normal, 2.0 = twice as fast. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:walk_animation_speed', { value: 1.5 });
minecraft:default_look_angle
Sets this entity's default head rotation angle.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Decimal | 0 | Angle in degrees. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:default_look_angle', { value: -15 });
minecraft:sound_volume
Sets the entity's base volume for sound effects.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Decimal | 1 | The value of the volume the entity uses for sound effects. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:sound_volume', { value: 0.8 });
minecraft:ground_offset
Sets the offset from the ground that the entity is actually at.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Decimal | 0 | The value of the entity's offset from the terrain, in blocks. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:ground_offset', { value: 0.5 });
State Flags
minecraft:is_baby
Sets that this entity is a baby. Used to set the is_baby value for use in Molang queries and filters.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:is_baby', {});
minecraft:is_charged
Sets that this entity is charged. Used to set the is_charged value for use in Molang queries and filters.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:is_charged', {});
minecraft:is_chested
Sets that this entity is currently carrying a chest.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:is_chested', {});
minecraft:is_dyeable
Allows dyes to be used on this entity to change its color.
| Parameter | Type | Default | Description |
|---|---|---|---|
interact_text | String | not set | The text that will display when interacting with this entity with a dye when playing with Touch-screen controls. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:is_dyeable', { interact_text: 'action.interact.dye' });
minecraft:is_ignited
Sets that this entity is currently on fire.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:is_ignited', {});
minecraft:is_illager_captain
Sets that this entity is an Illager Captain.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:is_illager_captain', {});
minecraft:is_saddled
Sets that this entity is currently saddled.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:is_saddled', {});
minecraft:is_sheared
Sets that this entity is currently sheared.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:is_sheared', {});
minecraft:is_stackable
Allows instances of this entity to have vertical and horizontal collisions with each other. Both instances must have a minecraft:collision_box component.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Boolean | true | Whether this entity is stackable. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:is_stackable', {});
minecraft:is_stunned
Sets that this entity is currently stunned.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:is_stunned', {});
minecraft:is_tamed
Sets that this entity is currently tamed.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:is_tamed', {});
Interaction & Taming
minecraft:interact
Defines interactions with this entity.
| Parameter | Type | Default | Description |
|---|---|---|---|
interactions | Array | Object | not set | The list of interactions for this entity. Each can have give_item, interact_text, hurt_item, and more. |
cooldown | Decimal | 0 | Time in seconds before this entity can be interacted with again. |
interact_text | String | not set | Text to show when the player can interact with this entity (touch-screen controls). |
health_amount | Integer | 0 | The amount of health this entity will recover or lose when interacting with this item. Negative values harm the entity. |
hurt_item | Integer | 0 | The amount of damage the item will take when used to interact. 0 means no durability loss. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:interact', {
interactions: [{ give_item: true, interact_text: 'action.interact.give' }]
});
minecraft:tameable
This entity can be tamed.
| Parameter | Type | Default | Description |
|---|---|---|---|
tame_items | Array of strings | not set | The list of items that can be used to tame this entity. |
probability | Decimal | 1 | The chance of taming with each item use, from 0.0 to 1.0. |
tame_event | Object | String | not set | Event to fire when the entity is tamed. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:tameable', {
tame_items: ['bone'],
probability: 0.33,
tame_event: { event: 'minecraft:on_tame', target: 'self' }
});
minecraft:leashable
Describes how this mob can be leashed to other items.
| Parameter | Type | Default | Description |
|---|---|---|---|
soft_distance | Integer | 4 | Distance in blocks at which the spring effect starts acting. |
hard_distance | Integer | 6 | Distance in blocks at which the leash stiffens, restricting movement. |
max_distance | Integer | 0 | Distance in blocks at which the leash breaks. |
can_be_cut | Boolean | true | If true, players can cut incoming and outgoing leashes by using shears on the entity. |
on_leash | Object | String | not set | Event to call when this entity is leashed. |
on_unleash | Object | String | not set | Event to call when this entity is unleashed. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:leashable', { soft_distance: 4, hard_distance: 6, max_distance: 10 });
minecraft:nameable
Allows this entity to be named (e.g. using a name tag).
| Parameter | Type | Default | Description |
|---|---|---|---|
allow_name_tag_renaming | Boolean | true | If true, this entity can be renamed with name tags. |
always_show | Boolean | false | If true, the name will always be shown. |
default_trigger | String | not set | Trigger to run when the entity gets named. |
name_actions | Array | not set | Describes special names and the events to call when the entity acquires those names. Each entry has name_filter and on_named. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:nameable', { always_show: true });
minecraft:healable
Defines how entities heal — which items can be used to heal and for how much.
| Parameter | Type | Default | Description |
|---|---|---|---|
items | Array | not set | Array of items that can heal this entity. Each entry has item (identifier) and heal_amount (integer). |
force_use | Boolean | false | Determines if item can be used regardless of entity being at full health. |
filters | Minecraft filter | not set | Filter conditions for when this item can be used to heal. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:healable', {
items: [{ item: 'wheat', heal_amount: 2 }]
});
minecraft:rideable
This entity can be ridden.
| Parameter | Type | Default | Description |
|---|---|---|---|
seat_count | Integer | 1 | The number of entities that can ride this entity at the same time. |
family_types | Array of strings | not set | List of entity family types that can ride this entity. |
seats | Array | Object | not set | List of seat positions. Each entry has position ([x, y, z]) and optional lock_rider_rotation. |
controlling_seat | Integer | 0 | The seat that designates the driver of the entity. |
interact_text | String | not set | The text to display when the player can interact with the entity (touch-screen controls). |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:rideable', {
seat_count: 1,
family_types: ['player'],
seats: { position: [0, 1.0, 0] }
});
minecraft:sittable
Defines the entity's 'sit' state.
| Parameter | Type | Default | Description |
|---|---|---|---|
sit_event | Object | String | not set | Event to run when the entity enters the 'sit' state. |
stand_event | Object | String | not set | Event to run when the entity exits the 'sit' state. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:sittable', {});
minecraft:bribeable
Defines the way an entity can get into the 'bribed' state.
| Parameter | Type | Default | Description |
|---|---|---|---|
bribe_items | Array of strings | String | not set | The list of items that can be used to bribe the entity. |
bribe_cooldown | Decimal | 2 | Time in seconds before the entity can be bribed again. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:bribeable', { bribe_items: ['fish', 'salmon'] });
minecraft:giveable
Defines sets of items that can be used to trigger events when used on this entity. The item will be taken and placed in the entity's inventory.
| Parameter | Type | Default | Description |
|---|---|---|---|
items | Array of strings | String | not set | The list of items that can be given to the entity. |
cooldown | Decimal | 0 | An optional cool down in seconds to prevent spamming interactions. |
on_give | Object | String | not set | Event to fire when the correct item is given. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:giveable', { items: ['emerald'], on_give: 'on_receive_emerald' });
minecraft:balloonable
Allows this entity to have a balloon attached and defines the conditions and events for when it is ballooned.
| Parameter | Type | Default | Description |
|---|---|---|---|
mass | Decimal | 1 | Mass that this entity will have when computing balloon pull forces. |
soft_distance | Decimal | 2 | Distance in blocks at which the spring effect that lifts it activates. |
max_distance | Decimal | 10 | Distance in blocks at which the balloon breaks. |
on_balloon | Event Trigger | not set | Event to call when this entity is ballooned. |
on_unballoon | Event Trigger | not set | Event to call when this entity is unballooned. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:balloonable', { mass: 0.5 });
minecraft:boostable
Defines the conditions and behavior of a rideable entity's boost.
| Parameter | Type | Default | Description |
|---|---|---|---|
boost_items | Array | not set | List of items that can be used to boost while riding. Each has item, damage, and replace_item. |
duration | Decimal | 3 | Time in seconds for the boost. |
speed_multiplier | Decimal | 1 | Factor by which the entity's normal speed increases. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:boostable', {
speed_multiplier: 1.35,
duration: 3,
boost_items: [{ item: 'carrotOnAStick', damage: 2, replace_item: 'fishing_rod' }]
});
Breeding & Growth
minecraft:addrider
Adds a rider to the entity. Requires minecraft:rideable.
| Parameter | Type | Default | Description |
|---|---|---|---|
entity_type | String | not set | Type of entity to acquire as a rider. |
spawn_event | Event Reference | not set | Trigger event when a rider is acquired. |
riders | Array | [] | List of riders to add. Each has entity_type and optional spawn_event. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:addrider', { entity_type: 'minecraft:zombie' });
minecraft:breedable
Allows an entity to establish a way to get into the love state used for breeding. Commonly used with minecraft:behavior.breed.
| Parameter | Type | Default | Description |
|---|---|---|---|
breed_items | Array of strings | String | not set | The list of items that can get the entity into the 'love' state. |
breeds_with | Array | Object | not set | Entity definitions this entity can breed with. Each entry can have baby_type and breed_event. |
breed_cooldown | Decimal | 60 | Time in seconds before the entity can breed again. |
require_tame | Boolean | true | If true, the entities need to be tamed first before they can breed. |
causes_pregnancy | Boolean | false | If true, the entity will become pregnant instead of spawning a baby. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:breedable', {
breed_items: ['wheat'],
breeds_with: { baby_type: 'myaddon:custom_mob_baby', breed_event: 'minecraft:entity_born' }
});
minecraft:ageable
Adds a timer for the entity to grow up. It can be accelerated by giving the entity the items it likes as defined by feed_items.
| Parameter | Type | Default | Description |
|---|---|---|---|
duration | Decimal | 1200 | Length of time in seconds before an entity grows up. Use -1 to always stay a baby. |
feed_items | Array of strings | String | not set | List of items that can be fed to the entity to age them up. |
grow_up | Object | String | not set | Event to fire when the entity grows up. |
drop_items | Array of strings | not set | List of items dropped when an entity grows up. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:ageable', {
duration: 1200,
feed_items: ['wheat_seeds'],
grow_up: { event: 'minecraft:ageable_grow_up', target: 'self' }
});
minecraft:genetics
Defines the way a mob's genes and alleles are passed on to its offspring, and how those traits manifest in the child.
| Parameter | Type | Default | Description |
|---|---|---|---|
genes | Array | not set | The list of genes this entity has. Each entry has name, allele_range, and optional genetic_variants. |
mutation_rate | Decimal | 0.03125 | Chance that an allele will be replaced with a random one instead of the parent's during birth. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:genetics', {
mutation_rate: 0.02,
genes: [{ name: 'my_variant', allele_range: { range_min: 1, range_max: 5 } }]
});
minecraft:spawn_entity
Adds a timer after which this entity will spawn another entity or item (similar to a chicken's egg-laying behavior).
| Parameter | Type | Default | Description |
|---|---|---|---|
min_wait_time | Integer | 300 | Minimum amount of time in seconds to randomly wait before spawning. |
max_wait_time | Integer | 600 | Maximum amount of time in seconds to randomly wait before spawning. |
spawn_item | String | "egg" | Item identifier of the item to spawn. |
spawn_entity | String | not set | Identifier of the entity to spawn (leave empty to spawn an item instead). |
spawn_sound | String | "plop" | Identifier of the sound effect to play when spawning. |
single_use | Boolean | false | If true, this component will only ever spawn the entity once. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:spawn_entity', {
min_wait_time: 300, max_wait_time: 600, spawn_item: 'egg', spawn_sound: 'plop'
});
Equipment & Inventory
minecraft:inventory
Defines this entity's inventory properties.
| Parameter | Type | Default | Description |
|---|---|---|---|
inventory_size | Integer | 5 | Number of slots the container has. |
container_type | String | "none" | Type of container: "horse", "minecart_chest", "chest_boat", "minecart_hopper", "inventory", "container", or "hopper". |
can_be_siphoned_from | Boolean | false | If true, the contents of this inventory can be removed by a hopper. |
private | Boolean | false | If true, the entity will not drop its inventory on death. |
restrict_to_owner | Boolean | false | If true, the entity's inventory can only be accessed by its owner or itself. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:inventory', { inventory_size: 16, container_type: 'inventory' });
minecraft:equipment
Sets the equipment table to use for this entity.
| Parameter | Type | Default | Description |
|---|---|---|---|
table | String | not set | The file path to the equipment table, relative to the behavior pack's root. |
slot_drop_chance | Array | not set | A list of slots with the chance to drop an equipped item. Each entry has slot and drop_chance (0.0–1.0). |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:equipment', { table: 'loot_tables/equipment/custom_mob.json' });
minecraft:equippable
Defines an entity's behavior for having items equipped to it.
| Parameter | Type | Default | Description |
|---|---|---|---|
slots | Array | not set | List of slots and the items that can be equipped. Each entry has slot (integer), item, accepted_items, and optional on_equip/on_unequip. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:equippable', {
slots: [{ slot: 1, item: 'carpet', accepted_items: ['carpet'] }]
});
minecraft:loot
Specifies the loot table that determines what items this entity drops upon death.
| Parameter | Type | Default | Description |
|---|---|---|---|
table | String | not set | Path to the loot table JSON file, relative to the behavior pack's root (e.g., 'loot_tables/entities/custom_mob.json'). |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:loot', { table: 'loot_tables/entities/custom_mob.json' });
minecraft:economy_trade_table
Defines this entity's ability to trade with players using the economy trade system (villager-style).
| Parameter | Type | Default | Description |
|---|---|---|---|
table | String | not set | File path relative to the resource pack root for this entity's trades. |
display_name | String | not set | Name to be displayed while trading with this entity. |
new_screen | Boolean | false | Used to determine if trading with entity opens the new trade screen. |
show_trade_screen | Boolean | true | Show an in-game trade screen when interacting with the mob. |
persist_trades | Boolean | false | Determines if the trades should persist when the mob transforms. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:economy_trade_table', { table: 'trading/custom_trader.json', new_screen: true });
minecraft:trade_table
Defines this entity's ability to trade with players (non-economy version).
| Parameter | Type | Default | Description |
|---|---|---|---|
table | String | not set | File path relative to the behavior pack root for this entity's trades. |
display_name | String | not set | Name to be displayed while trading with this entity. |
new_screen | Boolean | false | Used to determine if trading with entity opens the new trade screen. |
persist_trades | Boolean | false | Determines if the trades should persist when the mob transforms. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:trade_table', { table: 'trading/custom_trader.json' });
Sensing & Triggers
minecraft:entity_sensor
A component that owns multiple subsensors, each firing an event when a set of conditions are met by other entities within range.
| Parameter | Type | Default | Description |
|---|---|---|---|
subsensors | Array | not set | The list of subsensors. Each has range ([h, v]), event, event_filters, minimum_count, maximum_count, and optional cooldown. |
find_players_only | Boolean | false | Limits the search to Players only for all subsensors. |
relative_range | Boolean | true | If true, the subsensors' range is additive on top of the entity's size. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:entity_sensor', {
subsensors: [{ range: [8, 8], event: 'on_player_nearby', minimum_count: 1 }]
});
minecraft:environment_sensor
Creates a trigger based on environment conditions.
| Parameter | Type | Default | Description |
|---|---|---|---|
triggers | Array | Object | not set | The list of triggers that fire when environment conditions match the given filter criteria. Each entry has event and filters. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:environment_sensor', {
triggers: { event: 'minecraft:become_hostile', filters: { test: 'is_brightness', operator: '<', value: 0.49 } }
});
minecraft:target_nearby_sensor
Defines the entity's range within which it can see or sense other entities to target them.
| Parameter | Type | Default | Description |
|---|---|---|---|
inside_range | Decimal | 1 | Maximum distance in blocks that another entity will be considered in the 'inside' range. |
outside_range | Decimal | 5 | Maximum distance in blocks considered in the 'outside' range. |
on_inside_range | Object | String | not set | Event to call when an entity gets in the inside range. |
on_outside_range | Object | String | not set | Event to call when an entity gets outside the outside range. |
must_see | Boolean | false | Whether the other entity needs to be visible to trigger inside events. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:target_nearby_sensor', {
inside_range: 2, outside_range: 5,
on_inside_range: { event: 'switch_to_melee', target: 'self' },
on_outside_range: { event: 'switch_to_ranged', target: 'self' }
});
minecraft:block_sensor
Fires off a specified event when a block in the block list is broken within the sensor range.
| Parameter | Type | Default | Description |
|---|---|---|---|
on_break | Array | not set | List of break entries. Each has block_list (array of strings) and on_block_broken (event name). |
sensor_radius | Decimal | 16 | Maximum radial distance in which a block can be detected. Max is 32.0. |
sources | Minecraft filter | not set | List of sources that break the block to listen for. If empty, all breaks are detected. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:block_sensor', {
sensor_radius: 16,
on_break: [{ block_list: ['minecraft:beehive', 'minecraft:bee_nest'], on_block_broken: 'hive_destroyed' }]
});
minecraft:inside_block_notifier
Verifies whether the entity is inside any of the listed blocks.
| Parameter | Type | Default | Description |
|---|---|---|---|
block_list | Array | not set | List of blocks to monitor. Each entry has block (name + optional states), entered_block_event, and exited_block_event. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:inside_block_notifier', {
block_list: [{ block: { name: 'minecraft:water' }, entered_block_event: { event: 'entered_water', target: 'self' } }]
});
minecraft:scheduler
Fires off scheduled mob events at time of day events.
| Parameter | Type | Default | Description |
|---|---|---|---|
scheduled_events | Array | Object | not set | The list of triggers that fire when conditions match the given filter criteria. Each entry has event and filters. |
min_delay_secs | Decimal | not set | Minimum delay in seconds before events can run. |
max_delay_secs | Decimal | not set | Maximum delay in seconds before events can run. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:scheduler', {
scheduled_events: [{ filters: { test: 'is_daytime', value: true }, event: 'daytime_event' }]
});
minecraft:timer
Adds a timer after which an event will fire.
| Parameter | Type | Default | Description |
|---|---|---|---|
time | Range of floats | Decimal | not set | Amount of time in seconds for the timer. Can be a number or pair (min and max). Incompatible with random_time_choices. |
time_down_event | Object | String | not set | Event to fire when the time runs out. |
looping | Boolean | true | If true, the timer will restart every time after it fires. |
randomInterval | Boolean | true | If true, the amount of time will be random between min and max values specified in time. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:timer', {
time: [10, 20], looping: true, time_down_event: { event: 'on_timer', target: 'self' }
});
minecraft:heartbeat
Defines the entity's heartbeat.
| Parameter | Type | Default | Description |
|---|---|---|---|
interval | String (Molang) | 1.00 | A Molang expression defining the inter-beat interval in seconds. A value of zero or less means no heartbeat. |
sound_event | Event Trigger | "heartbeat" | Level sound event to be played as the heartbeat sound. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:heartbeat', { interval: '2.0 - math.clamp(query.anger_level / 80 * 1.5, 0, 1.5)' });
Spawning & Despawning
minecraft:despawn
Despawns the actor when the despawn rules or optional filters evaluate to true.
| Parameter | Type | Default | Description |
|---|---|---|---|
despawn_from_chance | Boolean | true | Determines if min_range_random_chance is used in the standard despawn rules. |
despawn_from_inactivity | Boolean | true | Determines if the min_range_inactivity_timer is used in the standard despawn rules. |
min_range_inactivity_timer | Integer | 30 | Amount of time in seconds the mob must be inactive. |
min_range_random_chance | Integer | 800 | A random chance between 1 and the given value. |
filters | Minecraft filter | not set | Conditions that must be satisfied before the actor is despawned. If defined, standard rules are ignored. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:despawn', { despawn_from_distance: {} });
minecraft:instant_despawn
Despawns the actor immediately.
| Parameter | Type | Default | Description |
|---|---|---|---|
remove_child_entities | Boolean | false | If true, all entities linked to this entity in a child relationship will also be despawned. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:instant_despawn', {});
minecraft:persistent
Defines whether an entity should be persistent in the game world (i.e., it will never despawn naturally).
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:persistent', {});
Identity & Type
minecraft:type_family
Defines the family categories this entity belongs to. Used by filters and other game systems to group entities (e.g., 'mob', 'monster', 'undead', 'zombie').
| Parameter | Type | Default | Description |
|---|---|---|---|
family | Array of strings | not set | A set of tags describing the categories of this entity. Common values: "mob", "monster", "undead", "aquatic", "arthropod". |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:type_family', { family: ['mob', 'monster'] });
minecraft:strength
Defines the entity's strength to carry items.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Integer | 1 | The initial value of the strength. |
max | Integer | 5 | The maximum strength of this entity. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:strength', { value: 5, max: 5 });
minecraft:follow_range
Defines the maximum range, in blocks, that a mob will pursue a target.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Integer | not set | The default follow range in blocks. |
max | Integer | not set | Maximum follow distance in blocks. The entity will not pursue targets beyond this range. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:follow_range', { value: 35, max: 35 });
minecraft:group_size
Keeps track of entity group size in the given radius.
| Parameter | Type | Default | Description |
|---|---|---|---|
radius | Decimal | 16 | Radius from center of entity to count group members. |
filters | Minecraft filter | not set | Conditions that must be satisfied for other entities to be counted towards group size. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:group_size', {
radius: 32,
filters: { test: 'is_family', value: 'custom_mob' }
});
minecraft:experience_reward
Defines the experience points rewarded when this entity dies or is bred.
| Parameter | Type | Default | Description |
|---|---|---|---|
on_death | Molang | Decimal | not set | A Molang expression defining the amount of experience rewarded when this entity dies. |
on_bred | Molang | Decimal | not set | A Molang expression defining the amount of experience rewarded when this entity is bred. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:experience_reward', {
on_death: 'query.last_hit_by_player ? 5 : 0',
on_bred: 'Math.Random(1,7)'
});
Special Abilities
minecraft:transformation
Defines an entity's transformation from the current definition into another.
| Parameter | Type | Default | Description |
|---|---|---|---|
into | String | not set | Entity definition that this entity will transform into. |
delay | Decimal | Array | not set | Defines the properties of the delay for the transformation. |
transformation_sound | String | not set | Sound to play when the entity is done transforming. |
drop_equipment | Boolean | false | Cause the entity to drop all equipment upon transformation. |
keep_level | Boolean | false | If this entity has trades and has leveled up, it should maintain that level after transformation. |
preserve_equipment | Boolean | false | Cause the entity to keep equipment after going through transformation. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:transformation', { into: 'minecraft:zombie', transformation_sound: 'mob.pig.death' });
minecraft:boss
Defines the current state of the boss for updating the boss HUD.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | String | 55 | The name that will be displayed above the boss's health bar. |
hud_range | Integer | 55 | The max distance from the boss at which the boss's health bar is present on the player's screen. |
should_darken_sky | Boolean | false | Whether the sky should darken in the presence of the boss. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:boss', { name: 'Custom Boss', hud_range: 55, should_darken_sky: true });
minecraft:teleport
Defines an entity's teleporting behavior.
| Parameter | Type | Default | Description |
|---|---|---|---|
random_teleports | Boolean | true | If true, the entity will teleport randomly. |
min_random_teleport_time | Decimal | 0 | Minimum amount of time in seconds between random teleports. |
max_random_teleport_time | Decimal | 20 | Maximum amount of time in seconds between random teleports. |
target_distance | Decimal | 16 | Maximum distance the entity will teleport when chasing a target. |
dark_teleport_chance | Decimal | 0.01 | Modifies the chance that the entity will teleport if in darkness. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:teleport', { random_teleports: true, target_distance: 16 });
minecraft:barter
Enables the component to drop an item as a barter exchange.
| Parameter | Type | Default | Description |
|---|---|---|---|
barter_table | String | not set | Loot table that's used to drop a random item. |
cooldown_after_being_attacked | Range of integers | 0 | Duration in seconds for which the mob won't barter if it was hurt. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:barter', { barter_table: 'loot_tables/entities/piglin_barter.json' });
minecraft:admire_item
Allows an entity to ignore attackable targets for a given duration (while admiring an item).
| Parameter | Type | Default | Description |
|---|---|---|---|
duration | Integer | 10 | Duration in seconds that the mob is pacified. |
cooldown_after_being_attacked | Integer | 0 | Duration in seconds for which the mob won't admire items if it was hurt. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:admire_item', { duration: 10 });
minecraft:trust
Allows this entity to trust multiple players.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:trust', {});
minecraft:celebrate_hunt
Specifies hunt celebration behaviour.
| Parameter | Type | Default | Description |
|---|---|---|---|
broadcast | Boolean | true | If true, celebration will be broadcasted to other entities in the radius. |
duration | Integer | 4 | Duration in seconds of celebration. |
radius | Decimal | 16 | Radius in which it will notify other entities for celebration if broadcast is enabled. |
celebrate_sound | String | not set | The sound event to play when celebrating. |
celeberation_targets | Minecraft filter | not set | Conditions the target of the hunt must satisfy to initiate celebration. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:celebrate_hunt', { broadcast: true, duration: 4, radius: 16 });
minecraft:ravager_blocked
Defines the ravager's response to their melee attack being blocked.
| Parameter | Type | Default | Description |
|---|---|---|---|
knockback_strength | Decimal | 3 | The strength with which blocking entities should be knocked back. |
reaction_choices | Array of strings | [] | A list of weighted responses to the melee attack being blocked. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:ravager_blocked', { knockback_strength: 3 });
Survival
minecraft:breathable
Defines what blocks this entity can breathe in and gives them the ability to suffocate.
| Parameter | Type | Default | Description |
|---|---|---|---|
breathes_air | Boolean | true | If set, this entity can breathe in air. |
breathes_water | Boolean | false | If set, this entity can breathe in water. |
total_supply | Integer | 15 | Time in seconds the entity can hold its breath. |
suffocate_time | Integer | -20 | Time in seconds between suffocation damage. |
breathe_blocks | Array of strings | not set | List of blocks this entity can breathe in, in addition to the default items. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:breathable', { breathes_water: true, total_supply: 30 });
minecraft:burns_in_daylight
Specifies that this entity takes fire damage when exposed to direct sunlight. The entity will catch fire unless wearing armor in the protection slot, standing in water, or in shade.
| Parameter | Type | Default | Description |
|---|---|---|---|
protection_slot | String | "slot.armor.head" | The equipment slot that provides protection from burning in sunlight. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:burns_in_daylight', {});
minecraft:fire_immune
Sets that this entity doesn't take damage from fire.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:fire_immune', {});
minecraft:drying_out_timer
Adds a timer for drying out that will count down and fire events when the entity is out of water.
| Parameter | Type | Default | Description |
|---|---|---|---|
total_time | Decimal | 0 | Amount of time in seconds to dry out fully. |
dried_out_event | Object | String | not set | Event to fire when the drying out time runs out. |
stopped_drying_out_event | Object | String | not set | Event to fire when entity stopped drying out. |
water_bottle_refill_time | Decimal | 0 | Optional additional time given by using a splash water bottle on the entity. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:drying_out_timer', {
total_time: 120,
dried_out_event: { event: 'dried_out' },
stopped_drying_out_event: { event: 'stop_dryingout' }
});
minecraft:angry
Defines an entity's 'angry' state using a timer.
| Parameter | Type | Default | Description |
|---|---|---|---|
duration | Integer | 25 | The amount of time in seconds that the entity will be angry. |
broadcast_anger | Boolean | false | If set, other entities of the same type within the broadcastRange will also become angry. |
broadcast_range | Integer | 20 | Distance in blocks within which other entities of the same type will become angry. |
calm_event | Object | String | not set | Event to fire when this entity is calmed down. |
angry_sound | String | not set | The sound event to play when the mob is angry. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:angry', { duration: 25, broadcast_anger: true, broadcast_range: 20 });
minecraft:anger_level
Compels the entity to track anger towards a set of nuisances (like the Warden).
| Parameter | Type | Default | Description |
|---|---|---|---|
max_anger | Integer | 100 | The maximum anger level that can be reached. |
angry_threshold | Integer | 80 | Threshold that defines when the mob is considered angry at a nuisance. |
angry_boost | Integer | 20 | Anger boost applied to the angry threshold when mob gets angry. |
default_annoyingness | String | 0 | The default amount of annoyingness; specifies how much to raise anger level on each provocation. |
nuisance_filter | Minecraft filter | not set | Filter that is applied to determine if a mob can be a nuisance. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:anger_level', { max_anger: 150, angry_threshold: 80, angry_boost: 20 });
Body & Vehicle
minecraft:home
Saves a home position for when the entity is spawned. Allows entities like bees to remember and return to a specific location.
| Parameter | Type | Default | Description |
|---|---|---|---|
restriction_radius | Integer | 0 | Optional radius that the entity will be restricted to in relation to its home. |
restriction_type | String | "none" | How the entity is restricted: "none", "random_movement", or "all_movement". |
home_block_list | Array of strings | not set | Optional list of blocks that can be considered a valid home. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:home', { restriction_type: 'random_movement', restriction_radius: 32 });
minecraft:insomnia
Adds a timer since last rested to see if phantoms should spawn.
| Parameter | Type | Default | Description |
|---|---|---|---|
days_until_insomnia | Decimal | 3 | Number of days the mob has to stay up until the insomnia effect begins. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:insomnia', { days_until_insomnia: 3 });
minecraft:body_rotation_always_follows_head
Causes the entity's body rotation to match the one of their head. Does not override the minecraft:body_rotation_blocked component.
Acts as a boolean flag — no parameters. Its presence marks the entity with this state.
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:body_rotation_always_follows_head', {});
minecraft:horse.jump_strength
Determines the jump height for a horse or similar entity, like a donkey.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Decimal | Object | not set | Value of jump strength when spawned. Can be a decimal or an object with range_min and range_max. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:horse.jump_strength', { value: { range_min: 0.4, range_max: 1.0 } });
minecraft:variable_max_auto_step
Entities with this component will have a maximum auto step height that differs depending on whether they are on a block that prevents jumping.
| Parameter | Type | Default | Description |
|---|---|---|---|
base_value | Decimal | 0.5625 | The maximum auto step height when on any other block. |
controlled_value | Decimal | 0.5625 | The maximum auto step height when on any other block and controlled by the player. |
jump_prevented_value | Decimal | 0.5625 | The maximum auto step height when on a block that prevents jumping. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:variable_max_auto_step', { base_value: 1.0, jump_prevented_value: 0.5625 });
Misc
minecraft:conditional_bandwidth_optimization
Defines the Conditional Spatial Update Bandwidth Optimizations of this entity.
| Parameter | Type | Default | Description |
|---|---|---|---|
default_values | Object | not set | Default bandwidth optimization values with max_dropped_ticks, max_optimized_distance, and use_motion_prediction_hints. |
conditional_values | Array | not set | Conditional bandwidth optimization values with filter conditions. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:conditional_bandwidth_optimization', {
default_values: { max_dropped_ticks: 7, max_optimized_distance: 80, use_motion_prediction_hints: true }
});
minecraft:custom_hit_test
List of hitboxes for melee and ranged hits against the entity.
| Parameter | Type | Default | Description |
|---|---|---|---|
hitboxes | Array | not set | List of hitboxes. Each entry has width, height, and pivot ([x, y, z]). |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:custom_hit_test', {
hitboxes: [{ width: 2, height: 1.75, pivot: [0, 1, 0] }]
});
minecraft:tick_world
Defines if the entity ticks the world and the radius around it to tick.
| Parameter | Type | Default | Description |
|---|---|---|---|
radius | Integer | 2 | The area around the entity to tick. Value must be between 2 and 6. |
never_despawn | Boolean | true | If true, this entity will not despawn even if players are far away. |
distance_to_players | Decimal | 128 | The distance at which the closest player must be before this entity despawns (if never_despawn is false). |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:tick_world', { radius: 4, never_despawn: true });
minecraft:ambient_sound_interval
Delay for an entity playing its ambient sound.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | Decimal | 8 | Minimum time in seconds before the entity plays its ambient sound again. |
range | Decimal | 16 | Maximum time in seconds to randomly add to the ambient sound delay time. |
event_name | String | "ambient" | Level sound event to be played as the ambient sound. |
event_names | Array | not set | List of dynamic level sound events with conditions for choosing between them. Each entry has condition (Molang) and event_name. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:ambient_sound_interval', { value: 5, range: 5, event_name: 'ambient' });
AI: Movement Goals
Goals that control basic locomotion, wandering, and pathfinding toward locations.
minecraft:behavior.float
Allows the mob to stay afloat while swimming. Passengers will be kicked out when the mob's head goes underwater.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. The goal executes sooner as priority approaches 0. |
chance_per_tick_to_float | Decimal | 0.8 | The chance per tick to cause an upward impulse. |
sink_with_passengers | Boolean | false | If true, the mob will keep sinking as long as it has passengers. |
time_under_water_to_dismount_passengers | Decimal | 0 | Time in seconds that a floating vehicle's head can be underwater before causing passengers to dismount. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.float', { priority: 5 });
minecraft:behavior.random_stroll
Allows a mob to randomly stroll around.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
interval | Integer | 120 | 1/interval chance per tick to choose this goal. |
xz_dist | Integer | 10 | Distance in blocks on ground to look for a new spot. Must be at least 1. |
y_dist | Integer | 7 | Distance in blocks up or down to look for a new spot. Must be at least 1. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.random_stroll', { priority: 6, speed_multiplier: 0.8 });
minecraft:behavior.random_swim
Allows an entity to randomly move through water.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
interval | Integer | 120 | 1/interval chance per tick to choose this goal. |
xz_dist | Integer | 10 | Distance in blocks to look for a new spot horizontally. |
y_dist | Integer | 7 | Distance in blocks to look for a new spot vertically. |
avoid_surface | Boolean | true | If true, the mob will avoid surface water blocks by swimming below them. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.random_swim', { priority: 5, speed_multiplier: 1, xz_dist: 20 });
minecraft:behavior.random_fly
Allows a mob to randomly fly around.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
xz_dist | Integer | 10 | Distance in blocks horizontally to look for a new spot. Must be at least 1. |
y_dist | Integer | 7 | Distance in blocks vertically to look for a new spot. Must be at least 1. |
y_offset | Decimal | not set | Offset applied to the target Y position. |
can_land_on_trees | Boolean | true | If true, the mob can land on a tree instead of the ground. |
avoid_damage_blocks | Boolean | not set | If true, the mob avoids blocks that deal damage. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.random_fly', { priority: 3, can_land_on_trees: true, xz_dist: 15 });
minecraft:behavior.random_look_around
Allows the mob to randomly look around.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
look_time | Range | not set | Range of time in seconds the mob stays looking in a random direction. |
min_angle_of_view_horizontal | Integer | -30 | Leftmost horizontal angle the mob can look at. |
max_angle_of_view_horizontal | Integer | 30 | Rightmost horizontal angle the mob can look at. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.random_look_around', { priority: 8 });
minecraft:behavior.swim_wander
Allows the entity to wander around while swimming, when not path-finding.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Multiplier applied to entity speed when wandering. |
interval | Decimal | 0.00833 | Percent chance per tick to start wandering. 1 = 100%. |
look_ahead | Decimal | 5 | Distance to look ahead for obstacle avoidance. |
wander_time | Decimal | 5 | Amount of time in seconds to wander after wandering behavior starts. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.swim_wander', { priority: 4, speed_multiplier: 1 });
minecraft:behavior.random_breach
Allows the mob to randomly break the surface of the water.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
interval | Integer | 120 | 1/interval chance per tick to choose this goal. |
xz_dist | Integer | 10 | Horizontal search distance in blocks. |
y_dist | Integer | 7 | Vertical search distance in blocks. |
cooldown_time | Decimal | 0 | Cooldown in seconds before the goal can be used again. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.random_breach', { priority: 6, interval: 50, xz_dist: 6, cooldown_time: 2 });
minecraft:behavior.move_to_block
Allows the mob to move towards a specific block type.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
target_blocks | Array | not set | Block types to move to. |
search_range | Integer | 0 | The distance in blocks to look for the target block. |
search_height | Integer | 1 | The height in blocks to search for the target block. |
goal_radius | Decimal | 0.5 | Distance considered "at the goal". |
stay_duration | Decimal | 0 | Number of ticks to stay at the block once reached. |
target_selection_method | String | "nearest" | How to select the target block: "nearest" or "random". |
tick_interval | Integer | 20 | Average interval in ticks to try to run this behavior. |
on_reach | Event | not set | Event to run when the block is reached. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.move_to_block', {
priority: 5, target_blocks: ['minecraft:grass_block'], search_range: 16, speed_multiplier: 1
});
minecraft:behavior.move_to_water
Allows the mob to move back into water when on land.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
search_range | Integer | 0 | Distance in blocks to look for water. |
search_height | Integer | 1 | Height in blocks to look for water. |
search_count | Integer | 10 | Number of blocks per tick to check. 0 = check all blocks in range. |
goal_radius | Decimal | 0.5 | Distance considered "at the goal". |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.move_to_water', { priority: 1, search_range: 15, search_height: 5 });
minecraft:behavior.move_to_land
Allows the mob to move back onto land when in water.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
search_range | Integer | 0 | Distance in blocks to look for land. |
search_height | Integer | 1 | Height in blocks to look for land. |
search_count | Integer | 10 | Number of blocks per tick to check. 0 = check all blocks in range. |
goal_radius | Decimal | 0.5 | Distance considered "at the goal". |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.move_to_land', { priority: 6, search_count: 80, search_height: 8, search_range: 30 });
minecraft:behavior.go_home
Allows the mob to move back to the position they were spawned.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
interval | Integer | 120 | 1/interval chance per tick to choose this goal. |
goal_radius | Decimal | 0.5 | Distance considered close enough to the goal. |
calculate_new_path_radius | Decimal | 2 | Distance at which a new path segment is calculated toward home. |
on_home | Event | not set | Event(s) to run when the mob gets home. |
on_failed | Event | not set | Event(s) to run when this goal fails. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.go_home', { priority: 4, speed_multiplier: 1, interval: 60 });
minecraft:behavior.move_to_village
Allows the mob to move into a random location within a village.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
search_range | Integer | 0 | Distance in blocks to search for villages. If <= 0, finds the closest village. |
goal_radius | Decimal | 0.5 | Distance considered "at the goal". |
cooldown_time | Decimal | 0 | Cooldown in seconds before the goal can be used again. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.move_to_village', { priority: 5, speed_multiplier: 0.6, search_range: 32 });
minecraft:behavior.move_indoors
Allows this entity to move indoors.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 0.8 | Movement speed modifier while moving indoors. |
timeout_cooldown | Decimal | 8 | Cooldown in seconds before the goal can be reused after pathfinding fails. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.move_indoors', { priority: 3, speed_multiplier: 0.8 });
minecraft:behavior.stroll_towards_village
Allows the mob to move into a random location within a village within the search range.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
search_range | Integer | 0 | Distance in blocks to search for points inside villages. |
start_chance | Decimal | 0.1 | Chance (0–1) that the mob will start this goal. |
goal_radius | Decimal | 0.5 | Distance considered "at the goal". |
cooldown_time | Decimal | 0 | Cooldown in seconds before the goal can be used again. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.stroll_towards_village', { priority: 11, speed_multiplier: 1, search_range: 32, start_chance: 0.005 });
minecraft:behavior.stay_while_sitting
Allows the mob to stay put while it is in a sitting state instead of doing something else. Works with the minecraft:sittable component.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.stay_while_sitting', { priority: 2 });
AI: Combat Goals
Goals that drive attacking, targeting, and combat reactions.
minecraft:behavior.melee_attack
Allows an entity to deal damage through a melee attack. Requires a target and the minecraft:attack component.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when chasing the target. |
cooldown_time | Decimal | 1 | Cooldown in seconds between attacks. |
attack_once | Boolean | false | If true, this attack behavior can only be used once ever. |
can_spread_on_fire | Boolean | false | If the entity is on fire, the target can catch fire after being hit. |
melee_fov | Decimal | 90 | Field of view in degrees for sensing attack targets. |
on_attack | Event | not set | Event triggered on a successful attack. |
on_kill | Event | not set | Event triggered when the target is killed. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.melee_attack', { priority: 3, speed_multiplier: 1, cooldown_time: 0.5 });
minecraft:behavior.ranged_attack
Allows an entity to attack by using ranged shots. Requires minecraft:shooter to define projectile behaviour.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
attack_interval | Decimal | 0 | Consistent reload time in seconds (alternative to min/max). |
attack_interval_min | Decimal | 0 | Minimum reload time in seconds. |
attack_interval_max | Decimal | 0 | Maximum reload time in seconds. |
attack_radius | Decimal | 0 | Minimum distance to target before attempting to shoot. |
attack_radius_min | Decimal | 0 | Minimum distance — mob moves closer before firing if target is too close. |
burst_shots | Integer | 1 | Number of shots fired per charged-up burst attack. |
burst_interval | Decimal | 0 | Time in seconds between each shot in a burst. |
charge_shoot_trigger | Decimal | 0 | Time (in seconds) before burst shots begin reloading. |
ranged_fov | Decimal | 90 | Field of view in degrees when detecting targets. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when approaching target. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.ranged_attack', { priority: 3, attack_radius: 48, attack_interval_min: 3, attack_interval_max: 5 });
minecraft:behavior.charge_attack
Allows the entity to charge at the target and deal damage on contact.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Speed modifier when charging toward the target. |
min_distance | Decimal | 2 | Minimum distance to target before a charge can start. |
max_distance | Decimal | 3 | Maximum distance to target before a charge can start. |
success_rate | Decimal | 0.1428 | Percent chance (0–1) to start a charge attack if not already attacking. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.charge_attack', { priority: 4 });
minecraft:behavior.delayed_attack
Allows the entity to perform a melee attack with a configurable delay between the animation start and damage application.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when chasing target. |
attack_duration | Decimal | 0.75 | Duration of the attack animation in seconds. Also controls cooldown. |
hit_delay_pct | Decimal | 0.5 | Percentage into the attack animation at which damage is applied (1.0 = 100%). |
can_spread_on_fire | Boolean | false | If the entity is on fire, the target can catch fire. |
on_attack | Event | not set | Event triggered on a successful attack. |
on_kill | Event | not set | Event triggered when the target is killed. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.delayed_attack', { priority: 4, attack_duration: 0.75, hit_delay_pct: 0.5 });
minecraft:behavior.stomp_attack
Allows the entity to deal area-of-effect stomp damage to nearby entities.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when chasing target. |
cooldown_time | Decimal | 1 | Cooldown in seconds between attacks. |
no_damage_range_multiplier | Decimal | 2 | Multiplied with the AoE damage range to determine a no-damage range; attack goes on cooldown if target is inside. |
reach_multiplier | Decimal | 2 | Multiplied with entity base size to determine minimum target distance before dealing damage. |
on_attack | Event | not set | Event triggered on a successful attack. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.stomp_attack', { priority: 1, speed_multiplier: 1, cooldown_time: 1 });
minecraft:behavior.ram_attack
Allows the entity to perform a charging ram attack, knocking back the target.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
cooldown_range | Range | not set | Min/max cooldown range in seconds between ram attempts. |
min_ram_distance | Integer | 4 | Minimum distance to start a ram attack. |
ram_distance | Integer | 7 | Distance at which the mob starts running at ram speed. |
run_speed | Decimal | 1 | Speed when running toward the target. |
ram_speed | Decimal | 2 | Speed when charging toward the target. |
knockback_force | Decimal | 5 | Force of the knockback. |
knockback_height | Decimal | 0.1 | Height of the knockback. |
pre_ram_sound | String | not set | Sound event played before the ram. |
ram_impact_sound | String | not set | Sound event played on impact. |
on_start | Event | not set | Event triggered when the attack starts. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.ram_attack', { priority: 5, run_speed: 0.7, ram_speed: 1.8, knockback_force: 2.5 });
minecraft:behavior.swoop_attack
Allows a flying entity to swoop down and attack a target.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Speed multiplier when moving toward the target during a swoop. |
damage_reach | Decimal | 0.2 | Added to the base entity size to determine maximum allowed distance for dealing damage. |
delay_range | Range | not set | Min/max cooldown range in seconds between swoop attempts. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.swoop_attack', { priority: 2 });
minecraft:behavior.leap_at_target
Allows the mob to leap at a target. Must be used alongside a melee attack goal.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
yd | Decimal | 0 | Y-velocity component of the leap. |
must_be_on_ground | Boolean | true | If true, the mob must be on the ground before it can leap. |
set_persistent | Boolean | false | If true, allows the mob to be set persistent after leaping. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.leap_at_target', { priority: 3, yd: 0.4, must_be_on_ground: true });
minecraft:behavior.knockback_roar
Allows the entity to perform a roar attack that knocks back all nearby entities.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
duration | Decimal | 1 | Duration of the roar in seconds. |
attack_time | Decimal | 0.5 | The time in seconds the knockback occurs within the roar. |
knockback_damage | Integer | 6 | The damage dealt to entities hit by the knockback. |
knockback_range | Integer | 4 | The range of the knockback in blocks. |
knockback_strength | Integer | 3 | The strength of the knockback. |
knockback_horizontal_strength | Integer | 4 | Horizontal knockback strength. |
knockback_vertical_strength | Integer | 4 | Vertical knockback strength. |
cooldown_time | Decimal | 0.1 | Time in seconds before goal can be used again. |
on_roar_end | Event | not set | Event triggered when the roar finishes. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.knockback_roar', { priority: 1, duration: 1, knockback_range: 4, knockback_damage: 6 });
minecraft:behavior.sonic_boom
Allows the entity (Guardian Elder variant) to perform a sonic boom attack that bypasses shields.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
duration | Decimal | 3 | Goal duration in seconds. |
speed_multiplier | Decimal | 1.2 | Movement speed multiplier while executing. |
attack_damage | Decimal | 10 | Damage dealt to the target. |
attack_range_horizontal | Decimal | 16 | Horizontal range of the attack. |
attack_range_vertical | Decimal | 4 | Vertical range of the attack. |
attack_cooldown | Decimal | 2 | Cooldown in seconds after the attack. |
charge_sound | String | not set | Sound event played during the charge. |
on_attack_sound | String | not set | Sound event played on the attack. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.sonic_boom', { priority: 3, attack_damage: 10, attack_range_horizontal: 16 });
minecraft:behavior.hurt_by_target
Allows the mob to target another entity if this mob has been hurt by that entity.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
alert_same_type | Boolean | false | If true, nearby mobs of the same type will also target the attacker. |
hurt_owner | Boolean | false | If true, the owner mob will also target the attacker. |
entity_types | Array | not set | List of entity type filters that this mob will target after being hurt by them. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.hurt_by_target', { priority: 1, alert_same_type: true });
minecraft:behavior.nearest_attackable_target
Allows the mob to actively scan for and set a target to attack.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
entity_types | Array | not set | List of entity type filters defining valid attack targets. |
within_radius | Decimal | 0 | Distance in blocks to search for a target. 0 = unlimited. |
attack_interval | Integer | 0 | Time between scans for new targets in ticks. 0 = every tick. |
must_see | Boolean | false | If true, the mob must have line of sight to a target before setting it. |
must_see_forget_duration | Decimal | 3 | Time in seconds before forgetting a target that is no longer seen. |
reselect_targets | Boolean | false | If true, the mob will re-evaluate its target each scan. |
scan_interval | Integer | 10 | Interval in ticks between target scans. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.nearest_attackable_target', {
priority: 2,
entity_types: [{ filters: { test: 'is_family', subject: 'other', value: 'player' }, max_dist: 16 }],
must_see: true
});
minecraft:behavior.defend_village_target
Allows the mob to stay in a village and target intruders as a defender.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
entity_types | Array | not set | List of entity type filters defining what counts as a threat to the village. |
must_reach | Boolean | false | If true, the mob must reach the attacker before trying to defend. |
attack_chance | Decimal | 0.05 | Chance (0–1) the mob will attack an attacker seen attacking a villager. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.defend_village_target', { priority: 1, attack_chance: 0.05 });
AI: Interaction Goals
Goals for trading, item handling, following, looking, and social interactions.
minecraft:behavior.beg
Allows this mob to look at and follow the player that holds food they like.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
items | Array | not set | List of item identifiers this mob will beg for. |
look_distance | Decimal | 8 | Distance in blocks the mob will beg from. |
look_time | Range | not set | Range of time in seconds the mob will stare at the player holding food. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.beg', { priority: 9, items: ['minecraft:bone'], look_distance: 8 });
minecraft:behavior.tempt
Allows a mob to be tempted by a player holding a specific item. Uses pathfinding for movement.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
items | Array | [] | List of item identifiers that tempt this mob. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
stop_distance | Decimal | 1.5 | Distance at which the mob will stop following the player. |
can_get_scared | Boolean | false | If true, the mob can stop being tempted if the player moves too fast. |
can_tempt_vertically | Boolean | false | If true, vertical distance is considered when tempting. |
can_tempt_while_ridden | Boolean | false | If true, the mob can be tempted even if it has a passenger. |
tempt_sound | String | not set | Sound event played while the mob is being tempted. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.tempt', { priority: 4, items: ['minecraft:wheat'], speed_multiplier: 1.25 });
minecraft:behavior.trade_with_player
Allows the player to trade with this mob. When the goal starts it stops the mob's navigation.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
max_distance_from_player | Decimal | 8 | Maximum distance from the player before the goal exits. |
filters | Filter | not set | Conditions that must be met for the behavior to start. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.trade_with_player', { priority: 1, max_distance_from_player: 8 });
minecraft:behavior.pickup_items
Allows the mob to pick up items on the ground.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
max_dist | Decimal | 0 | Maximum distance to look for items to pick up. |
goal_radius | Decimal | 0.5 | Distance considered close enough to pick up the item. |
can_pickup_any_item | Boolean | false | If true, the mob can pick up any item. |
can_pickup_to_hand_or_equipment | Boolean | true | If true, the mob can pick up items into hand or armor slots. |
pickup_same_items_as_in_hand | Boolean | not set | If true, only pick up items matching what is already held. |
excluded_items | Array | not set | List of items this mob will not pick up. |
track_target | Boolean | false | If true, this mob will chase after the item as long as it is valid. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.pickup_items', { priority: 2, max_dist: 32, speed_multiplier: 6 });
minecraft:behavior.drop_item_for
Allows the entity to move toward a target and drop an item near them.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
loot_table | String | not set | Loot table containing possible items to drop. |
drop_item_chance | Decimal | 1 | Percent chance (0–1) the entity will drop an item. |
cooldown | Decimal | 0.2 | Cooldown in seconds between drops. |
goal_radius | Decimal | 0.5 | Distance considered close enough to the target. |
entity_types | Filter | not set | Conditions another entity must meet to be a valid target. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.drop_item_for', { priority: 10, loot_table: 'loot_tables/custom_drop.json', drop_item_chance: 0.75 });
minecraft:behavior.find_mount
Allows the mob to look around for another mob to ride atop it.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
within_radius | Decimal | 0 | Distance in blocks to look for a mount. |
mount_distance | Decimal | -1 | Distance to be from the mount to ride it. Defaults to attack distance if < 0. |
start_delay | Integer | 0 | Ticks to wait before moving toward the mount. |
target_needed | Boolean | false | If true, the mob will only look for a mount if it has a target. |
avoid_water | Boolean | false | If true, the mob will not go into water when going toward a mount. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.find_mount', { priority: 4, within_radius: 16, mount_distance: 2 });
minecraft:behavior.work
Allows the NPC to use a POI jobsite block.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 0.5 | Movement speed multiplier when using this goal. |
active_time | Integer | 0 | Ticks to stay at the work location. |
goal_cooldown | Integer | 0 | Ticks on cooldown before the goal can be used again. |
can_work_in_rain | Boolean | false | If true, this entity can work when their jobsite is rained on. |
work_in_rain_tolerance | Integer | -1 | If can_work_in_rain is false, max ticks remaining where rain does not interrupt. |
on_arrival | Event | not set | Event triggered when the mob reaches their jobsite. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.work', { priority: 7, speed_multiplier: 0.5, active_time: 250 });
minecraft:behavior.look_at_player
Compels an entity to look at the nearest player by rotating the head bone within a set limit.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
look_distance | Decimal | 8 | Distance in blocks to look for the nearest player. |
probability | Decimal | 0.02 | Probability of looking at the target (1.0 = 100%). |
look_time | Range | not set | Time range to look at the nearest player. |
angle_of_view_horizontal | Integer | 360 | Horizontal viewing angle in degrees. |
angle_of_view_vertical | Integer | 360 | Vertical viewing angle in degrees. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.look_at_player', { priority: 8, look_distance: 8, probability: 0.02 });
minecraft:behavior.look_at_entity
Compels an entity to look at a specific entity type by rotating the head bone within a set limit.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
look_distance | Decimal | 8 | Distance in blocks to look for the nearest entity. |
probability | Decimal | 0.02 | Probability of looking at the target (1.0 = 100%). |
filters | Filter | not set | Filter to determine which entities to look at. |
look_time | Range | not set | Time range to look at the nearest entity. |
angle_of_view_horizontal | Integer | 360 | Horizontal viewing angle in degrees. |
angle_of_view_vertical | Integer | 360 | Vertical viewing angle in degrees. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.look_at_entity', {
priority: 10, look_distance: 8,
filters: { test: 'is_family', subject: 'other', value: 'mob' }
});
minecraft:behavior.look_at_target
Compels an entity to look at its current target by rotating the head bone within a set limit.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
look_distance | Decimal | 8 | Distance in blocks to look at this mob's current target. |
probability | Decimal | 0.02 | Probability of looking at the target (1.0 = 100%). |
look_time | Range | not set | Time range to look at the current target. |
angle_of_view_horizontal | Integer | 360 | Horizontal viewing angle in degrees. |
angle_of_view_vertical | Integer | 360 | Vertical viewing angle in degrees. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.look_at_target', { priority: 5, look_distance: 8 });
minecraft:behavior.receive_love
Allows the villager to stop so another villager can breed with it. Can only be used by a Villager.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.receive_love', { priority: 3 });
minecraft:behavior.play
Allows the mob to play with other mobs by chasing each other and moving around randomly. Can only be used by Villagers.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
chance_to_start | Decimal | 0 | Percent chance (0–1) the mob starts this goal. |
follow_distance | Integer | 2 | Distance in blocks to be in range of the friend being followed. |
friend_search_area | Array | [6, 3, 6] | Dimensions of the AABB used to search for a potential friend. |
friend_types | Filter | not set | Entity type(s) to consider as potential play friends. |
max_play_duration_seconds | Decimal | 50 | Max seconds the mob will play before exiting the goal. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.play', { priority: 8, chance_to_start: 0.01, speed_multiplier: 0.6 });
minecraft:behavior.celebrate
Allows this entity to celebrate surviving a raid by making celebration sounds and jumping.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
duration | Decimal | 30 | Duration of the celebration in seconds. |
celebration_sound | String | not set | Sound event triggered during the celebration. |
sound_interval | Range | not set | Min/max time between sound events in seconds. |
jump_interval | Range | not set | Min/max time between jumping in seconds. |
on_celebration_end_event | Event | not set | Event triggered when the celebration ends. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.celebrate', { priority: 5, duration: 30, celebration_sound: 'celebrate' });
AI: Survival Goals
Goals for fleeing, hiding, avoiding threats, and consuming resources.
minecraft:behavior.panic
Allows the mob to enter the panic state, making it run around and away from the damage source.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when panicking. |
damage_sources | Array | (fire, lava, lightning, etc.) | List of damage source types that trigger this mob to panic. |
force | Boolean | false | If true, the mob will not stop panicking until it can't move. |
ignore_mob_damage | Boolean | false | If true, the mob will not panic from other mob damage. |
prefer_water | Boolean | false | If true, the mob will prefer water over land while panicking. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.panic', { priority: 1, speed_multiplier: 1.5 });
minecraft:behavior.avoid_mob_type
Allows the entity to run away from other entities that meet the specified criteria.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
entity_types | Array | not set | List of entity type filters defining which mobs to avoid, with optional speed multipliers. |
max_dist | Decimal | 3 | Maximum distance to look for an entity to avoid. |
max_flee | Decimal | 10 | Distance from the avoid target at which the entity stops fleeing. |
avoid_target_xz | Integer | 16 | XZ distance when choosing a next position to flee to. |
avoid_target_y | Integer | 7 | Y distance when choosing a next position to flee to. |
ignore_visibility | Boolean | false | Whether to ignore line of sight while fleeing. |
avoid_mob_sound | String | not set | Sound event played when the mob is avoiding another mob. |
on_escape_event | Event | not set | Event triggered when escaping from the target mob. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.avoid_mob_type', {
priority: 3,
entity_types: [{ filters: { test: 'is_family', subject: 'other', value: 'wolf' }, max_dist: 6, sprint_speed_multiplier: 1.2 }]
});
minecraft:behavior.avoid_block
Allows this entity to avoid certain block types.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
target_blocks | Array | not set | List of block types this mob avoids. |
search_range | Integer | 0 | Maximum XZ distance to look for a block to avoid. |
search_height | Integer | 0 | Maximum Y distance to look for a block to avoid. |
walk_speed_modifier | Decimal | 1 | Speed modifier when walking away from the block. |
sprint_speed_modifier | Decimal | 1 | Speed modifier when sprinting away from the block. |
tick_interval | Integer | 1 | Tick interval between checks. |
target_selection_method | String | "nearest" | Block search method. |
avoid_block_sound | String | not set | Sound event played when avoiding a block. |
on_escape | Event | not set | Event triggered when the entity escapes from the block. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.avoid_block', {
priority: 1, target_blocks: ['minecraft:warped_fungus'], search_range: 8, search_height: 4
});
minecraft:behavior.flee_sun
Allows the mob to run away from direct sunlight and seek shade. Typically used by undead mobs.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.flee_sun', { priority: 2, speed_multiplier: 1 });
minecraft:behavior.hide
Allows a mob with the hide component to attempt to move to and hide at an owned or nearby POI.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
duration | Decimal | 1 | Time in seconds the mob reacts. |
poi_type | String | not set | Defines what POI type to hide at. |
timeout_cooldown | Decimal | 8 | Cooldown in seconds before the goal can be reused after failure or timeout. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.hide', { priority: 4, poi_type: 'bed', speed_multiplier: 0.8 });
minecraft:behavior.find_cover
Allows the mob to seek shade.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
cooldown_time | Decimal | 0 | Cooldown in seconds before the goal can be used again. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.find_cover', { priority: 9, speed_multiplier: 1, cooldown_time: 5 });
minecraft:behavior.eat_block
Allows the entity to consume a block and replace it with another block, triggering an event.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
eat_and_replace_block_pairs | Array | not set | Pairs of eat_block / replace_block entries defining what is eaten and what replaces it. |
success_chance | String | 0.02 | Molang expression defining success chance per attempt. |
time_until_eat | Decimal | 1.8 | Time in seconds to consume the block after a successful attempt. |
on_eat | Event | not set | Event triggered when the eating animation completes. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.eat_block', {
priority: 6,
eat_and_replace_block_pairs: [{ eat_block: 'grass', replace_block: 'dirt' }]
});
minecraft:behavior.drink_milk
Allows the mob to drink milk based on specified environment conditions.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
cooldown_seconds | Decimal | 5 | Cooldown in seconds before the goal can be used again. |
filters | Filter | not set | Conditions that must be met for the behavior to start. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.drink_milk', { priority: 5, cooldown_seconds: 5 });
minecraft:behavior.drink_potion
Allows the mob to drink potions based on specified environment conditions.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_modifier | Decimal | 0 | Movement speed modifier while drinking a potion. 0 = no change. |
potions | Array | not set | List of potion entries. Each entry has id (potion ID), chance, and filters (conditions). |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.drink_potion', {
priority: 1, potions: [{ id: 21, chance: 1.0, filters: { test: 'on_fire', subject: 'self', value: true } }]
});
AI: Breeding & Social Goals
Goals for breeding, following, laying eggs, and warden-specific behaviors.
minecraft:behavior.breed
Allows this mob to breed with other mobs. Requires the minecraft:breedable component.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.breed', { priority: 3, speed_multiplier: 1 });
minecraft:behavior.follow_parent
Allows the mob to follow their parent around. Requires the minecraft:is_baby component.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.follow_parent', { priority: 5, speed_multiplier: 1.1 });
minecraft:behavior.follow_owner
Allows a mob to follow the player that owns it. Requires the entity to be tamed.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when following. |
start_distance | Decimal | 10 | Minimum distance from owner before the mob starts following. |
stop_distance | Decimal | 2 | Distance at which the mob stops following. |
can_teleport | Boolean | true | If true, the mob can teleport to its owner when too far away. |
max_distance | Decimal | 60 | Maximum distance before teleporting (only when can_teleport is false). |
ignore_vibration | Boolean | true | If true, the mob disregards following after detecting a vibration. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.follow_owner', { priority: 6, speed_multiplier: 8, start_distance: 16, stop_distance: 4 });
minecraft:behavior.follow_mob
Allows the mob to follow other mobs.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
search_range | Integer | 0 | Distance in blocks to look for a mob to follow. |
stop_distance | Decimal | 2 | Distance in blocks this mob stops from the mob it is following. |
filters | Filter | not set | Criteria for filtering which nearby mobs can be followed. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.follow_mob', { priority: 4, search_range: 20, speed_multiplier: 1, stop_distance: 3 });
minecraft:behavior.follow_caravan
Allows the mob to follow mobs that are in a caravan.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
entity_count | Integer | 1 | Number of entities that can be in the caravan. |
entity_types | Array | not set | List of entity type filters for mobs that can form this caravan. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.follow_caravan', { priority: 3, entity_count: 10, speed_multiplier: 2.1 });
minecraft:behavior.lay_egg
Allows the mob to lay an egg block on certain types of blocks if the mob is pregnant.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
egg_type | String | "minecraft:turtle_egg" | Block type for the egg to lay. |
target_blocks | Array | [minecraft:sand] | Blocks the mob can lay eggs on top of. |
search_range | Integer | 0 | Distance in blocks to look for a target block. |
search_height | Integer | 1 | Height in blocks to search for a target block. |
lay_seconds | Decimal | 10 | Duration of the egg-laying process in seconds. |
lay_egg_sound | String | "lay_egg" | Sound event played when laying the egg. |
goal_radius | Decimal | 0.5 | Distance considered close enough to the target block. |
on_lay | Event | not set | Event triggered when the mob lays the egg. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.lay_egg', {
priority: 2, egg_type: 'minecraft:frog_spawn', target_blocks: ['minecraft:water'], speed_multiplier: 1
});
minecraft:behavior.lay_down
Allows mobs to lay down at random intervals.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
interval | Integer | 120 | 1/interval chance per tick to choose this goal. |
random_stop_interval | Integer | 120 | 1/interval chance per tick to exit the behavior. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.lay_down', { priority: 5, interval: 120, random_stop_interval: 120 });
minecraft:behavior.make_love
Allows the villager to look for a mate to spawn other villagers with. Can only be used by Villagers.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.make_love', { priority: 5 });
minecraft:behavior.sleep
Allows mobs that own a bed in a village to move to and sleep in it. Can only be used by Villagers.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
cooldown_time | Decimal | 0 | Cooldown in seconds before the goal can be used again. |
sleep_collider_height | Decimal | 1 | Height of the mob's collider while sleeping. |
sleep_collider_width | Decimal | 1 | Width of the mob's collider while sleeping. |
sleep_y_offset | Decimal | 1 | Y offset of the mob's collider while sleeping. |
can_sleep_while_riding | Boolean | false | If true, the mob can use the sleep goal while riding something. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when moving to the bed. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.sleep', { priority: 3, cooldown_time: 0 });
minecraft:behavior.sniff
Allows this entity to detect the nearest player within the sniffing radius and update its suspect tracking state. Used by the Warden.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
duration | Decimal | 1 | Sniffing duration in seconds. |
sniffing_radius | Decimal | 5 | Mob detection radius in blocks. |
suspicion_radius_horizontal | Decimal | 3 | Horizontal radius within which a player increases anger level. |
suspicion_radius_vertical | Decimal | 3 | Vertical radius within which a player increases anger level. |
cooldown_range | Range | not set | Cooldown range between sniffs in seconds. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.sniff', { priority: 6, duration: 4.16, sniffing_radius: 24 });
minecraft:behavior.dig
Allows this entity to dig into the ground before despawning. Used by the Warden.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
duration | Decimal | 0 | Goal duration in seconds. |
idle_time | Decimal | 0 | Minimum idle time in seconds since the last disturbance before digging begins. |
digs_in_daylight | Boolean | false | If true, the entity starts digging when it sees daylight. |
allow_dig_when_named | Boolean | false | If true, this behavior can run when the entity is named. |
vibration_is_disturbance | Boolean | false | If true, vibrations count as disturbances that may delay digging. |
suspicion_is_disturbance | Boolean | false | If true, new suspicious locations count as disturbances. |
on_start | Event | not set | Event triggered when the goal starts. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.dig', { priority: 1, duration: 5.5, idle_time: 60, vibration_is_disturbance: true });
minecraft:behavior.emerge
Allows this entity to emerge from the ground. Used by the Warden.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
duration | Decimal | 5 | Goal duration in seconds. |
cooldown_time | Decimal | 0.5 | Cooldown in seconds before the goal can be used again. |
on_done | Event | not set | Event triggered when the goal is about to end. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.emerge', { priority: 1, duration: 7 });
minecraft:behavior.roar
Allows this entity to roar at another entity based on data in minecraft:anger_level. Applies anger boost and sets the target. Requires minecraft:anger_level.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
duration | Decimal | 0 | Amount of time to roar in seconds. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.roar', { priority: 2, duration: 4.2 });
minecraft:behavior.croak
Allows the entity to croak at a random time interval with configurable conditions. Used by the Frog.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
duration | Range | not set | Random range in seconds for how long the croaking lasts. |
interval | Range | not set | Random range in seconds between runs of this behavior. |
filters | Filter | not set | Conditions for the behavior to start and keep running. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.croak', { priority: 9, interval: [10, 20], duration: 4.5 });
minecraft:behavior.celebrate_survive
Allows this entity to celebrate surviving a raid by shooting fireworks.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
duration | Decimal | 30 | Duration of the celebration in seconds. |
fireworks_interval | Range | not set | Min/max time between firework launches in seconds. |
on_celebration_end_event | Event | not set | Event triggered when the celebration ends. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.celebrate_survive', { priority: 5, duration: 30 });
AI: Village & Raid Goals
Goals for village defense, raid mechanics, and specialized NPC behaviors.
minecraft:behavior.hold_ground
Compels an entity to stop at their current location, face a targeted mob, and react with an event. Requires a target.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
min_radius | Decimal | 10 | Minimum distance the target must be for the mob to run this goal. |
broadcast | Boolean | false | Whether to broadcast the mob's target to other mobs of the same type. |
broadcast_range | Decimal | 0 | Range in blocks for how far to broadcast. |
within_radius_event | Event | not set | Event triggered when the target is within the radius. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.hold_ground', { priority: 5, min_radius: 10, broadcast: true, broadcast_range: 8 });
minecraft:behavior.send_event
Allows the mob to send an event to another mob.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
cast_duration | Decimal | not set | Time in seconds for the entire event sending process. |
look_at_target | Boolean | true | If true, the mob will face the entity it sends an event to. |
sequence | Array | not set | List of events to send in sequence. |
event_choices | Array | not set | List of conditional event choices with weights and targeting. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.send_event', {
priority: 3, cast_duration: 3,
sequence: [{ base_delay: 0, event: 'minecraft:start_fangs', sound_event: 'cast.spell' }]
});
minecraft:behavior.summon_entity
Allows the mob to attack the player by summoning other entities. Requires format version 1.21.50+.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
summon_choices | Array | not set | List of summon spell definitions. Each entry has cast_duration, cooldown_time, weight, and sequence (spawn steps). |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.summon_entity', {
priority: 2,
summon_choices: [{ cast_duration: 2, cooldown_time: 5, weight: 3,
sequence: [{ entity_type: 'minecraft:vex', num_entities_spawned: 3 }] }]
});
minecraft:behavior.scared
Allows the mob to become scared when the weather outside is thundering.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
sound_interval | Integer | 0 | Interval for playing the scared sound; 1/interval chance per tick. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.scared', { priority: 1, sound_interval: 20 });
minecraft:behavior.controlled_by_player
Allows the entity to be controlled by the player using a held item. Requires minecraft:movement, minecraft:rideable, and minecraft:item_controllable.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
mount_speed_multiplier | Decimal | 1 | Speed multiplier when controlled by player. |
fractional_rotation | Decimal | 0.5 | Percentage of rotation toward player's facing direction per tick (0–1). |
fractional_rotation_limit | Decimal | 5 | Maximum degrees the entity can rotate per tick toward player's facing direction. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.controlled_by_player', { priority: 0, mount_speed_multiplier: 1.45 });
minecraft:behavior.move_to_poi
Allows the mob to move to a POI (Point of Interest) if able to.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 1 | Movement speed multiplier when using this goal. |
poi_type | String | not set | The POI type the goal should look for. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.move_to_poi', { priority: 6, poi_type: 'bed', speed_multiplier: 0.8 });
minecraft:behavior.work_composter
Allows the NPC to use the composter POI to convert excess seeds into bone meal.
| Parameter | Type | Default | Description |
|---|---|---|---|
priority | Integer | not set | Lower values = higher priority. |
speed_multiplier | Decimal | 0.5 | Movement speed multiplier when using this goal. |
active_time | Integer | 0 | Ticks to stay at the work location. |
can_work_in_rain | Boolean | false | If true, entity can work when the jobsite POI is rained on. |
can_empty_composter | Boolean | true | Whether the mob can empty a full composter. |
can_fill_composter | Boolean | true | Whether the mob can add items to an incomplete composter. |
min_item_count | Integer | 10 | Limits each compostable item; items over this count will be composted. |
items_per_use_max | Integer | 20 | Maximum items that can be added to the composter per block interaction. |
block_interaction_max | Integer | 1 | Maximum number of times the mob interacts with the composter. |
use_block_min | Integer | 100 | Minimum ticks between composter interactions. |
use_block_max | Integer | 200 | Maximum ticks between composter interactions. |
on_arrival | Event | not set | Event triggered when the mob reaches the composter. |
const entity = new Entity('Custom Mob', 'myaddon:custom_mob');
entity.addComponent('minecraft:behavior.work_composter', { priority: 8, speed_multiplier: 0.5, active_time: 250 });