Actors - Components Module
anvil.api.actors.components
EntityAIAvoidBlock
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(tick_interval=1, search_range=0, search_height=0, walk_speed_modifier=1.0, sprint_speed_modifier=1.0, avoid_block_sound=None, sound_interval=None, target_selection_method='nearest', target_blocks=[])
Allows this entity to avoid certain blocks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tick_interval
|
int
|
Start tick interval. Defaults to 1. |
1
|
search_range
|
int
|
Maximum distance to look for a block in xz. Defaults to 0. |
0
|
search_height
|
int
|
Maximum distance to look for a block in y. Defaults to 0. |
0
|
walk_speed_modifier
|
float
|
Modifier for walking speed. Defaults to 1.0. |
1.0
|
sprint_speed_modifier
|
float
|
Modifier for sprint speed. Defaults to 1.0. |
1.0
|
avoid_block_sound
|
str
|
Sound event to play when avoiding a block. Defaults to None. |
None
|
sound_interval
|
list[float]
|
Range/time to randomly wait before playing the sound again. Defaults to None. |
None
|
target_selection_method
|
str
|
Block search method. Defaults to "nearest". |
'nearest'
|
target_blocks
|
list[str]
|
List of block types this mob avoids. Defaults to []. |
[]
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_avoid_block
__iter__()
Iterates over the component's fields.
on_escape(event, target=FilterSubject.Self)
Add an escape event to be triggered when the mob escapes the avoided block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
str
|
The event name to trigger. |
required |
target
|
FilterSubject
|
The event target. Defaults to FilterSubject.Self. |
Self
|
Returns:
| Name | Type | Description |
|---|---|---|
self |
for chaining. |
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIAvoidMobType
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(avoid_mob_sound=None, avoid_target_xz=16, avoid_target_y=7, ignore_visibility=False, probability_per_strength=1.0, remove_target=False, sound_interval=[3.0, 8.0], check_if_outnumbered=False, cooldown=0.0)
Compels an entity to run away from other entities that meet the criteria specified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
avoid_mob_sound
|
str
|
The sound event to play when the mob is avoiding another mob. Defaults to None. |
None
|
avoid_target_xz
|
int
|
The next target position the entity chooses to avoid another entity will be chosen within this XZ Distance. Defaults to 16. |
16
|
avoid_target_y
|
int
|
The next target position the entity chooses to avoid another entity will be chosen within this Y Distance. Defaults to 7. |
7
|
ignore_visibility
|
bool
|
Whether or not to ignore direct line of sight while this entity is running away from other specified entities. Defaults to False. |
False
|
probability_per_strength
|
float
|
Percent chance this entity will stop avoiding another entity based on that entity's strength, where 1.0 = 100%. Defaults to 1.0. |
1.0
|
remove_target
|
bool
|
Determine if we should remove target when fleeing or not. Defaults to False. |
False
|
sound_interval
|
list[float]
|
The range of time in seconds to randomly wait before playing the sound again. Defaults to [3.0, 8.0]. |
[3.0, 8.0]
|
check_if_outnumbered
|
bool
|
If true, the entity will only avoid other entities if it is outnumbered. Defaults to False. |
False
|
cooldown
|
float
|
Time in seconds the entity has to wait before using the goal again. Defaults to 0.0. |
0.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_avoid_mob_type
__iter__()
Iterates over the component's fields.
add_type(filter, max_dist=3.0, max_flee=10.0, sprint_distance=7.0, sprint_speed_multiplier=1.0, walk_speed_multiplier=1.0)
Adds a new entity type to the list of conditions another entity must meet to be a valid target to avoid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filter
|
Filter
|
Filter to determine which entities to avoid. |
required |
max_dist
|
float
|
Maximum distance to look for an avoid target for the entity. Defaults to 3.0. |
3.0
|
max_flee
|
float
|
How many blocks away from its avoid target the entity must be for it to stop fleeing from the avoid target. Defaults to 10.0. |
10.0
|
sprint_distance
|
float
|
How many blocks within range of its avoid target the entity must be for it to begin sprinting away from the avoid target. Defaults to 7.0. |
7.0
|
sprint_speed_multiplier
|
float
|
Multiplier for sprint speed. 1.0 means keep the regular speed, while higher numbers make the sprint speed faster. Defaults to 1.0. |
1.0
|
walk_speed_multiplier
|
float
|
Multiplier for walking speed. 1.0 means keep the regular speed, while higher numbers make the walking speed faster. Defaults to 1.0. |
1.0
|
on_escape_event(event, target=FilterSubject.Self)
Event that is triggered when escaping from a mob.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
str
|
Event to trigger. |
required |
target
|
FilterSubject
|
Target of the event. Defaults to FilterSubject.Self. |
Self
|
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIChargeAttack
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(max_distance=3, min_distance=2, success_rate=0.1428, speed_multiplier=1.0)
Compels an entity to damage a target by using a running attack.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_distance
|
int
|
A charge attack cannot start if the entity is farther than this distance to the target. Defaults to 3. |
3
|
min_distance
|
int
|
A charge attack cannot start if the entity is closer than this distance to the target. Defaults to 2. |
2
|
success_rate
|
float
|
Percent chance this entity will start a charge attack, if not already attacking (1.0 = 100%). Defaults to 0.1428. |
0.1428
|
speed_multiplier
|
float
|
Modifies the entity's speed when charging toward the target. Defaults to 1.0. |
1.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_charge_attack
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIDelayedAttack
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(attack_duration=0.75, attack_once=False, cooldown_time=1, hit_delay_pct=0.5, inner_boundary_time_increase=0.25, max_path_time=0.55, melee_fov=90, min_path_time=0.2, outer_boundary_time_increase=0.5, path_fail_time_increase=0.75, path_inner_boundary=16, path_outer_boundary=32, random_stop_interval=0, reach_multiplier=2, require_complete_path=False, speed_multiplier=1, track_target=False, x_max_rotation=30, y_max_head_rotation=30, can_spread_on_fire=False)
Compels an entity to attack while also delaying the damage dealt until a specific time in the attack animation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
attack_duration
|
float
|
The entity's attack animation will play out over this duration (in seconds). Also controls attack cooldown. Defaults to 0.75. |
0.75
|
attack_once
|
bool
|
Allows the entity to use this attack behavior, only once EVER. Defaults to False. |
False
|
cooldown_time
|
int
|
Cooldown time (in seconds) between attacks. Defaults to 1. |
1
|
hit_delay_pct
|
float
|
The percentage into the attack animation to apply the damage of the attack (1.0 = 100%). Defaults to 0.5. |
0.5
|
inner_boundary_time_increase
|
float
|
Time (in seconds) to add to attack path recalculation when the target is beyond the "path_inner_boundary". Defaults to 0.25. |
0.25
|
max_path_time
|
float
|
Maximum base time (in seconds) to recalculate new attack path to target (before increases applied). Defaults to 0.55. |
0.55
|
melee_fov
|
int
|
Field of view (in degrees) when using the sensing component to detect an attack target. Defaults to 90. |
90
|
min_path_time
|
float
|
Minimum base time (in seconds) to recalculate new attack path to target (before increases applied). Defaults to 0.2. |
0.2
|
outer_boundary_time_increase
|
float
|
Time (in seconds) to add to attack path recalculation when the target is beyond the "path_outer_boundary". Defaults to 0.5. |
0.5
|
path_fail_time_increase
|
float
|
Time (in seconds) to add to attack path recalculation when this entity cannot move along the current path. Defaults to 0.75. |
0.75
|
path_inner_boundary
|
int
|
Distance at which to increase attack path recalculation by "inner_boundary_tick_increase". Defaults to 16. |
16
|
path_outer_boundary
|
int
|
Distance at which to increase attack path recalculation by "outer_boundary_tick_increase". Defaults to 32. |
32
|
random_stop_interval
|
int
|
This entity will have a 1 in N chance to stop its current attack, where N = "random_stop_interval". Defaults to 0. |
0
|
reach_multiplier
|
int
|
Used with the base size of the entity to determine minimum target-distance before trying to deal attack damage. Defaults to 2. |
2
|
require_complete_path
|
bool
|
Toggles (on/off) the need to have a full path from the entity to the target when using this melee attack behavior. Defaults to False. |
False
|
speed_multiplier
|
float
|
This multiplier modifies the attacking entity's speed when moving toward the target. Defaults to 1. |
1
|
track_target
|
bool
|
Allows the entity to track the attack target, even if the entity has no sensing. Defaults to False. |
False
|
x_max_rotation
|
int
|
Maximum rotation (in degrees), on the X-axis, this entity can rotate while trying to look at the target. Defaults to 30. |
30
|
y_max_head_rotation
|
int
|
Maximum rotation (in degrees), on the Y-axis, this entity can rotate its head while trying to look at the target. Defaults to 30. |
30
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_delayed_attack
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIDig
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(duration=0, idle_time=0, allow_dig_when_named=False, digs_in_daylight=False, suspicion_is_disturbance=False, vibration_is_disturbance=False)
Allows this entity to dig into the ground before despawning.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
duration
|
seconds
|
Goal duration in seconds. Defaults to 0. |
0
|
idle_time
|
seconds
|
Minimum idle time in seconds between the last detected disturbance to the start of digging. Defaults to 0. |
0
|
allow_dig_when_named
|
bool
|
If true, this behavior can run when this entity is named. Defaults to False. |
False
|
digs_in_daylight
|
bool
|
If true, the actor should start digging when it sees daylight. Defaults to False. |
False
|
suspicion_is_disturbance
|
bool
|
If true, finding new suspicious locations count as disturbances that may delay start. Defaults to False. |
False
|
vibration_is_disturbance
|
bool
|
If true, vibrations count as disturbances that may delay start. Defaults to False. |
False
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_dig
__iter__()
Iterates over the component's fields.
on_start(event, target=FilterSubject.Self)
Sets an event to run when the dig goal starts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
str
|
The event name to trigger. |
required |
target
|
FilterSubject
|
The event target. Defaults to FilterSubject.Self. |
Self
|
Returns:
| Name | Type | Description |
|---|---|---|
self |
for chaining. |
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIDrinkMilk
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(cooldown_seconds=5, filters=None)
Allows the mob to drink milk based on specified environment conditions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cooldown_seconds
|
seconds
|
Time the goal is on cooldown before it can be used again. Defaults to 5. |
5
|
filters
|
Filter
|
Conditions that need to be met for the behavior to start. Defaults to None. |
None
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_drink_milk
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIEquipItem
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Compels an entity to equip an item.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIFloat
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(sink_with_passengers=False)
Allows an entity to float on water. Passengers will be kicked out the moment the mob's head goes underwater, which may not happen for tall mobs.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIFloatWander
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(additional_collision_buffer=False, allow_navigating_through_liquids=False, float_duration=(0.0, 0.0), float_wander_has_move_control=True, must_reach=False, navigate_around_surface=False, priority=0, random_reselect=False, surface_xz_dist=0, surface_y_dist=0, use_home_position_restriction=True, xz_dist=10, y_dist=7, y_offset=0.0)
Allows the mob to float around like the Ghast.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
additional_collision_buffer
|
bool
|
If true, the mob will have an additional buffer zone around it to avoid collisions with blocks when picking a position to wander to. Defaults to False. |
False
|
allow_navigating_through_liquids
|
bool
|
If true allows the mob to navigate through liquids on its way to the target position. Defaults to False. |
False
|
float_duration
|
tuple[Seconds, Seconds]
|
Range of time in seconds the mob will float around before landing and choosing to do something else. Defaults to (0.0, 0.0). |
(0.0, 0.0)
|
float_wander_has_move_control
|
bool
|
If true, the MoveControl flag will be added to the behavior which means that it can no longer be active at the same time as other behaviors with MoveControl. Defaults to True. |
True
|
must_reach
|
bool
|
If true, the point has to be reachable to be a valid target. Defaults to False. |
False
|
navigate_around_surface
|
bool
|
If true, will prioritize finding random positions in the vicinity of surfaces, i.e. blocks that are not Air or Liquid. Defaults to False. |
False
|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. Defaults to 0. |
0
|
random_reselect
|
bool
|
If true, the mob will randomly pick a new point while moving to the previously selected one. Defaults to False. |
False
|
surface_xz_dist
|
int
|
The horizontal distance in blocks that the goal will check for a surface from a candidate position. Only valid when navigate_around_surface is true. Defaults to 0. |
0
|
surface_y_dist
|
int
|
The vertical distance in blocks that the goal will check for a surface from a candidate position. Only valid when navigate_around_surface is true. Defaults to 0. |
0
|
use_home_position_restriction
|
bool
|
If true, the mob will respect home position restrictions when choosing new target positions. If false, it will choose target position without considering home restrictions. Defaults to True. |
True
|
xz_dist
|
int
|
Distance in blocks on ground that the mob will look for a new spot to move to. Must be at least 1. Defaults to 10. |
10
|
y_dist
|
int
|
Distance in blocks that the mob will look up or down for a new spot to move to. Must be at least 1. Defaults to 7. |
7
|
y_offset
|
float
|
Height in blocks to add to the selected target position. Defaults to 0.0. |
0.0
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_float_wander?view=minecraft-bedrock-stable
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIFollowMob
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(search_range=0, speed_multiplier=1.0, stop_distance=2)
Compels an entity to follow and gather around other mobs of the same type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
search_range
|
int
|
The distance in blocks it will look for a mob to follow. Defaults to 0. |
0
|
speed_multiplier
|
float
|
Movement speed multiplier of the mob when using this AI Goal. Defaults to 1.0. |
1.0
|
stop_distance
|
int
|
The distance in blocks this mob stops from the mob it is following. Defaults to 2. |
2
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_follow_mob
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIFollowOwner
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(can_teleport=True, ignore_vibration=True, max_distance=60.0, speed_multiplier=1.0, start_distance=10.0, stop_distance=2.0, post_teleport_distance=1)
Compels an entity to follow a player marked as an owner.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIFollowParent
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(speed_multiplier=1.0)
Compels an entity that has been tagged as a baby to follow their parent around.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIHurtByTarget
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(alert_same_type=False, entity_types=None, max_dist=16, must_see=False, must_see_forget_duration=3.0, reevaluate_description=False, sprint_speed_multiplier=1.0, walk_speed_multiplier=1.0, hurt_owner=False)
Compels an entity to react when hit by set target.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIKnockbackRoar
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(attack_time=0.5, cooldown_time=0.1, damage_filters=None, duration=1, knockback_damage=6, knockback_filters=None, knockback_height_cap=0.4, knockback_horizontal_strength=4, knockback_range=4, knockback_vertical_strength=4)
Compels an entity to emit a roar effect that knocks back other entities in a set radius from where the roar was emitted.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAILayDown
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(interval=120, random_stop_interval=120)
Compels an entity randomly lay down for a period of time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
interval
|
int
|
A random value to determine at what intervals something can occur. This has a 1/interval chance to choose this goal. Defaults to 120. |
120
|
random_stop_interval
|
int
|
A random value to determine at what interval the AI goal can stop. This has a 1/interval chance to stop this goal. Defaults to 120. |
120
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_lay_down
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAILeapAtTarget
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(must_be_on_ground=True, set_persistent=False, target_dist=0.3, yd=0.0)
Compels an entity to jump towards a target.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
must_be_on_ground
|
bool
|
If true, the mob will only jump at its target if its on the ground. Setting it to false will allow it to jump even if its already in the air. Defaults to True. |
True
|
set_persistent
|
bool
|
Allows the entity to be set to persist upon targeting a player. Defaults to False. |
False
|
target_dist
|
float
|
Distance in blocks the mob jumps when leaping at its target. Defaults to 0.3. |
0.3
|
yd
|
float
|
Height in blocks the mob jumps when leaping at its target. Defaults to 0.0. |
0.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_leap_at_target
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAILookAtPlayer
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(angle_of_view_horizontal=360, angle_of_view_vertical=360, look_distance=8.0, look_time=(2, 4), probability=0.02, target_distance=0.6)
Compels an entity to look at the player by rotating the head bone pose within a set limit.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAILookAtTarget
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(angle_of_view_horizontal=360, angle_of_view_vertical=360, look_distance=8.0, look_time=(2, 4), probability=0.02, target_distance=0.6)
Compels an entity to look at the target by rotating the head bone pose within a set limit.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIMeleeAttack
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(attack_once=False, cooldown_time=1, inner_boundary_time_increase=0.25, max_path_time=0.55, melee_fov=90, min_path_time=0.2, outer_boundary_time_increase=0.5, path_fail_time_increase=0.75, path_inner_boundary=16, path_outer_boundary=32, random_stop_interval=0, reach_multiplier=2, require_complete_path=False, speed_multiplier=1, track_target=False, x_max_rotation=30, y_max_head_rotation=30, can_spread_on_fire=False)
Compels entities to make close combat melee attacks.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIMeleeBoxAttack
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(attack_once=False, attack_types=[], can_spread_on_fire=False, cooldown_time=1, horizontal_reach=0.8, inner_boundary_time_increase=0.25, max_path_time=0.55, melee_fov=90, min_path_time=0.2, outer_boundary_time_increase=0.5, path_fail_time_increase=0.75, path_inner_boundary=16, path_outer_boundary=32, random_stop_interval=0, box_increase=2, require_complete_path=False, set_persistent=False, speed_multiplier=1, track_target=False, x_max_rotation=30, y_max_head_rotation=30)
Compels an entity to attack a target by stomping on them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
attack_once
|
bool
|
If true, the entity will only use this attack behavior once. Defaults to False. |
False
|
attack_types
|
list[str]
|
Defines the entity types this entity will attack. Defaults to []. |
[]
|
can_spread_on_fire
|
bool
|
If the entity is on fire, this allows the entity's target to catch on fire after being hit. Defaults to False. |
False
|
cooldown_time
|
seconds
|
Cooldown time (in seconds) between attacks. Defaults to 1. |
1
|
horizontal_reach
|
float
|
The attack reach of the entity will be a box with the size of the entity's bounds increased by this value in all horizontal directions. Defaults to 0.8. |
0.8
|
inner_boundary_time_increase
|
seconds
|
Time (in seconds) to add to attack path recalculation when the target is beyond the "path_inner_boundary". Defaults to 0.25. |
0.25
|
max_path_time
|
seconds
|
Maximum base time (in seconds) to recalculate new attack path to target (before increases applied). Defaults to 0.55. |
0.55
|
melee_fov
|
int
|
Field of view (in degrees) when using the sensing component to detect an attack target. Defaults to 90. |
90
|
min_path_time
|
seconds
|
Minimum base time (in seconds) to recalculate new attack path to target (before increases applied). Defaults to 0.2. |
0.2
|
outer_boundary_time_increase
|
seconds
|
Time (in seconds) to add to attack path recalculation when the target is beyond the "path_outer_boundary". Defaults to 0.5. |
0.5
|
path_fail_time_increase
|
seconds
|
Time (in seconds) to add to attack path recalculation when this entity cannot move along the current path. Defaults to 0.75. |
0.75
|
path_inner_boundary
|
float
|
Distance at which to increase attack path recalculation by "inner_boundary_tick_increase". Defaults to 16. |
16
|
path_outer_boundary
|
float
|
Distance at which to increase attack path recalculation by "outer_boundary_tick_increase". Defaults to 32. |
32
|
random_stop_interval
|
int
|
This entity will have a 1 in N chance to stop its current attack, where N = "random_stop_interval". Defaults to 0. |
0
|
box_increase
|
float
|
Used with the base size of the entity to determine minimum target-distance before trying to deal attack damage. Defaults to 2. |
2
|
require_complete_path
|
bool
|
Toggles (on/off) the need to have a full path from the entity to the target when using this melee attack behavior. Defaults to False. |
False
|
set_persistent
|
bool
|
Allows the entity to be set to persist upon targeting a player. Defaults to False. |
False
|
speed_multiplier
|
float
|
This multiplier modifies the attacking entity's speed when moving toward the target. Defaults to 1. |
1
|
track_target
|
bool
|
Allows the entity to track the attack target, even if the entity has no sensing. Defaults to False. |
False
|
x_max_rotation
|
int
|
Maximum rotation (in degrees), on the X-axis, this entity can rotate while trying to look at the target. Defaults to 30. |
30
|
y_max_head_rotation
|
int
|
Maximum rotation (in degrees), on the Y-axis, this entity can rotate its head while trying to look at the target. Defaults to 30. |
30
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_melee_box_attack
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIMoveToBlock
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(target_blocks, goal_radius=0.5, search_height=1, search_range=0, speed_multiplier=1.0, start_chance=1.0, stay_duration=0.0, target_offset=(0, 0, 0), target_selection_method='nearest', tick_interval=20)
Compels a mob to move towards a block.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIMoveToLand
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(goal_radius=0.5, search_count=10, search_height=1, search_range=0, speed_multiplier=1)
Compels an entity to move to land when on land.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
goal_radius
|
float
|
Distance in blocks within the mob considers it has reached the goal. This is the "wiggle room" to stop the AI from bouncing back and forth trying to reach a specific spot. Defaults to 0.5. |
0.5
|
search_count
|
int
|
The number of blocks each tick that the mob will check within its search range and height for a valid block to move to. A value of 0 will have the mob check every block within range in one tick. Defaults to 10. |
10
|
search_height
|
int
|
Height in blocks the mob will look for land to move towards. Defaults to 1. |
1
|
search_range
|
int
|
The distance in blocks it will look for land to move towards. Defaults to 0. |
0
|
speed_multiplier
|
float
|
Movement speed multiplier of the mob when using this AI Goal. Defaults to 1. |
1
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_move_to_land
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIMoveToLava
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(goal_radius=0.5, search_count=10, search_height=1, search_range=0, speed_multiplier=1)
Compels an entity to move to lava when on lava.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
goal_radius
|
float
|
Distance in blocks within the mob considers it has reached the goal. This is the "wiggle room" to stop the AI from bouncing back and forth trying to reach a specific spot. Defaults to 0.5. |
0.5
|
search_count
|
int
|
The number of blocks each tick that the mob will check within its search range and height for a valid block to move to. A value of 0 will have the mob check every block within range in one tick. Defaults to 10. |
10
|
search_height
|
int
|
Height in blocks the mob will look for lava to move towards. Defaults to 1. |
1
|
search_range
|
int
|
The distance in blocks it will look for lava to move towards. Defaults to 0. |
0
|
speed_multiplier
|
float
|
Movement speed multiplier of the mob when using this AI Goal. Defaults to 1. |
1
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_move_to_lava
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIMoveToRandomBlock
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(block_distance=16, speed_multiplier=1.0, within_radius=0.0)
Compels a mob to move towards a randomly chosen block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
block_distance
|
float
|
Distance from the mob (in blocks) used to choose the random block. Default: 16. |
16
|
speed_multiplier
|
float
|
Movement speed multiplier while using this goal. Default: 1.0. |
1.0
|
within_radius
|
float
|
Distance in blocks the mob must be from the block to consider movement finished. Default: 0.0. |
0.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_move_to_random_block
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIMoveToWater
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(goal_radius=0.5, search_count=10, search_height=1, search_range=0, speed_multiplier=1)
Compels an entity to move to water when on land.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
goal_radius
|
float
|
Distance in blocks within the mob considers it has reached the goal. This is the "wiggle room" to stop the AI from bouncing back and forth trying to reach a specific spot. Defaults to 0.5. |
0.5
|
search_count
|
int
|
The number of blocks each tick that the mob will check within its search range and height for a valid block to move to. A value of 0 will have the mob check every block within range in one tick. Defaults to 10. |
10
|
search_height
|
int
|
Height in blocks the mob will look for water to move towards. Defaults to 1. |
1
|
search_range
|
int
|
The distance in blocks it will look for water to move towards. Defaults to 0. |
0
|
speed_multiplier
|
float
|
Movement speed multiplier of the mob when using this AI Goal. Defaults to 1. |
1
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_move_to_water
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIMoveTowardsTarget
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(within_radius=0.0, speed_multiplier=1.0)
Compels an entity to move towards a target.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
within_radius
|
float
|
Defines the radius in blocks that the mob tries to be from the target. A value of 0 means it tries to occupy the same block as the target. Defaults to 0.0. |
0.0
|
speed_multiplier
|
float
|
Movement speed multiplier of the mob when using this AI Goal. Defaults to 1.0. |
1.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_move_towards_target
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAINearestAttackableTarget
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(attack_interval=0, attack_interval_min=0, attack_owner=False, must_reach=False, must_see=False, must_see_forget_duration=3.0, persist_time=0.0, reselect_targets=False, scan_interval=10, set_persistent=False, target_invisible_multiplier=0.7, target_search_height=-0.1, target_sneak_visibility_multiplier=0.8, within_radius=0.0)
Allows an entity to attack the closest target within a given subset of specific target types.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAINearestPrioritizedAttackableTarget
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(attack_interval=0, attack_interval_min=0, attack_owner=False, must_reach=False, must_see=False, must_see_forget_duration=3.0, persist_time=0.0, reevaluate_description=False, reselect_targets=False, scan_interval=10, set_persistent=False, target_invisible_multiplier=0.7, target_search_height=-0.1, target_sneak_visibility_multiplier=0.8, within_radius=0.0)
Allows an entity to attack the closest target within a given subset of specific target types.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIOcelotAttack
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(cooldown_time=1, max_distance=15, max_sneak_range=15, max_sprint_range=4, reach_multiplier=2, sneak_speed_multiplier=0.6, sprint_speed_multiplier=1.33, walk_speed_multiplier=0.8, x_max_rotation=30, y_max_head_rotation=30)
Allows an entity to attack by sneaking and pouncing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cooldown_time
|
int
|
Time (in seconds) between attacks. Defaults to 1. |
1
|
max_distance
|
int
|
Max distance from the target, this entity will use this attack behavior. Defaults to 15. |
15
|
max_sneak_range
|
int
|
Max distance from the target, this entity starts sneaking. Defaults to 15. |
15
|
max_sprint_range
|
int
|
Max distance from the target, this entity starts sprinting (sprinting takes priority over sneaking). Defaults to 4. |
4
|
reach_multiplier
|
int
|
Used with the base size of the entity to determine minimum target-distance before trying to deal attack damage. Defaults to 2. |
2
|
sneak_speed_multiplier
|
float
|
Modifies the attacking entity's movement speed while sneaking. Defaults to 0.6. |
0.6
|
sprint_speed_multiplier
|
float
|
Modifies the attacking entity's movement speed while sprinting. Defaults to 1.33. |
1.33
|
walk_speed_multiplier
|
float
|
Modifies the attacking entity's movement speed when not sneaking or sprinting, but still within attack range. Defaults to 0.8. |
0.8
|
x_max_rotation
|
int
|
Maximum rotation (in degrees), on the X-axis, this entity can rotate while trying to look at the target. Defaults to 30. |
30
|
y_max_head_rotation
|
int
|
Maximum rotation (in degrees), on the Y-axis, this entity can rotate its head while trying to look at the target. Defaults to 30. |
30
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_ocelotattack
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIOwnerHurtByTarget
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(entity_types=None, cooldown=0, filters=None, max_dist=16, must_see=False, must_see_forget_duration=3.0, reevaluate_description=False, sprint_speed_multiplier=1.0, walk_speed_multiplier=1.0)
Compels an entity to react when the owner is hit by a target.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_types
|
Filter
|
List of entity types that this mob can target if they hurt their owner. Defaults to None. |
None
|
cooldown
|
seconds
|
The amount of time in seconds that the mob has to wait before selecting a target of the same type again. Defaults to 0. |
0
|
filters
|
Filter
|
Conditions that make this entry in the list valid. Defaults to None. |
None
|
max_dist
|
int
|
Maximum distance this mob can be away to be a valid choice. Defaults to 16. |
16
|
must_see
|
bool
|
If true, the mob has to be visible to be a valid choice. Defaults to False. |
False
|
must_see_forget_duration
|
float
|
Determines the amount of time in seconds that this mob will look for a target before forgetting about it and looking for a new one when the target isn't visible any more. Defaults to 3.0. |
3.0
|
reevaluate_description
|
bool
|
If true, the mob will stop being targeted if it stops meeting any conditions. Defaults to False. |
False
|
sprint_speed_multiplier
|
float
|
Multiplier for the running speed. A value of 1.0 means the speed is unchanged. Defaults to 1.0. |
1.0
|
walk_speed_multiplier
|
float
|
Multiplier for the walking speed. A value of 1.0 means the speed is unchanged. Defaults to 1.0. |
1.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_owner_hurt_by_target
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIOwnerHurtTarget
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(entity_types=None, cooldown=0, filters=None, max_dist=16, must_see=False, must_see_forget_duration=3.0, reevaluate_description=False, sprint_speed_multiplier=1.0, walk_speed_multiplier=1.0)
Compels an entity to react when the owner hits a target.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_types
|
Filter
|
List of entity types that this mob can target if they hurt their owner. Defaults to None. |
None
|
cooldown
|
seconds
|
The amount of time in seconds that the mob has to wait before selecting a target of the same type again. Defaults to 0. |
0
|
filters
|
Filter
|
Conditions that make this entry in the list valid. Defaults to None. |
None
|
max_dist
|
int
|
Maximum distance this mob can be away to be a valid choice. Defaults to 16. |
16
|
must_see
|
bool
|
If true, the mob has to be visible to be a valid choice. Defaults to False. |
False
|
must_see_forget_duration
|
float
|
Determines the amount of time in seconds that this mob will look for a target before forgetting about it and looking for a new one when the target isn't visible any more. Defaults to 3.0. |
3.0
|
reevaluate_description
|
bool
|
If true, the mob will stop being targeted if it stops meeting any conditions. Defaults to False. |
False
|
sprint_speed_multiplier
|
float
|
Multiplier for the running speed. A value of 1.0 means the speed is unchanged. Defaults to 1.0. |
1.0
|
walk_speed_multiplier
|
float
|
Multiplier for the walking speed. A value of 1.0 means the speed is unchanged. Defaults to 1.0. |
1.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_owner_hurt_target
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIPanic
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(damage_sources=DamageCause.All, force=False, ignore_mob_damage=False, panic_sound=None, prefer_water=False, sound_interval=0, speed_multiplier=1.0)
Compels an entity to react when it receives damage.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIPlaceBlock
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(affected_by_griefing_rule=False, can_place=None, chance=0.0, placeable_carried_blocks=[], xz_range=(0, 0), y_range=(0, 0))
Compels an entity to place blocks in the world, such as Copper Golems placing statues.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
affected_by_griefing_rule
|
bool
|
Whether the goal is affected by the mob griefing game rule. Defaults to False. |
False
|
can_place
|
Filter
|
Filters for if the entity should try to place its block. Self and Target are set. Defaults to None. |
None
|
chance
|
float
|
Chance each tick for the entity to try and place a block. Defaults to 0.0. |
0.0
|
placeable_carried_blocks
|
list[BlockDescriptor]
|
Block descriptors for which blocks are valid to be placed from the entity's carried item, if empty all blocks are valid. Defaults to []. |
[]
|
xz_range
|
Vector2D
|
XZ range from which the entity will try and place blocks in. Defaults to (0, 0). |
(0, 0)
|
y_range
|
Vector2D
|
Y range from which the entity will try and place blocks in. Defaults to (0, 0). |
(0, 0)
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_place_block
__iter__()
Iterates over the component's fields.
on_place(event, target=FilterSubject.Self)
Sets the event to be triggered when the entity successfully places a block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
str
|
The name of the event to trigger. |
required |
target
|
FilterSubject
|
The target of the event. Defaults to FilterSubject.Self. |
Self
|
Returns:
| Name | Type | Description |
|---|---|---|
self |
Returns the current instance for method chaining. |
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
randomly_placeable_block(block, filter, states=None)
Sets the block that the entity can randomly place.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
block
|
BlockDescriptor
|
The block descriptor for which the block should be randomly placed. |
required |
filter
|
Filter
|
The filter that determines when the block can be placed. |
required |
states
|
dict[str, Any]
|
The states of the block to be placed. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
self |
Returns the current instance for method chaining. |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIPlayerRideTamed
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Allows an entity to be rideable after being tamed by a player.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIRamAttack
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(baby_knockback_modifier=0.333333, cooldown_range=[10, 20], knockback_force=5, knockback_height=0.1, min_ram_distance=0.0, pre_ram_sound=None, ram_distance=0.0, ram_impact_sound=None, ram_speed=2.0, run_speed=1.0)
Compels an entity to search for a random target and, if a direct path exists between the entity and the target, it will perform a charge. If the attack hits, the target will be knocked back based on the entity's speed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
baby_knockback_modifier
|
float
|
The modifier to knockback that babies have. Defaults to 0.333333. |
0.333333
|
cooldown_range
|
list[int, int]
|
Minimum and maximum cooldown time-range (positive, in seconds) between each attempted ram attack. Defaults to [10, 20]. |
[10, 20]
|
knockback_force
|
float
|
The force of the ram attack knockback. Defaults to 5. |
5
|
knockback_height
|
float
|
The height of the ram attack knockback. Defaults to 0.1. |
0.1
|
min_ram_distance
|
float
|
The minimum distance the entity can start a ram attack. Defaults to 0.0. |
0.0
|
pre_ram_sound
|
str
|
The sound to play when an entity is about to perform a ram attack. Defaults to None. |
None
|
ram_distance
|
float
|
The distance the mob start to run with ram speed. Defaults to 0.0. |
0.0
|
ram_impact_sound
|
str
|
The sound to play when an entity is impacting on a ram attack. Defaults to None. |
None
|
ram_speed
|
float
|
The entity's speed when charging toward the target. Defaults to 2.0. |
2.0
|
run_speed
|
float
|
The entity's speed when running toward the target. Defaults to 1.0. |
1.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_ram_attack
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIRandomBreach
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(interval=120, speed_multiplier=1.0, xz_dist=10, y_dist=7, cooldown_time=10)
Compels an entity to breach the surface of the water at a random interval.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
interval
|
int
|
A random value to determine when to randomly move somewhere. This has a 1/interval chance to choose this goal. Defaults to 120. |
120
|
speed_multiplier
|
float
|
Movement speed multiplier of the entity when using this AI Goal. Defaults to 1.0. |
1.0
|
xz_dist
|
int
|
Distance in blocks on ground that the entity will look for a new spot to move to. Must be at least 1. Defaults to 10. |
10
|
y_dist
|
int
|
Distance in blocks that the entity will look up or down for a new spot to move to. Must be at least 1. Defaults to 7. |
7
|
cooldown_time
|
seconds
|
The amount of time in seconds that the mob has to wait before selecting a target of the same type again. Defaults to 10. |
10
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIRandomHover
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(hover_height=(0.0, 0.0), interval=120, speed_multiplier=1.0, xz_dist=10, y_dist=7, y_offset=0.0)
Compels an entity to hover around randomly, close to the surface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hover_height
|
tuple[float, float]
|
The height above the surface which the entity will try to maintain. Defaults to (0.0, 0.0). |
(0.0, 0.0)
|
interval
|
int
|
A random value to determine when to randomly move somewhere. This has a 1/interval chance to choose this goal. Defaults to 120. |
120
|
speed_multiplier
|
float
|
Movement speed multiplier of the entity when using this AI Goal. Defaults to 1.0. |
1.0
|
xz_dist
|
int
|
Distance in blocks on ground that the entity will look for a new spot to move to. Must be at least 1. Defaults to 10. |
10
|
y_dist
|
int
|
Distance in blocks that the entity will look up or down for a new spot to move to. Must be at least 1. Defaults to 7. |
7
|
y_offset
|
float
|
Height in blocks to add to the selected target position. Defaults to 0.0. |
0.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_random_hover
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIRandomLookAround
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(angle_of_view_horizontal=360, angle_of_view_vertical=360, look_distance=8.0, look_time=(2, 4), probability=0.02, target_distance=0.6)
Compels an entity to choose a random direction to look in for a random duration within a range.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIRandomSearchAndDig
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(cooldown_range=(0, 0), digging_duration_range=(0, 0), find_valid_position_retries=0, goal_radius=1.5, item_table=None, search_range_xz=0, search_range_y=0, spawn_item_after_seconds=0, spawn_item_pos_offset=0, speed_multiplier=0, target_blocks=[], target_dig_position_offset=2.25)
Compels an entity to locate a random target block that it can find a path towards. Once found, the entity will move towards the target block and dig up an item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cooldown_range
|
tuple[Seconds, Seconds]
|
Goal cooldown range in seconds. Defaults to (0, 0). |
(0, 0)
|
digging_duration_range
|
tuple[Seconds, Seconds]
|
Digging duration in seconds. Defaults to (0, 0). |
(0, 0)
|
find_valid_position_retries
|
int
|
Amount of retries to find a valid target position within search range. Defaults to 0. |
0
|
goal_radius
|
float
|
Distance in blocks within the entity to consider it has reached the target position. Defaults to 1.5. |
1.5
|
item_table
|
str
|
File path relative to the resource pack root for items to spawn list (loot table format). Defaults to None. |
None
|
search_range_xz
|
float
|
Width and length of the volume around the entity used to find a valid target position. Defaults to 0. |
0
|
search_range_y
|
float
|
Height of the volume around the entity used to find a valid target position. Defaults to 0. |
0
|
spawn_item_after_seconds
|
seconds
|
Digging duration before spawning item in seconds. Defaults to 0. |
0
|
spawn_item_pos_offset
|
float
|
Distance to offset the item's spawn location in the direction the mob is facing. Defaults to 0. |
0
|
speed_multiplier
|
float
|
Search movement speed multiplier. Defaults to 0. |
0
|
target_blocks
|
list[str]
|
List of target block types on which the goal will look to dig. Overrides the default list. Defaults to []. |
[]
|
target_dig_position_offset
|
float
|
Dig target position offset from the feet position of the entity in their facing direction. Defaults to 2.25. |
2.25
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_random_search_and_dig
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIRandomSitting
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(cooldown_time=0, min_sit_time=10, start_chance=0.1, stop_chance=0.3)
Compels an entity to stop and sit for a random duration of time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cooldown_time
|
float
|
Time in seconds the entity has to wait before using the goal again. Defaults to 0. |
0
|
min_sit_time
|
float
|
The minimum amount of time in seconds before the entity can stand back up. Defaults to 10. |
10
|
start_chance
|
float
|
This is the chance that the entity will start this goal, from 0 to 1. Defaults to 0.1. |
0.1
|
stop_chance
|
float
|
This is the chance that the entity will stop this goal, from 0 to 1. Defaults to 0.3. |
0.3
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_random_sitting
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIRandomStroll
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(interval=120, speed_multiplier=1.0, xz_dist=10, y_dist=7)
Compels an entity to choose a random direction to walk towards.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
interval
|
int
|
A random value to determine when to randomly move somewhere. This has a 1/interval chance to choose this goal. Defaults to 120. |
120
|
speed_multiplier
|
float
|
Movement speed multiplier of the entity when using this AI Goal. Defaults to 1.0. |
1.0
|
xz_dist
|
int
|
Distance in blocks on ground that the entity will look for a new spot to move to. Must be at least 1. Defaults to 10. |
10
|
y_dist
|
int
|
Distance in blocks that the entity will look up or down for a new spot to move to. Must be at least 1. Defaults to 7. |
7
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_random_stroll
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIRandomSwim
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(avoid_surface=True, interval=120, speed_multiplier=1.0, xz_dist=10, y_dist=7)
Compels an entity to swim in a random point in water.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
avoid_surface
|
bool
|
If true, the entity will avoid surface water blocks by swimming below them. Defaults to True. |
True
|
interval
|
int
|
A random value to determine when to randomly move somewhere. This has a 1/interval chance to choose this goal. Defaults to 120. |
120
|
speed_multiplier
|
float
|
Movement speed multiplier of the entity when using this AI Goal. Defaults to 1.0. |
1.0
|
xz_dist
|
int
|
Distance in blocks on ground that the entity will look for a new spot to move to. Must be at least 1. Defaults to 10. |
10
|
y_dist
|
int
|
Distance in blocks that the entity will look up or down for a new spot to move to. Must be at least 1. Defaults to 7. |
7
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_random_swim
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIRangedAttack
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(attack_interval=0, attack_interval_max=0, attack_interval_min=0, attack_radius=0, attack_radius_min=0, burst_interval=0, burst_shots=1, charge_charged_trigger=0, charge_shoot_trigger=0, ranged_fov=90, set_persistent=False, speed_multiplier=1, swing=False, target_in_sight_time=1, x_max_rotation=30, y_max_head_rotation=30)
Allows an entity to attack by using ranged shots. charge_shoot_trigger must be greater than 0 to enable charged up burst-shot attacks. Requires minecraft:shooter to define projectile behavior.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIRiseToLiquidLevel
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(liquid_y_offset=0.0, rise_delta=0.0, sink_delta=0.0)
Compels an entity to rise to the top of a liquid block if they are located in one or have spawned under a liquid block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
liquid_y_offset
|
float
|
Target distance down from the liquid surface. i.e. Positive values move the target Y down. Defaults to 0.0. |
0.0
|
rise_delta
|
float
|
Movement up in Y per tick when below the liquid surface. Defaults to 0.0. |
0.0
|
sink_delta
|
float
|
Movement down in Y per tick when above the liquid surface. Defaults to 0.0. |
0.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_rise_to_liquid_level
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIRoar
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(duration=0.0)
Compels the entity to roar at another entity based on data in minecraft:anger_level. When the anger threshold specified in minecraft:anger_level has been reached, this entity will roar for the specified amount of time, look at the other entity, apply anger boost towards it, and finally target it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
duration
|
seconds
|
The amount of time to roar for. Defaults to 0.0. |
0.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_roar
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIRunAroundLikeCrazy
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(speed_multiplier=1.0)
Compels an entity to run around without a set goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. Defaults to 0. |
required |
speed_multiplier
|
float
|
Movement speed multiplier of the mob when using this AI Goal. Defaults to 1.0. |
1.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_run_around_like_crazy
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAISendEvent
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Compels an entity to send an event to another entity.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAISlimeKeepOnJumping
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(speed_multiplier=1.0)
Compels an entity to continuously jump around like a slime.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
speed_multiplier
|
float
|
Movement speed multiplier of the mob when using this AI Goal. Defaults to 1.0. |
1.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_slime_keep_on_jumping
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIStayWhileSitting
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Compels an entity to stay in place while sitting.
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_stay_while_sitting
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAIStompAttack
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(attack_once=False, attack_types=[], cooldown_time=1, inner_boundary_time_increase=0.25, max_path_time=0.55, melee_fov=90, min_path_time=0.2, no_damage_range_multiplier=2, outer_boundary_time_increase=0.5, path_fail_time_increase=0.75, path_inner_boundary=16, path_outer_boundary=32, random_stop_interval=0, reach_multiplier=2, require_complete_path=False, set_persistent=False, speed_multiplier=1, stomp_range_multiplier=2, track_target=False, x_max_rotation=30, y_max_head_rotation=30)
Compels an entity to attack a target by stomping on them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
attack_once
|
bool
|
If true, the entity will only use this attack behavior once. Defaults to False. |
False
|
attack_types
|
list[str]
|
Defines the entity types this entity will attack. Defaults to []. |
[]
|
cooldown_time
|
seconds
|
Cooldown time (in seconds) between attacks. Defaults to 1. |
1
|
inner_boundary_time_increase
|
seconds
|
Time (in seconds) to add to attack path recalculation when the target is beyond the "path_inner_boundary". Defaults to 0.25. |
0.25
|
max_path_time
|
seconds
|
Maximum base time (in seconds) to recalculate new attack path to target (before increases applied). Defaults to 0.55. |
0.55
|
melee_fov
|
int
|
Field of view (in degrees) when using the sensing component to detect an attack target. Defaults to 90. |
90
|
min_path_time
|
seconds
|
Minimum base time (in seconds) to recalculate new attack path to target (before increases applied). Defaults to 0.2. |
0.2
|
no_damage_range_multiplier
|
float
|
Multiplied with the final AoE damage range to determine a no damage range. The stomp attack will go on cooldown if target is in this no damage range. Defaults to 2. |
2
|
outer_boundary_time_increase
|
seconds
|
Time (in seconds) to add to attack path recalculation when the target is beyond the "path_outer_boundary". Defaults to 0.5. |
0.5
|
path_fail_time_increase
|
seconds
|
Time (in seconds) to add to attack path recalculation when this entity cannot move along the current path. Defaults to 0.75. |
0.75
|
path_inner_boundary
|
float
|
Distance at which to increase attack path recalculation by "inner_boundary_tick_increase". Defaults to 16. |
16
|
path_outer_boundary
|
float
|
Distance at which to increase attack path recalculation by "outer_boundary_tick_increase". Defaults to 32. |
32
|
random_stop_interval
|
int
|
This entity will have a 1 in N chance to stop its current attack, where N = "random_stop_interval". Defaults to 0. |
0
|
reach_multiplier
|
float
|
Used with the base size of the entity to determine minimum target-distance before trying to deal attack damage. Defaults to 2. |
2
|
require_complete_path
|
bool
|
Toggles (on/off) the need to have a full path from the entity to the target when using this melee attack behavior. Defaults to False. |
False
|
set_persistent
|
bool
|
Allows the entity to be set to persist upon targeting a player. Defaults to False. |
False
|
speed_multiplier
|
float
|
This multiplier modifies the attacking entity's speed when moving toward the target. Defaults to 1. |
1
|
stomp_range_multiplier
|
float
|
Multiplied with the base size of the entity to determine stomp AoE damage range. Defaults to 2. |
2
|
track_target
|
bool
|
Allows the entity to track the attack target, even if the entity has no sensing. Defaults to False. |
False
|
x_max_rotation
|
int
|
Maximum rotation (in degrees), on the X-axis, this entity can rotate while trying to look at the target. Defaults to 30. |
30
|
y_max_head_rotation
|
int
|
Maximum rotation (in degrees), on the Y-axis, this entity can rotate its head while trying to look at the target. Defaults to 30. |
30
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_stomp_attack
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAISummonEntity
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
compels an entity to attack other entities by summoning new entities.
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAITakeBlock
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(affected_by_griefing_rule=False, blocks=[], can_take=None, chance=0.0, requires_line_of_sight=False, xz_range=(0, 0), y_range=(0, 0))
Compels an entity to take blocks from the world, such as Endermen taking blocks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
affected_by_griefing_rule
|
bool
|
Whether the goal is affected by the mob griefing game rule. Defaults to False. |
False
|
blocks
|
list[BlockDescriptor]
|
Block descriptors for which blocks are valid to be taken by the entity, if empty all blocks are valid. Defaults to []. |
[]
|
can_take
|
Filter
|
Filters for if the entity should try to take a block. Self and Target are set. Defaults to None. |
None
|
chance
|
float
|
Chance each tick for the entity to try and take a block. Defaults to 0.0. |
0.0
|
requires_line_of_sight
|
bool
|
Whether the entity needs line of sight to the block they are trying to take. Defaults to False. |
False
|
xz_range
|
tuple[int, int]
|
XZ range from which the entity will try and take blocks from. Defaults to (0, 0). |
(0, 0)
|
y_range
|
tuple[int, int]
|
Y range from which the entity will try and take blocks from. Defaults to (0, 0). |
(0, 0)
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_take_block
__iter__()
Iterates over the component's fields.
on_take(event, target=FilterSubject.Self)
Sets the event to be triggered when the entity successfully takes a block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
str
|
The name of the event to trigger. |
required |
target
|
FilterSubject
|
The target of the event. Defaults to FilterSubject.Self. |
Self
|
Returns:
| Name | Type | Description |
|---|---|---|
self |
Returns the current instance for method chaining. |
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAITimerFlag1
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(cooldown_range=(10.0, 10.0), duration_range=(2.0, 2.0), *control_flags)
Fires an event when this behavior starts, then waits for a duration before stopping. When stopping to due the timeout or due to being interrupted by another behavior, the goal fires another event. query.timer_flag_1 will return 1.0 on both the client and server when this behavior is running, and 0.0 otherwise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cooldown_range
|
tuple[Seconds, Seconds]
|
The goal cooldown range, in seconds. Defaults to (10.0, 10.0). |
(10.0, 10.0)
|
duration_range
|
tuple[Seconds, Seconds]
|
The goal duration range, in seconds. Defaults to (2.0, 2.0). |
(2.0, 2.0)
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_timer_flag_1
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAITimerFlag2
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(cooldown_range=(10.0, 10.0), duration_range=(2.0, 2.0), *control_flags)
Fires an event when this behavior starts, then waits for a duration before stopping. When stopping to due the timeout or due to being interrupted by another behavior, the goal fires another event. query.timer_flag_2 will return 1.0 on both the client and server when this behavior is running, and 0.0 otherwise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cooldown_range
|
tuple[Seconds, Seconds]
|
The goal cooldown range, in seconds. Defaults to (10.0, 10.0). |
(10.0, 10.0)
|
duration_range
|
tuple[Seconds, Seconds]
|
The goal duration range, in seconds. Defaults to (2.0, 2.0). |
(2.0, 2.0)
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_timer_flag_2
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAITimerFlag3
Bases: _BaseAIGoal
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(cooldown_range=(10.0, 10.0), duration_range=(2.0, 2.0), *control_flags)
Fires an event when this behavior starts, then waits for a duration before stopping. When stopping to due the timeout or due to being interrupted by another behavior, the goal fires another event. query.timer_flag_3 will return 1.0 on both the client and server when this behavior is running, and 0.0 otherwise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cooldown_range
|
tuple[Seconds, Seconds]
|
The goal cooldown range, in seconds. Defaults to (10.0, 10.0). |
(10.0, 10.0)
|
duration_range
|
tuple[Seconds, Seconds]
|
The goal duration range, in seconds. Defaults to (2.0, 2.0). |
(2.0, 2.0)
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitygoals/minecraftbehavior_timer_flag_3
__iter__()
Iterates over the component's fields.
priority(priority)
The higher the priority, the sooner this behavior will be executed as a goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
int
|
The higher the priority, the sooner this behavior will be executed as a goal. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAddRider
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(entity_type, spawn_event=None)
Adds a rider to the entity. Requires minecraft:rideable..
Parameters
entity_type : Identifier.
The entity type that will be riding this
spawn_event : Event, optional.
The spawn event that will be used when the riding entity is created.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAdmireItem
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(cooldown_after_being_attacked, duration=10)
Causes the mob to ignore attackable targets for a given duration.
Parameters
cooldown_after_being_attacked : seconds int.
Duration, in seconds, for which mob won't admire items if it was hurt
duration : seconds int.
Duration, in seconds, that the mob is pacified. Default: 10
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAgeable
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(duration=1200.0, grow_up_event=None, grow_up_target=FilterSubject.Self, interact_filters=None, transform_to_item=None)
Adds a timer for the entity to grow up. The timer can be accelerated by giving the entity items it likes as defined by feed_items.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
duration
|
Seconds
|
Amount of time before the entity grows up, -1 for always a baby. Defaults to 1200.0. |
1200.0
|
grow_up_event
|
str
|
Event to initiate when the entity grows up. Defaults to None. |
None
|
interact_filters
|
Filter
|
A list of conditions to meet for the entity to be fed. Defaults to None. |
None
|
transform_to_item
|
str
|
The feed item used will transform into this item upon successful interaction. Format: itemName:auxValue. Defaults to None. |
None
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_ageable
__iter__()
Iterates over the component's fields.
drop_item(*items)
Adds an item to the list of items the entity drops when it grows up.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
str
|
The item to add to the list of items the entity drops when it grows up. |
required |
Returns
|
Ageable: Returns the Ageable component to allow for method chaining. |
required |
feed_item_growth(item, growth)
Adds an item to the list of items the entity can be fed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
str
|
The item to add to the list of items the entity can be fed. |
required |
growth
|
float
|
The amount of growth to add to the entity when fed this item. |
required |
Returns
|
Ageable: Returns the Ageable component to allow for method chaining. |
required |
feed_items(*items)
Adds an item to the list of items the entity can be fed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
str
|
The item to add to the list of items the entity can be fed. |
required |
Returns
|
Ageable: Returns the Ageable component to allow for method chaining. |
required |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAmbientSoundInterval
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(event_name, range=16, value=8)
A component that will set the entity's delay between playing its ambient sound.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_name
|
str
|
Level sound event to be played as the ambient sound. |
required |
range
|
float
|
Maximum time in seconds to randomly add to the ambient sound delay time. Defaults to 16. |
16
|
value
|
float
|
Minimum time in seconds before the entity plays its ambient sound again. Defaults to 8. |
8
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_ambient_sound_interval
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAngerLevel
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(anger_decrement_interval=1.0, angry_boost=20, angry_threshold=80, default_annoyingness=0, default_projectile_annoyingness=0, max_anger=100, nuisance_filter=None, on_increase_sounds=[], remove_targets_below_angry_threshold=True)
Compels the entity to track anger towards a set of nuisances.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anger_decrement_interval
|
Seconds
|
Anger level will decay over time. Defines how often anger towards all nuisances will decrease by one. Defaults to 1.0. |
1.0
|
angry_boost
|
int
|
Anger boost applied to angry threshold when the entity gets angry. Defaults to 20. |
20
|
angry_threshold
|
int
|
Defines when the entity is considered angry at a nuisance. Defaults to 80. |
80
|
default_annoyingness
|
int
|
Specifies the amount to raise anger level with each provocation. Defaults to 0. |
0
|
default_projectile_annoyingness
|
int
|
Specifies the amount to raise anger level with each projectile hit. Defaults to 0. |
0
|
max_anger
|
int
|
The maximum anger level that can be reached. Applies to any nuisance. Defaults to 100. |
100
|
nuisance_filter
|
Filter
|
Filter that is applied to determine if a mob can be a nuisance. Defaults to None. |
None
|
on_increase_sounds
|
list[dict[str, str]]
|
Sounds to play when the entity is getting provoked. Evaluated in order; the first matching condition wins. Defaults to []. |
[]
|
remove_targets_below_angry_threshold
|
bool
|
Defines if the entity should remove target if it falls below 'angry' threshold. Defaults to True. |
True
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_anger_level
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAngry
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(angry_sound=None, broadcast_anger=False, broadcast_anger_on_attack=False, broadcast_anger_on_being_attacked=False, broadcast_filters=None, broadcast_range=20, broadcast_targets=[], duration=25, duration_delta=0, filters=None, sound_interval=[0, 0])
Defines the entity's 'angry' state using a timer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
angry_sound
|
str
|
The sound event to play when the entity is angry. Defaults to None. |
None
|
broadcast_anger
|
bool
|
If true, other entities of the same entity definition within the broadcast_range will also become angry. Defaults to False. |
False
|
broadcast_anger_on_attack
|
bool
|
If true, other entities of the same entity definition within the broadcast_range will also become angry whenever this entity attacks. Defaults to False. |
False
|
broadcast_anger_on_being_attacked
|
bool
|
If true, other entities of the same entity definition within the broadcast_range will also become angry whenever this entity is attacked. Defaults to False. |
False
|
broadcast_filters
|
Filter
|
Conditions that make this entry in the list valid. Defaults to None. |
None
|
broadcast_range
|
int
|
Distance in blocks where other entities of the same entity definition will become angry. Defaults to 20. |
20
|
broadcast_targets
|
list[str]
|
A list of entity families to broadcast anger to. Defaults to []. |
[]
|
duration
|
Seconds
|
The amount of time in seconds that the entity will be angry. Defaults to 25. |
25
|
duration_delta
|
Seconds
|
Variance in seconds added to the duration [-delta, delta]. Defaults to 0. |
0
|
filters
|
Filter
|
Filter out mob types that should not be attacked while the entity is angry (other Piglins). Defaults to None. |
None
|
sound_interval
|
list[Seconds]
|
The range of time in seconds to wait before playing the angry_sound again. Defaults to [0, 0]. |
[0, 0]
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_angry
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAreaAttack
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(cause, damage_per_tick=2, damage_range=0.2)
Is a component that does damage to entities that get within range.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityAttack
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(damage, effect_duration=None, effect_name=None)
Defines an entity's melee attack and any additional effects on it.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityBodyRotationAlwaysFollowsHead
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Causes the entity's body to always be automatically rotated to align with the entity's head. Does not override the "minecraft:body_rotation_blocked" component.
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_body_rotation_always_follows_head
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityBodyRotationBlocked
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
When set, the entity will no longer visually rotate their body to match their facing direction.
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_body_rotation_blocked
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityBoss
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(name, hud_range=55, should_darken_sky=False)
Defines the current state of the boss for updating the boss HUD.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name that displays above the boss's health bar. |
required |
hud_range
|
int
|
The max distance from the boss at which the boss's health bar appears on the screen. Defaults to 55. |
55
|
should_darken_sky
|
bool
|
Whether the sky should darken in the presence of the boss. Defaults to False. |
False
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_boss
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityBreathable
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(breathes_air=True, breathes_lava=True, breathes_solids=False, breathes_water=False, generates_bubbles=True, inhale_time=0.0, suffocate_time=-20, total_supply=15, breathe_blocks=[], non_breathe_blocks=[])
Defines which blocks an entity can breathe in and defines the ability to suffocate in those blocks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
breathe_blocks
|
list[str]
|
List of blocks the entity can breathe in. Defaults to []. |
[]
|
breathes_air
|
bool
|
If true, the entity can breathe in air. Defaults to True. |
True
|
breathes_lava
|
bool
|
If true, the entity can breathe in lava. Defaults to True. |
True
|
breathes_solids
|
bool
|
If true, the entity can breathe in solid blocks. Defaults to False. |
False
|
breathes_water
|
bool
|
If true, the entity can breathe in water. Defaults to False. |
False
|
generates_bubbles
|
bool
|
If true, the entity will have visible bubbles while in water. Defaults to True. |
True
|
inhale_time
|
Seconds
|
Time in seconds to recover breath to maximum. Defaults to 0.0. |
0.0
|
non_breathe_blocks
|
list[str]
|
List of blocks the entity can't breathe in, in addition to the other "breathes" parameters. Defaults to []. |
[]
|
suffocate_time
|
int
|
Time in seconds between suffocation damage. Defaults to -20. |
-20
|
total_supply
|
int
|
Time in seconds the entity can hold its breath. Defaults to 15. |
15
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_breathable
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityBreedable
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(allow_sitting=False, blend_attributes=True, breed_cooldown=60, breed_items=None, causes_pregnancy=False, combine_parent_colors=None, extra_baby_chance=0, inherit_tamed=True, love_filters=None, mutation_strategy=BreedingMutationStrategy.None_, parent_centric_attribute_blending=None, property_inheritance=None, random_extra_variant_mutation_interval=(0, 0), random_variant_mutation_interval=(0, 0), require_full_health=False, require_tame=True, transform_to_item=None)
Allows an entity to get into the 'love' state used for breeding.
Commonly used in conjunction with the 'minecraft:behavior.breed' component.
Breedable Properties
- allow_sitting: If true, entities can breed while sitting.
- blend_attributes: If true, parent attributes will be blended for the offspring.
- breed_cooldown: Time in seconds before the entity can breed again.
- breed_items: The list of items that can trigger the 'love' state.
- causes_pregnancy: If true, the entity becomes pregnant instead of spawning a baby.
- combine_parent_colors: If true, parent's colors blend in the offspring.
- extra_baby_chance: Chance that up to 16 babies will spawn.
- inherit_tamed: If true, babies will inherit the tamed state.
- love_filters: Filters to run when attempting to enter the love state.
- mutation_strategy: Strategy used for mutating variants ('random' or 'none').
- parent_centric_attribute_blending: List of attributes to blend from parents.
- property_inheritance: List of entity properties inherited from parents.
- random_extra_variant_mutation_interval: Interval for extra variant mutation.
- random_variant_mutation_interval: Interval for variant mutation.
- require_full_health: If true, entity must be at full health to breed.
- require_tame: If true, entity must be tamed to breed.
- transform_to_item: Breed item used will transform to this item on use.
__iter__()
Iterates over the component's fields.
breeds_with(mate_type, baby_type, breed_event)
Defines the breeding partner for the entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mate_type
|
str
|
The entity type of the breeding partner. |
required |
baby_type
|
str
|
The entity type of the offspring. |
required |
breed_event
|
str
|
The event to trigger when breeding occurs. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary containing the breeding information. |
deny_parents_variant(chance, min_variant, max_variant)
Defines the chance of denying the parents' variant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chance
|
float
|
The percentage chance of denying the parents' variant. |
required |
min_variant
|
str
|
The inclusive minimum of the variant range. |
required |
max_variant
|
str
|
The inclusive maximum of the variant range. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary containing the deny parents variant information. |
environment_requirements(block_types, count, radius)
Defines the nearby block requirements for breeding.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
block_types
|
list[str]
|
The block types required nearby for breeding. |
required |
count
|
int
|
The number of required block types nearby for breeding. |
required |
radius
|
float
|
The radius in blocks to search for the required blocks. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary containing the environment requirements information. |
mutation_factor(color, extra_variant, variant)
Defines the mutation factor for the entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
color
|
float
|
The percentage chance of denying the parents' variant. |
required |
extra_variant
|
float
|
The percentage chance of a mutation on the entity's extra variant type. |
required |
variant
|
float
|
The percentage chance of a mutation on the entity's variant type. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary containing the mutation factor information. |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityBuoyant
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(liquid_blocks, apply_gravity=True, base_buoyancy=1.0, big_wave_probability=0.03, big_wave_speed=10.0, drag_down_on_buoyancy_removed=0.0, simulate_waves=True)
Allows an entity to float on the specified liquid blocks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
liquid_blocks
|
list[str]
|
List of blocks this entity can float on. Must be a liquid block. |
required |
apply_gravity
|
bool
|
Applies gravity each tick. Causes more of a wave simulation, but will cause more gravity to be applied outside liquids. Defaults to True. |
True
|
base_buoyancy
|
float
|
Base buoyancy used to calculate how much the entity will float. Defaults to 1.0. |
1.0
|
big_wave_probability
|
float
|
Probability of a big wave hitting the entity. Only used if simulate_waves is true. Defaults to 0.03. |
0.03
|
big_wave_speed
|
float
|
Multiplier for the speed to make a big wave. Triggered depending on big_wave_probability. Defaults to 10.0. |
10.0
|
drag_down_on_buoyancy_removed
|
float
|
How much an entity will be dragged down when the buoyancy component is removed. Defaults to 0.0. |
0.0
|
simulate_waves
|
bool
|
If true, the movement simulates waves going through. Defaults to True. |
True
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_buoyant
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityBurnsInDaylight
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Compels an entity to burn when it's daylight.
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_burns_in_daylight
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityCanClimb
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Allows this entity to climb up ladders.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityCanFly
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Marks the entity as being able to fly, the pathfinder won't be restricted to paths where a solid block is required underneath it.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityCanJoinRaid
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Determines that a given entity can join an existing raid.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityCanPowerJump
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Allows the entity to power jump like the horse does in vanilla.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityCannotBeAttacked
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
An entity with this component will NEVER be attacked by other entities.
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_cannot_be_attacked
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityCollisionBox
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(height, width)
Sets the width and height of the Entity's collision box.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityColor
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value)
Defines the entity's main color.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
int
|
The Palette Color value of the entity. |
required |
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_color
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityColor2
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value)
Defines the entity's second texture color.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
int
|
The Palette Color value of the entity. |
required |
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_color2
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityConditionalBandwidthOptimization
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(max_dropped_ticks=0, max_optimized_distance=0, use_motion_prediction_hints=False)
Defines the Conditional Spatial Update Bandwidth Optimizations of the entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_dropped_ticks
|
int
|
In relation to the optimization value, determines the maximum ticks spatial update packets can be not sent. |
0
|
max_optimized_distance
|
int
|
The maximum distance considered during bandwidth optimizations. Any value below the max is interpolated to find optimization, and any value greater than or equal to the max results in max optimization. |
0
|
use_motion_prediction_hints
|
bool
|
When set to true, smaller motion packets will be sent during drop packet intervals, resulting in the same amount of packets being sent as without optimizations but with less data being sent. This should be used to prevent visual oddities when entities are traveling quickly or teleporting. |
False
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_conditional_bandwidth_optimization
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityCustomHitTest
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(height, width, pivot=[0, 1, 0])
List of hitboxes for melee and ranged hits against the entity.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityDamageAbsorption
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(absorbable_causes=DamageCause.Nothing)
Allows an item to absorb damage that would otherwise be dealt to its wearer. The item must be equipped in an armor slot for this to happen. The absorbed damage reduces the item's durability, with any excess damage being ignored. The item must also have a minecraft:durability component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
absorbable_causes
|
list[str]
|
A list of damage causes that can be absorbed by the item. By default, no damage cause is absorbed. |
Nothing
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_damage_absorption
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityDamageSensor
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Defines what events to call when this entity is damaged by specific entities or items.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityDashAction
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(direction='entity', cooldown_time=1.0, horizontal_momentum=1.0, vertical_momentum=1.0)
Determines a rideable entity's ability to dash.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
direction
|
Literal[entity, passenger]
|
Should the momentum be applied in the direction of the 'entity' or 'passenger'. When 'entity' is used the momentum is applied horizontally according to the direction the entity is looking, using only the entity's yaw. When 'passenger' is used the momentum will be applied in the direction the controlling passenger is looking, using the passenger's pitch and yaw. |
'entity'
|
cooldown_time
|
Seconds
|
The dash cooldown time, in seconds. Defaults to 1.0. |
1.0
|
horizontal_momentum
|
float
|
Horizontal momentum of the dash. Defaults to 1.0. |
1.0
|
vertical_momentum
|
float
|
Vertical momentum of the dash. Defaults to 1.0. |
1.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_dash
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityDimensionBound
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Prevents the entity from changing dimension through portals.
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_dimension_bound
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityEnvironmentSensor
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Creates a trigger based on environment conditions.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityEquipItem
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(can_wear_armor=False, excluded_items=[])
Compels the entity to equip desired equipment.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityEquipment
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(path)
Sets the loot table for what items this entity drops upon death.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityEquippable
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Defines an entity's behavior for having items equipped to it.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
slot(slot, item, accepted_items, interact_text=None, on_equip=None, on_unequip=None)
Adds a slot to the entity's equippable slots.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
slot
|
int
|
The slot number of this slot. |
required |
item
|
str
|
Identifier of the item that can be equipped for the slot. |
required |
accepted_items
|
list[str]
|
The list of items that can fill this slot. |
required |
interact_text
|
str
|
Text to be displayed while playing with touch-screen controls when the entity can be equipped with this item. Defaults to None. |
None
|
on_equip
|
str
|
Event to trigger when the entity is equipped with the item. Defaults to None. |
None
|
on_unequip
|
str
|
Event to trigger when the item is removed from the entity. Defaults to None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Equippable |
Returns the Equippable component to allow for method chaining. |
EntityExperienceReward
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(on_bred=0, on_death=0)
Defines the amount of experience rewarded when the entity dies or is successfully bred.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
on_bred
|
int | float | Molang
|
A Molang expression defining the amount of experience rewarded when this entity is successfully bred. Defaults to 0. |
0
|
on_death
|
int | float | Molang
|
A Molang expression defining the amount of experience rewarded when this entity dies. Defaults to 0. |
0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_experience_reward
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityExplode
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(breaks_blocks=True, causes_fire=False, destroy_affected_by_griefing=False, fire_affected_by_griefing=False, fuse_length=[0.0, 0.0], fuse_lit=False, max_resistance=3.40282e+38, power=3, damage_scaling=1.0, toggles_blocks=False, knockback_scaling=1.0, particle_effect=ExplosionParticleEffect.Explosion, sound_effect='explode', negates_fall_damage=False, allow_underwater=True)
Defines how the entity explodes.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityFireImmune
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Allows an entity to take 0 damage from fire.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityFlyingSpeed
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value)
Sets the speed, in Blocks, at which the entity flies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
int
|
Flying speed in blocks per tick. |
required |
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityFlyingSpeedMeters
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value, max=None)
A component that defines the entity's flying movement speed in meters per second.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
float
|
Flying movement speed of the entity in meters per second. |
required |
max
|
float
|
Maximum flying movement speed of the entity in meters per second. Defaults to None. |
None
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_flying_speed
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityFollowRange
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value, max_range=None)
Defines the range of blocks that a mob will pursue a target.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityFreeCameraControlled
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(backwards_movement_modifier=0.5, strafe_speed_modifier=0.4)
Allows a rideable entity to be controlled in the air using WASD and mouse controls.
Only available with "use_beta_features": true and may be drastically changed or removed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
backwards_movement_modifier
|
float
|
Modifies speed when moving backwards. Defaults to 0.5. |
0.5
|
strafe_speed_modifier
|
float
|
Modifies the strafe speed. Defaults to 0.4. |
0.4
|
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityFrictionModifier
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value)
Defines how much friction affects this entity.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityHealth
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value, min=None, max=None)
Sets the amount of health this mob has.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityHorseJumpStrength
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(range_min, range_max)
Allows this mob to jump higher when being ridden by a player.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityIgnoreCannotBeAttacked
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(filters=None)
When set, blocks entities from attacking the owner entity unless they have the minecraft:ignore_cannot_be_attacked component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filters
|
Filter
|
Defines which entities are exceptions and are allowed to be attacked by the owner entity, potentially attacked entity is subject "other". If this is not specified then all attacks by the owner are allowed. |
None
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_ignore_cannot_be_attacked
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityInputGroundControlled
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Allows a ridable entity the ability to be controlled using keyboard controls when ridden by a player.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityInsideBlockNotifier
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Verifies whether the entity is inside any of the listed blocks.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityInstantDespawn
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(remove_child_entities=False)
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityInteract
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Defines the interactions that can be used with an entity.
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_interact
__iter__()
Iterates over the component's fields.
add_interaction(event, filter=None, add_items=None, cooldown=0.0, cooldown_after_being_attacked=0.0, drop_item_slot=-1, equip_item_slot=-1, health_amount=0, hurt_item=0, interact_text=None, play_sounds=None, spawn_entities=None, spawn_items=None, swing=False, transform_to_item=None, use_item=False, vibration=Vibrations.EntityInteract, repair_entity_item=None)
Adds an interaction to the entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
str
|
Event to trigger when the interaction occurs. |
required |
filter
|
Filter
|
Filter to determine which entities can interact with this entity. Defaults to None. |
None
|
add_items
|
str
|
File path, relative to the behavior Pack's path, to the loot table file. Defaults to None. |
None
|
cooldown
|
float
|
Time in seconds before this entity can be interacted with again. Defaults to 0.0. |
0.0
|
cooldown_after_being_attacked
|
float
|
Time in seconds before this entity can be interacted with after being attacked. Defaults to 0.0. |
0.0
|
drop_item_slot
|
int | Slots
|
Slot from which the item will be dropped when interacting with this entity. Defaults to -1. |
-1
|
equip_item_slot
|
int | Slots
|
Slot from which the item will be equipped when interacting with this entity. Defaults to -1. |
-1
|
health_amount
|
int
|
The amount of health this entity will recover or hurt when interacting with this item. Negative values will harm the entity. Defaults to 0. |
0
|
hurt_item
|
int
|
The amount of damage the item will take when used to interact with this entity. A value of 0 means the item won't lose durability. Defaults to 0. |
0
|
interact_text
|
str
|
Text to show while playing with touch-screen controls when the player is able to interact in this way with this entity. Defaults to None. |
None
|
play_sounds
|
str
|
One or more sound identifiers to play when the interaction occurs. Defaults to None. |
None
|
spawn_entities
|
str
|
Entity to spawn when the interaction occurs. Defaults to None. |
None
|
spawn_items
|
str
|
Loot table with items to drop on the ground upon successful interaction. Defaults to None. |
None
|
swing
|
bool
|
If true, the player will do the 'swing' animation when interacting with this entity. Defaults to False. |
False
|
transform_to_item
|
str
|
The item used will transform to this item upon successful interaction. Format: itemName:auxValue. Defaults to None. |
None
|
use_item
|
bool
|
If true, the interaction will use an item. Defaults to False. |
False
|
vibration
|
str
|
Vibration to emit when the interaction occurs. Admitted values are entity_interact (used by default), shear, and none (no vibration emitted). Defaults to None. |
EntityInteract
|
repair_entity_item
|
tuple[Slots, int]
|
Slot and amount to repair the item used to interact with this entity. Defaults to None. |
None
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_interact?view=minecraft-bedrock-stable#parameter
particle_on_start(particle_type, particle_offset_towards_interactor=False, particle_y_offset=0.0)
Adds a particle effect when the interaction starts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particle_type
|
str
|
Name of the particle system to run. |
required |
particle_offset_towards_interactor
|
bool
|
Whether or not the particle will appear closer to who performed the interaction. Defaults to False. |
False
|
particle_y_offset
|
float
|
Vertical offset of the particle system. Defaults to 0.0. |
0.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_interact?view=minecraft-bedrock-stable#particle_on_start
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityInventory
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(additional_slots_per_strength=0, can_be_siphoned_from=False, container_type=ContainerType.Inventory, inventory_size=5, private=False, restrict_to_owner=False)
Defines how an entity's inventory is managed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
additional_slots_per_strength
|
int
|
Number of slots that this entity can gain per extra strength. Defaults to 0. |
0
|
can_be_siphoned_from
|
bool
|
If true, the contents of this inventory can be removed by a hopper. Defaults to False. |
False
|
container_type
|
str
|
Type of container the entity has. Can be horse, minecart_chest, chest_boat, minecart_hopper, inventory, container or hopper. Defaults to inventory. |
Inventory
|
inventory_size
|
int
|
Number of slots the container has. Defaults to 5. |
5
|
private
|
bool
|
If true, the entity will not drop its inventory on death. Defaults to False. |
False
|
restrict_to_owner
|
bool
|
If true, the entity's inventory can only be accessed by its owner or itself. Defaults to False. |
False
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_inventory
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityIsBaby
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Sets that this entity is a baby.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityIsCharged
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Sets that this entity is charged.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityIsChested
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Sets that this entity is currently carrying a chest.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityIsCollidable
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Allows other mobs to have vertical and horizontal collisions with this mob.
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_is_collidable
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityIsIgnited
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Sets that this entity is currently on fire.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityIsIllagerCaptain
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Sets that this entity is an illager captain.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityIsSaddled
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Sets that this entity is currently saddled.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityIsSheared
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Sets that this entity is currently sheared.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityIsStackable
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Sets that this entity can be stacked.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityIsStunned
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Sets that this entity is currently stunned.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityIsTamed
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Sets that this entity is currently tamed.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityItemHopper
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Allows an entity to function like a hopper block.
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_item_hopper
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityJumpStatic
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(jump_power=0.42)
Gives the entity the ability to jump.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityKnockbackResistance
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value)
Determines the amount of knockback resistance that the item has.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityLavaMovement
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value)
Defines the speed with which an entity can move through lava.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityLeashable
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(can_be_cut=True, can_be_stolen=True, hard_distance=6, max_distance=None, soft_distance=4)
Defines how this mob can be leashed to other items.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
can_be_cut
|
bool
|
If true, players can cut both incoming and outgoing leashes by using shears on the entity. Defaults to True. |
True
|
can_be_stolen
|
bool
|
If true, players can leash this entity even if it is already leashed to another entity. Defaults to True. |
True
|
hard_distance
|
int
|
Distance in blocks at which the leash stiffens, restricting movement. Defaults to 6. |
6
|
max_distance
|
int
|
Distance in blocks at which the leash breaks. Defaults to None. |
None
|
soft_distance
|
int
|
Distance in blocks at which the 'spring' effect starts acting to keep this entity close to the entity that leashed it. Defaults to 4. |
4
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_leashable
__iter__()
Iterates over the component's fields.
on_unleash(event, interact_only=False, target=FilterSubject.Self)
Defines the event to trigger when the entity is unleashed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
str
|
The event to trigger when the entity is unleashed. |
required |
interact_only
|
bool
|
If true, the event will only trigger when the player directly interacts with the entity. Defaults to False. |
False
|
target
|
FilterSubject
|
The target of the event. Defaults to FilterSubject.Self. |
Self
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary containing the unleash information. |
preset(filter=None, hard_distance=7, max_distance=12, rotation_adjustment=0, soft_distance=4, spring_type=LeashSpringType.Dampened)
Defines a preset for the leashable component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filter
|
Filter
|
Conditions that must be met for this preset to be applied. Defaults to None. |
None
|
hard_distance
|
int
|
Distance (in blocks) over which the entity starts being pulled toward the leash holder with a spring-like force. Defaults to 7. |
7
|
max_distance
|
int
|
Distance in blocks at which the leash breaks. Defaults to 12. |
12
|
rotation_adjustment
|
float
|
Adjusts the rotation at which the entity reaches equilibrium. Defaults to 0. |
0
|
soft_distance
|
float
|
Distance (in blocks) over which the entity begins pathfinding toward the leash holder. Defaults to 4. |
4
|
spring_type
|
LeashSpringType
|
Defines the type of spring-like force that pulls the entity towards its leash holder. Defaults to LeashSpringType.Dampened. |
Dampened
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary containing the preset information. |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityLookedAt
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(field_of_view=26, filters=None, find_players_only=False, line_of_sight_obstruction_type=LineOfSightObstructionType.Collision, look_at_locations=None, looked_at_cooldown=(0, 0), looked_at_event=None, not_looked_at_event=None, scale_fov_by_distance=True, search_radius=10, set_target=LootedAtSetTarget.OnceAndStopScanning)
Defines the behavior when another entity looks at the owner entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_of_view
|
float
|
The field of view in degrees. Defaults to 26. |
26
|
filters
|
Filter
|
Defines which entities can trigger the looked_at_event. Defaults to None. |
None
|
find_players_only
|
bool
|
If true, only players will trigger the looked_at_event. Defaults to False. |
False
|
line_of_sight_obstruction_type
|
LineOfSightObstructionType
|
The type of obstruction to consider when checking line of sight. Defaults to LineOfSightObstructionType.Collision. |
Collision
|
look_at_locations
|
list[LookAtLocation]
|
List of locations to look at. Defaults to None. |
None
|
looked_at_cooldown
|
tuple[float, float]
|
The cooldown range in seconds. Defaults to (0, 0). |
(0, 0)
|
looked_at_event
|
str
|
Event to trigger when the entity is looked at. Defaults to None. |
None
|
not_looked_at_event
|
str
|
Event to trigger when the entity is no longer looked at. Defaults to None. |
None
|
scale_fov_by_distance
|
bool
|
If true, the field of view will be scaled based on the distance between the entities. Defaults to True. |
True
|
search_radius
|
float
|
The radius in blocks to search for entities. Defaults to 10. |
10
|
set_target
|
LootedAtSetTarget
|
The target selection strategy. Defaults to LootedAtSetTarget.OnceAndStopScanning. |
OnceAndStopScanning
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_looked_at
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityLoot
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(loot_table)
Sets the loot table for what items this entity drops upon death.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loot_table
|
LootTable | str
|
The loot table to use for this block. |
required |
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityMarkVariant
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value)
Additional variant value. Can be used to further differentiate variants.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityMobEffect
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(mob_effect, entity_filter, cooldown_time=0, effect_range=0.2, effect_time=10)
Applies a mob effect to entities that get within range.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityMovement
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value, max=None)
Defined the movement speed of the entity in block/tick.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
int
|
The movement speed of the entity in block/tick. |
required |
max
|
int
|
The maximum movement speed of the entity in block/tick. Defaults to None. |
None
|
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityMovementMeters
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value, max=None)
A component that defines the entity's movement speed in meters per second.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
float
|
Movement speed of the entity in meters per second. |
required |
max
|
float
|
Maximum movement speed of the entity in meters per second. Defaults to None. |
None
|
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityMovementSoundDistanceOffset
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value)
Sets the offset used to determine the next step distance for playing a movement sound.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
float
|
The higher the number, the less often the movement sound will be played. |
required |
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_movement.sound_distance_offset
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityMovementType
Amphibious(max_turn=30)
staticmethod
Allows the mob to swim in water and walk on land.
Dolphin()
staticmethod
Allows the mob to swim in water like a dolphin.
Fly(max_turn=30, start_speed=0.1, speed_when_turning=0.2)
staticmethod
Causes the mob to fly.
Generic(max_turn=30)
staticmethod
Allows a mob to fly, swim, climb, etc.
Glide(max_turn=30, start_speed=0.1, speed_when_turning=0.2)
staticmethod
Is the move control for a flying mob that has a gliding movement.
Hover(max_turn=30)
staticmethod
Causes the mob to hover.
Jump(max_turn=30, jump_delay=(0, 0))
staticmethod
Causes the mob to jump as it moves with a specified delay between jumps.
Skip(max_turn=30)
staticmethod
Causes the mob to hop as it moves.
Sway(max_turn=30, sway_amplitude=0.05, sway_frequency=0.5)
staticmethod
Causes the mob to sway side to side giving the impression it is swimming.
EntityNPC
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(skin_list)
Allows an entity to be an NPC.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityNameable
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(allow_name_tag_renaming=True, always_show=False)
Allows the entity to have a custom name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
allow_name_tag_renaming
|
bool
|
If true, the name tag can be renamed. Defaults to True. |
True
|
always_show
|
bool
|
If true, the custom name will always be visible. Defaults to False. |
False
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_nameable
__iter__()
Iterates over the component's fields.
default_trigger(event, target=FilterSubject.Self)
Sets the default trigger event for the nameable component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
str
|
The event to trigger when the entity is named. |
required |
target
|
FilterSubject
|
The target of the event. Defaults to FilterSubject.Self. |
Self
|
name_action(name, event, target=FilterSubject.Self)
Adds a name action to the nameable component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name that triggers the event. |
required |
event
|
str
|
The event to trigger when the entity is named. |
required |
target
|
FilterSubject
|
The target of the event. Defaults to FilterSubject.Self. |
Self
|
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityNavigationType
Climb(avoid_damage_blocks=False, avoid_portals=False, avoid_sun=False, avoid_water=False, can_breach=False, can_break_doors=False, can_float=False, can_jump=True, can_open_doors=False, can_open_iron_doors=False, can_pass_doors=True, can_path_from_air=False, can_path_over_lava=False, can_path_over_water=False, can_sink=True, can_swim=False, can_walk=True, can_walk_in_lava=False, is_amphibious=False, blocks_to_avoid=[])
staticmethod
Allows this entity to generate paths that include vertical walls like the vanilla Spiders do.
Float(avoid_damage_blocks=False, avoid_portals=False, avoid_sun=False, avoid_water=False, can_breach=False, can_break_doors=False, can_jump=True, can_float=False, can_open_doors=False, can_open_iron_doors=False, can_pass_doors=True, can_path_from_air=False, can_path_over_lava=False, can_path_over_water=False, can_sink=True, can_swim=False, can_walk=True, can_walk_in_lava=False, is_amphibious=False, blocks_to_avoid=[])
staticmethod
Allows this entity to generate paths by flying around the air like the regular Ghast.
Fly(avoid_damage_blocks=False, avoid_portals=False, avoid_sun=False, avoid_water=False, can_breach=False, can_break_doors=False, can_jump=True, can_float=False, can_open_doors=False, can_open_iron_doors=False, can_pass_doors=True, can_path_from_air=False, can_path_over_lava=False, can_path_over_water=False, can_sink=True, can_swim=False, can_walk=True, can_walk_in_lava=False, is_amphibious=False, blocks_to_avoid=[])
staticmethod
Allows this entity to generate paths in the air like the vanilla Parrots do.
Generic(avoid_damage_blocks=False, avoid_portals=False, avoid_sun=False, avoid_water=False, can_breach=False, can_break_doors=False, can_jump=True, can_float=False, can_open_doors=False, can_open_iron_doors=False, can_pass_doors=True, can_path_from_air=False, can_path_over_lava=False, can_path_over_water=False, can_sink=True, can_swim=False, can_walk=True, can_walk_in_lava=False, is_amphibious=False, blocks_to_avoid=[])
staticmethod
Allows this entity to generate paths by walking, swimming, flying and/or climbing around and jumping up and down a block.
Hover(avoid_damage_blocks=False, avoid_portals=False, avoid_sun=False, avoid_water=False, can_breach=False, can_break_doors=False, can_jump=True, can_float=False, can_open_doors=False, can_open_iron_doors=False, can_pass_doors=True, can_path_from_air=False, can_path_over_lava=False, can_path_over_water=False, can_sink=True, can_swim=False, can_walk=True, can_walk_in_lava=False, is_amphibious=False, blocks_to_avoid=[])
staticmethod
Allows this entity to generate paths in the air like the vanilla Bees do. Keeps them from falling out of the skies and doing predictive movement.
Swim(avoid_damage_blocks=False, avoid_portals=False, avoid_sun=False, avoid_water=False, can_breach=False, can_break_doors=False, can_jump=True, can_float=False, can_open_doors=False, can_open_iron_doors=False, can_pass_doors=True, can_path_from_air=False, can_path_over_lava=False, can_path_over_water=False, can_sink=True, can_swim=False, can_walk=True, can_walk_in_lava=False, is_amphibious=False, blocks_to_avoid=[])
staticmethod
Allows this entity to generate paths that include water.
Walk(avoid_damage_blocks=False, avoid_portals=False, avoid_sun=False, avoid_water=False, can_breach=False, can_break_doors=False, can_jump=True, can_float=False, can_open_doors=False, can_open_iron_doors=False, can_pass_doors=True, can_path_from_air=False, can_path_over_lava=False, can_path_over_water=False, can_sink=True, can_swim=False, can_walk=True, can_walk_in_lava=False, is_amphibious=False, blocks_to_avoid=[])
staticmethod
Allows this entity to generate paths by walking around and jumping up and down a block like regular mobs.
EntityOnDeath
Bases: _BaseEventTrigger
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(event, filters=None, target=FilterSubject.Self)
Add a trigger to run when the entity dies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
Event
|
The event to run when the conditions for this trigger are met. |
required |
filters
|
Filter
|
The list of conditions for this trigger to execute. Defaults to None. |
None
|
target
|
FilterSubject
|
The target of the event. Defaults to FilterSubject.Self. |
Self
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitytriggers/minecrafttrigger_on_death
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityOnFriendlyAnger
Bases: _BaseEventTrigger
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(event, filters=None, target=FilterSubject.Self)
Adds a trigger that will run when a nearby entity of the same type as this entity becomes Angry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
Event
|
The event to run when the conditions for this trigger are met. |
required |
filters
|
Filter
|
The list of conditions for this trigger to execute. Defaults to None. |
None
|
target
|
FilterSubject
|
The target of the event. Defaults to FilterSubject.Self. |
Self
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitytriggers/minecrafttrigger_on_friendly_anger
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityOnHurt
Bases: _BaseEventTrigger
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(event, filters=None, target=FilterSubject.Self)
Add a trigger to run when the entity is hurt.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
Event
|
The event to run when the conditions for this trigger are met. |
required |
filters
|
Filter
|
The list of conditions for this trigger to execute. Defaults to None. |
None
|
target
|
FilterSubject
|
The target of the event. Defaults to FilterSubject.Self. |
Self
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitytriggers/minecrafttrigger_on_hurt
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityOnHurtByPlayer
Bases: _BaseEventTrigger
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(event, filters=None, target=FilterSubject.Self)
Adds a trigger to call when this entity is attacked by the player.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
Event
|
The event to run when the conditions for this trigger are met. |
required |
filters
|
Filter
|
The list of conditions for this trigger to execute. Defaults to None. |
None
|
target
|
FilterSubject
|
The target of the event. Defaults to FilterSubject.Self. |
Self
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitytriggers/minecrafttrigger_on_hurt_by_player
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityOnIgnite
Bases: _BaseEventTrigger
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(event, filters=None, target=FilterSubject.Self)
Adds a trigger to call when this entity is set on fire.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
Event
|
The event to run when the conditions for this trigger are met. |
required |
filters
|
Filter
|
The list of conditions for this trigger to execute. Defaults to None. |
None
|
target
|
FilterSubject
|
The target of the event. Defaults to FilterSubject.Self. |
Self
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitytriggers/minecrafttrigger_on_ignite
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityOnStartLanding
Bases: _BaseEventTrigger
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(event, filters=None, target=FilterSubject.Self)
Only usable by the Ender Dragon. Adds a trigger to call when this entity lands.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
Event
|
The event to run when the conditions for this trigger are met. |
required |
filters
|
Filter
|
The list of conditions for this trigger to execute. Defaults to None. |
None
|
target
|
FilterSubject
|
The target of the event. Defaults to FilterSubject.Self. |
Self
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitytriggers/minecrafttrigger_on_start_landing
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityOnStartTakeoff
Bases: _BaseEventTrigger
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(event, filters=None, target=FilterSubject.Self)
Only usable by the Ender Dragon. Adds a trigger to call when this entity starts flying.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
Event
|
The event to run when the conditions for this trigger are met. |
required |
filters
|
Filter
|
The list of conditions for this trigger to execute. Defaults to None. |
None
|
target
|
FilterSubject
|
The target of the event. Defaults to FilterSubject.Self. |
Self
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitytriggers/minecrafttrigger_on_start_takeoff
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityOnTargetAcquired
Bases: _BaseEventTrigger
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(event, filters=None, target=FilterSubject.Self)
Adds a trigger to call when this entity finds a target.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
Event
|
The event to run when the conditions for this trigger are met. |
required |
filters
|
Filter
|
The list of conditions for this trigger to execute. Defaults to None. |
None
|
target
|
FilterSubject
|
The target of the event. Defaults to FilterSubject.Self. |
Self
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitytriggers/minecrafttrigger_on_target_acquired
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityOnTargetEscaped
Bases: _BaseEventTrigger
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(event, filters=None, target=FilterSubject.Self)
Adds a trigger to call when this entity loses the target it currently has.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
Event
|
The event to run when the conditions for this trigger are met. |
required |
filters
|
Filter
|
The list of conditions for this trigger to execute. Defaults to None. |
None
|
target
|
FilterSubject
|
The target of the event. Defaults to FilterSubject.Self. |
Self
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitytriggers/minecrafttrigger_on_target_escaped
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityOnWakeWithOwner
Bases: _BaseEventTrigger
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(event, filters=None, target=FilterSubject.Self)
A trigger when a mob's tamed onwer wakes up.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
Event
|
The event to run when the conditions for this trigger are met. |
required |
filters
|
Filter
|
The list of conditions for this trigger to execute. Defaults to None. |
None
|
target
|
FilterSubject
|
The target of the event. Defaults to FilterSubject.Self. |
Self
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitytriggers/minecrafttrigger_on_wake_with_owner
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityOutOfControl
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Defines the entity's 'out of control' state.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityPersistent
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Defines whether an entity should be persistent in the game world.
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_persistent
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityPhysics
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(has_collision=True, has_gravity=True, push_towards_closest_space=False)
Defines physics properties of an actor, including if it is affected by gravity or if it collides with objects.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityPreferredPath
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(default_block_cost=0, jump_cost=0, max_fall_blocks=3)
Specifies costing information for mobs that prefer to walk on preferred paths.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityProjectile
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
remove_on_hit
property
Remove the projectile when it hits something.
Returns:
| Type | Description |
|---|---|
|
Self for method chaining. |
thrown_potion_effect
property
Enable thrown potion effect.
Returns:
| Type | Description |
|---|---|
|
Self for method chaining. |
Note
According to Bedrock Wiki, exact behavior is unknown and this may crash Minecraft as it's probably only valid for thrown potions.
__init__(anchor=0, angle_offset=0, catch_fire=False, crit_particle_on_hurt=False, destroy_on_hurt=False, fire_affected_by_griefing=False, gravity=0.05, hit_sound='', hit_ground_sound='', hit_water=False, homing=False, inertia=0.99, is_dangerous=False, knockback=True, lightning=False, liquid_inertia=0.6, multiple_targets=True, offset=(0, 0.5, 0), on_fire_time=5.0, particle='iconcrack', potion_effect=-1, power=1.3, reflect_on_hurt=False, semi_random_diff_damage=False, shoot_sound='', shoot_target=True, should_bounce=False, splash_potion=False, splash_range=4.0, stop_on_hurt=False, uncertainty_base=0.0, uncertainty_multiplier=0.0)
Allows the entity to be a thrown entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anchor
|
int
|
Integer anchor value. Default is 0. |
0
|
angle_offset
|
float
|
Determines the angle at which the projectile is thrown. Default is 0. |
0
|
catch_fire
|
bool
|
If true, the entity hit will be set on fire. Default is False. |
False
|
crit_particle_on_hurt
|
bool
|
If true, the projectile will produce critical hit particles when it happens. Default is False. |
False
|
destroy_on_hurt
|
bool
|
If true, this entity will be destroyed when hit. Default is False. |
False
|
fire_affected_by_griefing
|
bool
|
If true, whether the projectile causes fire is affected by the mob griefing game rule. Default is False. |
False
|
gravity
|
float
|
The gravity applied to this entity when thrown. The higher the value, the faster the entity falls. Default is 0.05. |
0.05
|
hit_sound
|
str
|
The sound that plays when the projectile hits an entity. Default is "". |
''
|
hit_ground_sound
|
str
|
The sound that plays when the projectile hits ground. Default is "". |
''
|
hit_water
|
bool
|
If true, liquid blocks will be treated as solid. Requires "Education Edition" toggle active. Default is False. |
False
|
homing
|
bool
|
If true, the projectile homes in to the nearest entity. Does not work on 1.18.2. Default is False. |
False
|
inertia
|
float
|
The fraction of the projectile's speed maintained every frame while traveling in air. Default is 0.99. |
0.99
|
is_dangerous
|
bool
|
If true, the projectile will be treated as dangerous to the players. Default is False. |
False
|
knockback
|
bool
|
If true, the projectile will knock back the entity it hits. Default is True. |
True
|
lightning
|
bool
|
If true, the entity hit will be struck by lightning. Default is False. |
False
|
liquid_inertia
|
float
|
The fraction of the projectile's speed maintained every frame while traveling in water. Default is 0.6. |
0.6
|
multiple_targets
|
bool
|
If true, the projectile can hit multiple entities per flight. Default is True. |
True
|
offset
|
Coordinates
|
The offset from the entity's anchor where the projectile will spawn. Default is (0, 0.5, 0). |
(0, 0.5, 0)
|
on_fire_time
|
float
|
Time in seconds that the entity hit will be on fire for. Default is 5.0. |
5.0
|
particle
|
str
|
Particle to use upon collision. Default is "iconcrack". |
'iconcrack'
|
potion_effect
|
int
|
Defines the effect the arrow will apply to the entity it hits. Default is -1. |
-1
|
power
|
float
|
Determines the velocity of the projectile. Default is 1.3. |
1.3
|
reflect_on_hurt
|
bool
|
If true, this entity will be reflected back when hit. Default is False. |
False
|
semi_random_diff_damage
|
bool
|
If true, damage will be randomized based on damage and speed. Default is False. |
False
|
shoot_sound
|
str
|
The sound that plays when the projectile is shot. Default is "". |
''
|
shoot_target
|
bool
|
If true, the projectile will be shot towards the target of the entity firing it. Default is True. |
True
|
should_bounce
|
bool
|
If true, the projectile will bounce upon hit. Default is False. |
False
|
splash_potion
|
bool
|
If true, the projectile will be treated like a splash potion. Default is False. |
False
|
splash_range
|
float
|
Radius in blocks of the 'splash' effect. Default is 4.0. |
4.0
|
stop_on_hurt
|
bool
|
If true, the projectile stops when the target is hurt. Default is False. |
False
|
uncertainty_base
|
float
|
The base accuracy. Accuracy is determined by the formula uncertaintyBase - difficultyLevel * uncertaintyMultiplier. Default is 0.0. |
0.0
|
uncertainty_multiplier
|
float
|
Determines how much difficulty affects accuracy. Accuracy is determined by the formula uncertaintyBase - difficultyLevel * uncertaintyMultiplier. Default is 0.0. |
0.0
|
__iter__()
Iterates over the component's fields.
arrow_effect()
Enable arrow effect on hit.
Note
Exact behavior unknown according to Bedrock Wiki.
Returns:
| Type | Description |
|---|---|
|
Self for method chaining. |
definition_event(event, target, affect_projectile=False, affect_shooter=False, affect_splash_area=False, splash_area=0, affect_target=False)
Call an event on hit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
Event
|
Event to trigger. |
required |
target
|
FilterSubject
|
Target of the event. |
required |
affect_projectile
|
bool
|
Event will be triggered for projectile entity. Default is False. |
False
|
affect_shooter
|
bool
|
Event will be triggered for shooter entity. Default is False. |
False
|
affect_splash_area
|
bool
|
Event will be triggered for all entities in an area. Default is False. |
False
|
splash_area
|
float
|
Area of entities to affect. Default is 0. |
0
|
affect_target
|
bool
|
Event will be triggered for hit entity. Default is False. |
False
|
Returns:
| Type | Description |
|---|---|
|
Self for method chaining. |
filter(filter)
Set entity filter for the projectile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filter
|
Filter
|
The filter to apply. |
required |
Returns:
| Type | Description |
|---|---|
|
Self for method chaining. |
freeze_on_hit(size, snap_to_block, shape='sphere')
Freeze water on hit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int
|
The size of the freeze effect. |
required |
snap_to_block
|
bool
|
Whether to snap to block. |
required |
shape
|
str
|
Shape of the freeze effect. Must be "sphere" or "cube". Default is "sphere". |
'sphere'
|
Returns:
| Type | Description |
|---|---|
|
Self for method chaining. |
Note
Requires Education Edition toggle to be enabled. According to Bedrock Wiki, exact behavior is unknown.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If shape is not "sphere" or "cube". |
grant_xp(xp)
Grant experience points on hit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xp
|
int | tuple[int, int]
|
Experience to grant. If int, grants constant amount. If tuple, grants random amount between min and max. |
required |
Returns:
| Type | Description |
|---|---|
|
Self for method chaining. |
Note
Despite the name, this actually spawns a number of experience orbs, being worth the amount stated.
Raises:
| Type | Description |
|---|---|
ValueError
|
If xp is not an int or tuple of two ints. |
hurt_owner(owner_damage=0, knockback=False, ignite=False)
Configure projectile to potentially hurt its owner on hit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner_damage
|
int
|
Damage dealt to the owner. Default is 0. |
0
|
knockback
|
bool
|
Whether to apply knockback to owner. Default is False. |
False
|
ignite
|
bool
|
Whether to ignite the owner. Default is False. |
False
|
Returns:
| Type | Description |
|---|---|
|
Self for method chaining. |
Note
According to Bedrock Wiki, exact behavior is unknown and this may crash Minecraft with wrong parameters.
impact_damage(filter=None, catch_fire=False, channeling=True, damage=1, destroy_on_hit=False, destroy_on_hit_requires_damage=True, knockback=True, max_critical_damage=5, min_critical_damage=0, power_multiplier=2, semi_random_diff_damage=False, set_last_hurt_requires_damage=False, apply_knockback_to_blocking_targets=False)
Deal damage on impact.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filter
|
str
|
Entity identifier to affect. Much more primitive than filters used elsewhere, as it cannot "test" for anything other than an identifier. Default is None. |
None
|
catch_fire
|
bool
|
Whether targets will be engulfed in flames. Default is False. |
False
|
channeling
|
bool
|
Whether lightning can be channeled through the weapon. Default is True. |
True
|
damage
|
int
|
Damage dealt to entity on hit. Default is 1. |
1
|
destroy_on_hit
|
bool
|
Whether projectile is removed on hit. Default is False. |
False
|
destroy_on_hit_requires_damage
|
bool
|
If true, hit must cause damage to destroy the projectile. Default is True. |
True
|
knockback
|
bool
|
Whether the projectile will knock back the entity it hits. Default is True. |
True
|
max_critical_damage
|
int
|
Maximum critical damage. Default is 5. |
5
|
min_critical_damage
|
int
|
Minimum critical damage. Default is 0. |
0
|
power_multiplier
|
float
|
How much the base damage is multiplied. Default is 2. |
2
|
semi_random_diff_damage
|
bool
|
If true, damage will be randomized based on damage and speed. Default is False. |
False
|
set_last_hurt_requires_damage
|
bool
|
If true, hit must cause damage to update the last hurt property. Default is False. |
False
|
apply_knockback_to_blocking_targets
|
bool
|
If true, knockback will be applied to any blocking targets. Default is False. |
False
|
Returns:
| Type | Description |
|---|---|
|
Self for method chaining. |
mob_effect(effect, amplifier=1, ambient=False, visible=False, duration=1, durationeasy=0, durationhard=800, durationnormal=200)
Apply a mob effect to the target on hit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
effect
|
Effects
|
The effect to apply. |
required |
amplifier
|
int
|
Effect amplifier. Default is 1. |
1
|
ambient
|
bool
|
Whether the effect is ambient. Default is False. |
False
|
visible
|
bool
|
Whether the effect is visible. Default is False. |
False
|
duration
|
int
|
Duration of the effect. Default is 1. |
1
|
durationeasy
|
int
|
Duration of the effect on easy difficulty. Default is 0. |
0
|
durationhard
|
int
|
Duration of the effect on hard difficulty. Default is 800. |
800
|
durationnormal
|
int
|
Duration of the effect on normal difficulty. Default is 200. |
200
|
Returns:
| Type | Description |
|---|---|
|
Self for method chaining. |
on_hit(catch_fire=False, douse_fire=False, ignite=False, teleport_owner=False)
Configure basic on_hit behaviors for the projectile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
catch_fire
|
bool
|
Determines if the struck object is set on fire. Default is False. |
False
|
douse_fire
|
bool
|
If the target is on fire, then douse the fire. Default is False. |
False
|
ignite
|
bool
|
Determines if a fire may be started on a flammable target. Default is False. |
False
|
teleport_owner
|
bool
|
Determines if the owner is transported on hit. Default is False. |
False
|
Returns:
| Type | Description |
|---|---|
|
Self for method chaining. |
particle_on_hit(particle_type, on_other_hit=False, on_entity_hit=False, num_particles=0)
Spawn particles on hit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particle_type
|
str
|
Vanilla particle type to use. |
required |
on_other_hit
|
bool
|
Whether it should spawn particles on non-entity hit. Default is False. |
False
|
on_entity_hit
|
bool
|
Whether it should spawn particles on entity hit. Default is False. |
False
|
num_particles
|
int
|
Number of particles to spawn. Default is 0. |
0
|
Returns:
| Type | Description |
|---|---|
|
Self for method chaining. |
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
spawn_aoe_cloud(affect_owner=True, color=(1, 1, 1), duration=0, particle='', potion=-1, radius=0.0, radius_on_use=-1.0, reapplication_delay=0)
Spawn an area of effect cloud of potion effect on hit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
affect_owner
|
bool
|
Whether potion effect affects the shooter. Does not appear to apply to the player. Default is True. |
True
|
color
|
tuple[int, int, int]
|
RGB color of the particles. Default is (1, 1, 1). |
(1, 1, 1)
|
duration
|
int
|
Duration of the cloud in seconds. Default is 0. |
0
|
particle
|
str
|
Vanilla particle emitter of the cloud. Only accepts Vanilla Particles. 'dragonbreath' enables the usage of Bottles to obtain Dragon's Breath. Default is "". |
''
|
potion
|
int
|
Lingering Potion ID. Default is -1. |
-1
|
radius
|
float
|
Radius of the cloud. Default is 0.0. |
0.0
|
radius_on_use
|
float
|
Radius change on use. Default is -1.0. |
-1.0
|
reapplication_delay
|
int
|
Delay in ticks between application of the potion effect. Default is 0. |
0
|
Returns:
| Type | Description |
|---|---|
|
Self for method chaining. |
spawn_chance(spawn_definition, spawn_baby=False, first_spawn_count=0, first_spawn_percent_chance=0, second_spawn_percent_chance=32, second_spawn_count=0)
Spawn an entity on hit with specified chances.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spawn_definition
|
str
|
ID of the entity to spawn. |
required |
spawn_baby
|
bool
|
Whether the spawned entity should be a baby. Default is False. |
False
|
first_spawn_count
|
int
|
Number of entities to spawn in first spawn. Default is 0. |
0
|
first_spawn_percent_chance
|
int
|
Percentage chance for first spawn. Default is 0. |
0
|
second_spawn_percent_chance
|
int
|
Percentage chance for second spawn. Default is 32. |
32
|
second_spawn_count
|
int
|
Number of entities to spawn in second spawn. Default is 0. |
0
|
Returns:
| Type | Description |
|---|---|
|
Self for method chaining. |
stick_in_ground(shake_time)
Configure projectile to stick into the ground on hit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shake_time
|
float
|
Time in seconds the projectile shakes when stuck in ground. |
required |
Returns:
| Type | Description |
|---|---|
|
Self for method chaining. |
EntityPushThrough
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value)
Sets the distance through which the entity can push through.
This component sets the distance through which an entity can exert force to move through other entities or blocks.
Parameters
value : float, optional The distance in blocks that the entity can push through. It can be thought of as a "buffer zone" that the entity creates around itself to navigate through crowded spaces. The default value is 0.0, which means the entity follows the standard collision rules of the game and cannot move through solid entities or blocks. Positive values increase the entity's ability to move through crowds, while negative values are rounded to 0.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityPushable
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(is_pushable=True, is_pushable_by_piston=True)
Defines what can push an entity between other entities and pistons.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityRendersWhenInvisible
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
When set, the entity will render even when invisible. Appropriate rendering behavior can then be specified in the corresponding "minecraft:client_entity".
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_renders_when_invisible
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityRideable
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(interact_text='Mount', controlling_seat=0, crouching_skip_interact=True, pull_in_entities=False, rider_can_interact=False, dismount_mode=RideableDismountMode.Default, on_rider_enter_event=None, on_rider_exit_event=None)
Determines whether this entity can be ridden. Allows specifying the different seat positions and quantity.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityRotationAxisAligned
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Causes the entity's body to automatically rotate to align with the nearest cardinal direction based on its current facing direction.
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_rotation_axis_aligned
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityScale
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value)
Sets the entity's visual size.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityScaleByAge
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(start_scale, end_scale)
Defines the entity's size interpolation based on the entity's age.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntitySensor
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__iter__()
Iterates over the component's fields.
add_sensor(event, event_filters, maximum_count=-1, minimum_count=-1, require_all=False, range=[10, 10], cooldown=-1, y_offset=0.0)
A component that initiates an event when a set of conditions are met by other entities within the defined range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
str
|
Event to initiate when the conditions are met. |
required |
event_filter
|
Filter
|
The set of conditions that must be satisfied to initiate the event. |
required |
maximum_count
|
int
|
The maximum number of entities that must pass the filter conditions for the event to send. Defaults to -1. |
-1
|
minimum_count
|
int
|
The minimum number of entities that must pass the filter conditions for the event to send. Defaults to -1. |
-1
|
relative_range
|
bool
|
If true, the sensor range is additive on top of the entity's size. Defaults to True. |
required |
require_all
|
bool
|
If true, requires all nearby entities to pass the filter conditions for the event to send. Defaults to False. |
False
|
range
|
range
|
The maximum horizontal and vertical distance another entity can be from this and have the filters checked against it. Defaults to (10, 10). |
[10, 10]
|
cooldown
|
int
|
How many seconds should elapse before the subsensor can once again sense for entities. The cooldown is applied on top of the base 1 tick (0.05 seconds) delay. Negative values will result in no cooldown being used. Defaults to -1. |
-1
|
y_offset
|
float
|
Vertical offset applied to the entity's position when computing the distance from other entities. |
0.0
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_entity_sensor
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityShooter
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(identifier, magic=False, power=0.0, aux_value=-1)
Defines the entity's ranged attack behavior. The "minecraft:behavior.ranged_attack" goal uses this component to determine which projectiles to shoot.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntitySittable
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(sit_event=None, stand_event=None)
Defines the entity's 'sit' state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sit_event
|
str
|
Event to run when the entity enters the 'sit' state. Defaults to None. |
None
|
stand_event
|
str
|
Event to run when the entity exits the 'sit' state. Defaults to None. |
None
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_sittable
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntitySkinID
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value)
Skin ID value. Can be used to differentiate skins, such as base skins for villagers.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntitySpawnEntity
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Adds a timer after which this entity will spawn another entity or item (similar to vanilla's chicken's egg-laying behavior).
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntitySpellEffects
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
Defines what mob effects to add and remove to the entity when adding this component.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityTameable
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(probability=1.0, tame_event=None, tame_subject=FilterSubject.Self, *tame_items)
Defines the rules for an entity to be tamed by the player.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
probability
|
float
|
The chance of taming the entity with each item use between 0.0 and 1.0, where 1.0 is 100%. Defaults to 1.0. |
1.0
|
tame_event
|
dict[str, str]
|
Event to initiate when the entity becomes tamed. Defaults to None. |
None
|
tame_items
|
str
|
The list of items that can be used to tame the entity. Defaults to None. |
()
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_tameable
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityTargetNearbySensor
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(inside_range=1, outside_range=5, must_see=False)
Defines the entity's range within which it can see or sense other entities to target them.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityTickWorld
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(never_despawn=True, radius=0, distance_to_players=0)
Defines if the entity ticks the world and the radius around it to tick.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityTimer
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(event, target=FilterSubject.Self, looping=True, randomInterval=True, time=0)
Adds a timer after which an event will fire.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityTransformation
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(into, transform_event=None, drop_equipment=False, drop_inventory=False, keep_level=False, keep_owner=False, preserve_equipment=False)
Defines an entity's transformation from the current definition into another.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityTransient
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__()
An entity with this component will NEVER persist, and will forever disappear when unloaded.
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_transient
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityTypeFamily
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(*family)
Defines the families this entity belongs to.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityUnderwaterMovement
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value)
A component that defines the entity's movement speed while underwater in block/tick
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
int
|
Movement speed of the entity while underwater in block/tick. |
required |
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityVariableMaxAutoStep
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(base_value=0.5625, controlled_value=0.5625, jump_prevented_value=0.5625)
Allows entities have a maximum auto step height that is different depending on whether they are on a block that prevents jumping.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_value
|
float
|
The maximum auto step height when on any other block. Defaults to 0.5625. |
0.5625
|
controlled_value
|
float
|
The maximum auto step height when on any other block and controlled by the player. Defaults to 0.5625. |
0.5625
|
jump_prevented_value
|
float
|
The maximum auto step height when on a block that prevents jumping. Defaults to 0.5625. |
0.5625
|
Documentation reference:
https://learn.microsoft.com/en-gb/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_variable_max_auto_step
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityVariant
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(value)
Used to differentiate the component group of a variant of an entity from others. (e.g. ocelot, villager).
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityVerticalMovementAction
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(vertical_velocity=0.5)
When configured as a rideable entity, moves the entity up/down when the player uses the jump action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vertical_velocity
|
float
|
Vertical velocity to apply when jump action is issued. Default: 0.5. |
0.5
|
Documentation reference:
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_vertical_movement.action
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |
EntityWaterMovement
Bases: _BaseComponent
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The name of the addon object. |
__init__(drag_factor=0.8)
Defines the speed with which an entity can move through water.
__iter__()
Iterates over the component's fields.
set_identifier_data(data)
Sets the data of the addon object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
any
|
The data to be set for the addon object. |
required |