API reference / @jsprismarine/entities
@jsprismarine/entities
The Bedrock entity runtime: definition parsing, the component and component-group state machine, the event engine, entity properties, the filter evaluator and the goal scheduler. It builds on @jsprismarine/content for registries, component binding and hook dispatch, on @jsprismarine/packs for the filter grammar, and on a caller-supplied Molang evaluator for the expressions component bodies carry.
import { EntityTypes } from '@jsprismarine/entities';
const types = new EntityTypes();
const diagnostics = types.load(files); // { data, pack, path } per entity file
const zombie = types.spawn('minecraft:zombie');
zombie.fire('minecraft:start_transforming_into_drowned');
zombie.tick(); // the event lands here, not when it was firedThe definition model
An entity file is {"format_version": "<semver>", "minecraft:entity": {...}}, and the entity body has description, components, component_groups, events and upgrades. Mojang's own ActorDocument.json types those five keys and leaves every body dynamic, so parseEntityDefinition validates structure and reports an unknown key rather than refusing the file. A pack written against a newer game still loads, and the report names what the runtime did not read.
description yields identifier, isSpawnable, isSummonable, isExperimental, spawnCategory, runtimeIdentifier, properties, animations, scripts and entityVersion.
format_version gates four things, and a file that uses one below its version loads and is reported as entity.versionGate: root-level event filters need 1.19.20, queue_command needs 1.20.60, emit_particle and play_sound need 1.21.50, and entity_version with upgrades needs 1.26.20.
components is the always-active set. component_groups is a map of group name to component map, inactive until an event adds it. Both resolve once at load: the base components through resolveTypes, the groups through the same ComponentRegistry, and the result is an EntityType that answers questions without parsing anything.
Java datapack entity_type tags are mapped to Bedrock identifiers during content loading. EntityType.tags and EntityType.hasTag() expose those memberships to type consumers, while EntityInstance.getTags() and EntityInstance.hasTag() expose them on live entities. Bedrock minecraft:type_family remains separate and continues to drive family filters.
The event engine
An event runs in two steps, which is the rule the documentation states. The effects are determined immediately and applied when the entity next ticks, so a filter in a later sequence entry cannot see what an earlier one changed. determineEvent is the first step and returns EventEffects; EntityInstance.fire queues them and EntityInstance.tick applies them.
Within one node the engine runs add, remove, set_property, the raw actions and trigger, then walks sequence in order, then draws one branch of randomize, then takes the first passing branch of first_valid. A node's own filters gate the whole node. Nodes nest without limit.
randomizeweights are relative, not percentages. The zombie's spawn event writes 9500, 425 and 75; other entities write 1 and 1. The draw goes through aRandomSourcea caller injects, so a test scripts it.triggeronselffolds into the same result, with a cycle guard that reports instead of looping. A trigger onother,player,target,baby,parent,holderorblockcomes back as anOutgoingTriggerfor the caller to route.set_propertytakes a literal or an expression. A string is ambiguous in the file, because the engine reads it as Molang and vanilla also writes enum members bare, so the parser keeps the text and the engine resolves it: a member of the target property's enum wins, and anything else goes to the Molang evaluator.
Event actions
Nine action keys parse into an EntityAction and run. Eight are everything the composed vanilla pack writes, measured over its 850 events: play_sound 23 uses, set_home_position 17, emit_vibration 9, drop_item 2, execute_event_on_home_block 2, and one each of emit_particle, reset_target and stop_movement. The ninth is queue_command, which the documentation describes and no vanilla entity uses. Four of those eight appear in no documentation page.
Six of the nine leave the package through EntityEnvironment.effects: playSound, emitParticle, emitVibration, queueCommand, dropItem and executeEventOnBlock. The other three stay here. set_home_position reads the actuator's position and records it, which is what home_distance then measures against; stop_movement abandons the path through the actuator; and reset_target clears the attack target the entity owns.
Nothing passes silently. An action key the package does not parse, a body it cannot read, and an action whose environment member a caller left out each reach the report with the event that asked.
Applying effects removes groups first and adds second, so a group an event both removes and adds ends up active and re-initialized. That is the documented rule: "adding a component group that is already active will cause those components to be re-initialized ... an already-added minecraft:timer that is added again will start its timing logic over." A re-added group also moves to the end of the active list, so its components replace an earlier group's.
Exactly one spawn event runs when an entity is created. spawnEventFor maps the cause to minecraft:entity_spawned, minecraft:entity_born, minecraft:entity_transformed or minecraft:on_prime, and an event the caller names replaces it rather than adding to it, which is what /summon, a spawn rule's initial_event, minecraft:spawn_entity.spawn_event and the minecraft:drowned<minecraft:as_adult> form in transformation.into all do.
Entity properties
description.properties declares int, float, enum and bool properties. An int or float clamps into its range silently, an enum accepts only its declared members, and a write of anything else is refused and reported. A default is a literal or a Molang expression; the expression goes to EntityEnvironment.propertyDefault, which takes no entity because a default may only call query.had_component_group. The documented limits are checked and reported rather than enforced: 32 properties per entity, 16 members per enum, member names starting with a letter.
Filters read properties through int_property, float_property, bool_property, enum_property and has_property, and an entity answers those about itself with no caller view, along with has_component, is_family, is_baby, is_tamed, is_missing_health, is_persistent, actor_health, is_variant, is_mark_variant and is_skin_id.
The filter grammar
@jsprismarine/packs owns the grammar and parses both encodings, including the integer subject and operator the 1.26 serializer writes in 27 vanilla entity files and the AND, OR, NOT, all and any aliases. This package evaluates the parsed form against a FilterContext.
A context holds the subjects (self, other, player, target, parent, baby, damager, holder), an item view, a block view, a world view and a random source. Every view member is optional, and a test whose fact no view answers evaluates to false and reports through onUnanswered, which is what the engine does for a fact it cannot establish. self is the only required subject, because it is what a test with no subject key reads.
The entity view is deliberately small: flag, measure and names take the test's own name, so one member answers 43 boolean tests, one answers 17 numeric tests and one answers 12 name-set tests. The rest are the facts that need their own shape: properties, components, equipment, slot fill, vehicle, owner, attack target, leash holder and trust.
Two shapes the vanilla files write are not in the published grammar, and the packs parser reads both. Five vanilla filters put all_of and any_of in one object, which reads as one all_of over the two groups; one filter, in the skeleton's minecraft:lightning_immune group, writes the legacy shorthand {"other_with_families": "lightning"}. parseEntityFilter is that parser under the name this package calls it by.
The goal seam
A goal is a component carrying a priority and control_flags. goalComponent wraps a GoalFactory into a component factory that parses those two fields, builds the goal when the component initializes and takes it off the scheduler when its group is removed. A later agent implementing the other 167 goals writes exactly this:
export interface GoalFactory<P> {
/** The component name, such as `minecraft:behavior.random_stroll`. */
readonly name: string;
/** The control flags the goal holds when the definition names none. */
readonly controlFlags: readonly ControlFlag[];
/** Parses the goal's own parameters; `priority` and `control_flags` are handled for you. */
readonly schema: ComponentSchema<P>;
/** Builds the goal for one entity, each time the component initializes. */
create(params: P, entity: EntityInstance): Goal;
}
export interface Goal {
canStart(): boolean;
canContinue?(): boolean;
start?(): void;
stop?(): void;
tick?(): void;
}ControlFlag is move, look or jump. The scheduler stops every running goal that cannot continue, then walks the registered goals from priority 0 upward and starts each one whose control flags are free or held by a strictly worse priority, stopping the holder in the same tick. That is the documented rule: "0 is the highest priority ... If the entity is busy doing a low priority behavior and a high priority behavior comes up, the entity will immediately switch." A goal with no control flags runs alongside everything else, which is how the targeting goals work. Ties break by name so the order is stable.
minecraft:behavior.float, minecraft:behavior.random_stroll and minecraft:behavior.look_at_player ship as reference implementations, one per control flag. They move the entity through EntityActuator, the navigation and look-control seam a caller supplies.
Damage, triggers and riding
Three pieces of entity state live here because the components that read and write them do.
EntityInstance.damage runs one damage event end to end. The first component that answers onDamage decides the amount, which is what minecraft:damage_sensor does with its cause list and filters. An immunity component turns the cause aside afterwards, so a sensor still fires its event on damage the entity ends up ignoring: minecraft:fire_immune covers campfire, fire, fire_tick, lava, magma and soul_campfire, and minecraft:freezing_immune covers freezing. What is left comes off the health attribute. Whoever dealt the damage answers both the damager and the other filter subjects.
minecraft:cannot_be_attacked blocks attacks from entities. An attacker can carry minecraft:ignore_cannot_be_attacked to allow all targets, or only targets passing its filters. minecraft:angry.filters excludes matching targets while that component is active. The runtime applies both rules during entity target checks, melee, projectile, and explosion damage.
The ten event-shaped minecraft:on_* components fire through EntityInstance.trigger, which evaluates the component's filters, queues a self event for the next tick and routes any other target. Nine fire at fixed points the runtime owns: on_hurt, on_hurt_by_player and on_death from a damage event, on_target_acquired and on_target_escape from setAttackTarget, on_friendly_anger from the anger broadcast, on_start_landing when an airborne entity lands, and on_start_takeoff after a successful ground jump, and on_wake_with_owner when a sleeping cat's owner wakes. Prismarine also fires on_ignite when daylight starts a fire. The slot-specific minecraft:on_equipment_changed raises the first matching on_equip or on_unequip event when a default equipment slot changes; inventory slots are outside its scope.
minecraft:rideable seats riders on the vehicle. mount checks the seat count and the family_types list, moves a rider off whatever it was riding, and fires on_rider_enter_event; dismount fires on_rider_exit_event; and taking the component off a group empties the seats. That answers rider_count and is_controlling_passenger_family on the vehicle, and is_riding and the vehicle subject on the rider.
Components
Components come in two kinds, and the difference matters when reading the coverage numbers.
Components with behavior contribute hooks. The nine attribute components (health, movement, underwater_movement, lava_movement, flying_speed, follow_range, knockback_resistance, attack_damage, horse.jump_strength) and minecraft:attack write their attribute when they initialize, which is what makes a re-added group reset the stat it carries. minecraft:attack also applies its configured status effect after a melee hit. The rest:
| Component | What it does |
|---|---|
minecraft:timer | Draws its duration and raises its event, restarting whenever its group is re-added |
minecraft:spawn_entity | Counts down each configured entry, then spawns its item or entity, honoring filters, count, event, sound, and single_use |
minecraft:spawn_egg_interaction | Uses a matching spawn egg to create the offspring declared by the entity's component data |
minecraft:offspring_data | Declares compatible mates and offspring pairs for breeding and spawn egg interactions |
minecraft:breedable | Matches breed_items, checks tame, health, baby, love, and cooldown requirements, enters the love state, and replaces the consumed item with its per-item result_item (component reference) |
minecraft:ageable | Counts duration down, advances the remaining time by matching feed_items and their growth, pauses or resets it through the configured items and events, applies result_item, drops drop_items on growth, honors interact_filters, and raises grow_up (component reference) |
minecraft:healable | Matches a configured item and filter, restores health when the entity is injured or force_use is set, applies each configured effect with its chance, duration, and amplifier, and replaces the consumed item with result_item (component reference) |
minecraft:combat_regeneration | When its current attack target dies, applies Regeneration I to the killer when apply_to_self or apply_to_family allows it, and removes Mining Fatigue (component reference) |
minecraft:mob_effect | Applies the configured effect to nearby mobs and players that pass entity_filter, honoring effect_range, effect_time, cooldown_time, and ambient (component reference) |
minecraft:spell_effects | Applies its configured effects and then removes the named effects when the component is added; restored entities do not repeat the one-time operation (component reference) |
minecraft:tameable | Accepts configured tame_items, rolls probability for each attempt, and on success records the owner, raises tame_event, and replaces the consumed item with result_item; failed attempts are accepted and consume one item outside creative mode (component reference) |
minecraft:interact | Applies on_interact.filters and events, enforces cooldowns, projects interact_text to touch-screen clients, plays play_sounds, emits vibration, adjusts health, emits particle_on_start at the entity with its configured offsets, repairs entity inventory or equipment items, moves an entity's main-hand item into an empty player hand, creates configured entities, rolls add_items and spawn_items loot tables, uses or transforms the live player's item, equips or drops named equipment and minecraft:inventory slots, and gives items to the entity's main hand. Piglin interactions can start admiration and request a barter when the matching components are active. Successful interactions relay the player's arm swing to other viewers tracking them by default; set swing: false to suppress it. Non-none particle_on_start.copper_event still reports as unsupported (component reference) |
minecraft:admire_item | Sets the piglin's admiration duration and the cooldown after damage, which ends current admiration and disables new attempts |
minecraft:barter | Rolls barter_table with the barter loot context after the piglin releases its gold ingot, honoring the cooldown after damage |
minecraft:angry | Counts down over duration plus or minus duration_delta, raises calm_event, excludes targets with filters, broadcasts on activation, attack, being attacked, or death as configured, and plays angry_sound on its sound_interval (component reference) |
minecraft:environment_sensor | Evaluates its triggers against the world every tick |
minecraft:entity_sensor | Searches nearby mobs and players for each subsensor, applies event_filters, count bounds, require_all, range offsets, and cooldowns, then raises its event (component reference) |
minecraft:block_sensor | Raises every matching on_block_broken event when a listed block breaks within sensor_radius, applying sources to the breaker (component reference) |
minecraft:inside_block_notifier | Tracks block states overlapped by the entity and raises the configured events when it enters or leaves a match (component reference) |
minecraft:target_nearby_sensor | Tracks the current target through inside_range and outside_range, honors must_see for inside events, and fires its vision-loss event while the target is inside range |
minecraft:home | Records the entity's spawning position for home-based behavior unless an event or save already supplied one (component reference) |
minecraft:teleport | Tries timed random destinations, teleports toward a distant target, and evades matching projectiles before their hit effects apply (component reference) |
minecraft:shareables | Matches item names and tags during pickup and sharing, prioritizes rules, applies pickup limits and piglin admiration or barter flags, carries consume_item pickups for eat_carried_item, stores stored_in_inventory items in the entity container, and shares from both container slots and the flat inventory using surplus and wanted amounts. A craft_into rule uses a loaded crafting recipe that consumes copies of its input and yields a plain item (component reference) |
minecraft:damage_sensor | Answers a damage event by cause and filters; the first trigger that matches wins |
minecraft:hurt_on_condition | Hurts the entity every half second while a condition's filters pass |
minecraft:damage_over_time | Hurts the entity every time_between_hurt seconds while it is active |
minecraft:burns_in_daylight | Validates protection_slot; the dimension runtime ignites the entity in direct sunlight unless that slot is occupied or it is wet, keeps fire while exposed, and applies fire damage |
minecraft:breathable | Spends and refills the air supply, and suffocates once it is gone |
minecraft:ambient_sound_interval | Plays its sound on the interval its body names |
minecraft:rideable | Holds the seats, and empties them when the component goes |
minecraft:transformation | Counts down and asks the world to replace the entity |
minecraft:despawn | Applies the distance and chance rules, or its filters, unless the entity is persistent |
minecraft:instant_despawn | Removes the entity the moment it becomes active |
minecraft:ignore_cannot_be_attacked | Lets attacker data filter exceptions to a target's attack protection |
minecraft:on_* triggers | Raise events at their owning fixed point; on_equipment_changed watches default equipment slots |
Other empty markers are read directly rather than through hooks: minecraft:persistent stops minecraft:despawn; minecraft:transient excludes the actor from saved records; minecraft:fire_immune and minecraft:freezing_immune turn their causes aside in EntityInstance.damage; and minecraft:cannot_be_attacked blocks entity attacks unless the attacker's minecraft:ignore_cannot_be_attacked filter allows the target. minecraft:fire_immune also sets the Bedrock actor's FIRE_IMMUNE flag. minecraft:body_rotation_blocked projects to BODY_ROTATION_BLOCKED. minecraft:out_of_control projects to OUT_OF_CONTROL. minecraft:strength is parsed as value (default 1) and max (default 5); the entity runtime adds value * additional_slots_per_strength to an inventory's declared size.
Data components parse, normalize and expose their value through EntityInstance.componentParams. The separate breeding runtime reads compatible mates and offspring pairs from minecraft:offspring_data. Entity definitions using the older minecraft:offspring spelling are normalized to that component when their type is resolved. The pathfinder reads minecraft:can_climb to climb ladders and minecraft:can_fly to allow airborne paths, and reads minecraft:can_stand_on_powder_snow to treat powder snow as support. The runtime projects minecraft:can_climb to CANCLIMB, the active navigation profile's walk and swim abilities to CANWALK and CANSWIM, and its flight ability to CANFLY. It projects minecraft:can_power_jump, minecraft:dash_action, minecraft:input_ground_controlled, minecraft:free_camera_controlled, and minecraft:vertical_movement_action to CAN_POWER_JUMP, CAN_DASH, WASD_CONTROLLED, WASD_FREE_CAMERA_CONTROLLED, and CAN_USE_VERTICAL_MOVEMENT_ACTION. These flags tell the client which controls are available; the server does not yet apply those inputs to entity movement. The outer runtime also reads physics values from the active component set: minecraft:air_drag_modifier changes air resistance, minecraft:uses_uniform_air_drag applies the same drag on both axes, minecraft:friction_modifier changes ground friction, and minecraft:bounciness changes how much impact velocity a collision returns. minecraft:collision_box, minecraft:type_family, minecraft:loot, minecraft:experience_reward, minecraft:inventory, minecraft:equipment, minecraft:physics, minecraft:pushable, minecraft:air_drag_modifier, minecraft:friction_modifier, minecraft:bounciness, minecraft:nameable, minecraft:is_dyeable, the seven minecraft:navigation.* flavors, the nine minecraft:movement.* flavors and the six integer state components are written out; the rest are parsed structurally. minecraft:type_family and the integer state components are data a filter reads, so an entity answers is_family, is_variant, is_mark_variant and is_skin_id from them with no caller view. minecraft:nameable gates name-tag use, queues its default and matching name events, and projects the configured visibility and custom name to the client. minecraft:is_dyeable gates dye use, updates the entity's palette color, and projects its touch-screen prompt.
Every non-goal key in the vanilla pack has a component factory, so the loader preserves its body and exposes it through EntityInstance.componentParams. Some of the 34 keys used by only one entity still have no runtime behavior. Their factories preserve their bodies, and the corpus test counts them as parsed rather than behaviorally implemented.
Measured coverage
Against the composed vanilla behavior pack of Bedrock Dedicated Server 1.26.51.1, through the corpus test in src/vanillaEntities.test.ts:
| Measure | Result |
|---|---|
| Entity definitions composed | 129 |
| Files that parse without an error | 129 |
Unknown top-level or description keys | 0 |
| Non-goal component keys in vanilla | 202, all registered |
| Non-goal keys with a component hook | 85 |
| Non-goal keys with a runtime effect across the server | 96 |
| Entities whose every non-goal component is registered | 129 of 129 |
| Goal names in vanilla | 170, all registered by @jsprismarine/entity-goals |
| Entities that declare goals | 92 of 129; all their goal names are registered |
| Filter tests the documentation lists | 107, all implemented |
| Filter tests vanilla uses | 86, all implemented |
| Event action keys vanilla uses | 8, all carried out; 56 uses |
| Stats both editions publish for the same entity | 438, of which 287 agree |
The 151 stats the two editions disagree on, measured against the 93 entity types of @jsprismarine/bedrock-data's java_entity_attributes, are movement_speed 42, height 35, width 24, follow_range 21, attack_damage 15, max_health 10, flying_speed 2 and knockback_resistance 2.
Java's table is keyed by Java's entity names, and five types spawn under the name Bedrock used before Mojang renamed them: the evoker as evocation_illager, the villager and zombie villager as villager_v2 and zombie_villager_v2, the tropical fish as tropicalfish and the zombified piglin as zombie_pigman. Those rows are found through @jsprismarine/mapping, so the decision reaches them too.
Which edition wins is decided per stat in src/javaStats.ts and recorded in ADR 0001. Java decides the four a Bedrock client never computes for itself, so the wither spawns with Java's 300 health rather than Bedrock's 600 and the witch follows from Java's 16 blocks rather than 64. Bedrock decides the five the client predicts an actor with, which ClientMovementPredictionSyncPacket enumerates: the bounding box width and height, the movement and flying speeds, and the jump strength. 33 disagreements resolve to Java, 103 keep Bedrock's value because Bedrock decides the stat, and 15 are reviewed exceptions where Java publishes a number it overwrites at spawn, such as the horse's 53 health or a slime's.
Pass the table in to turn the decision on:
import { java_entity_attributes } from '@jsprismarine/bedrock-data';
const wither = types.spawn('minecraft:wither', { environment: { javaStats: java_entity_attributes } });
wither.attributes.get('health')?.base; // 300, where the pack writes 600statRuling(identifier, stat) answers why one entity's stat resolved the way it did, so a parity row quotes the decision instead of keeping a second copy of it.
The registry recognizes all 202 non-goal component names used by the 129 vanilla entities. That measures name coverage rather than complete simulation: 85 component factories have hooks, and 96 components have a runtime effect across the server when host reads and protocol projections are included. The remaining 106 bodies are available as data for behavior that still needs to be added.
minecraft:area_attack has a dedicated schema here; Prismarine applies its filtered, cooldowned range damage from the active component set.
For minecraft:teleport, the actuator supplies reachable destinations and the current target position. Prismarine moves the entity and marks the client update as a teleport. Matching projectile hits can be evaded before damage lands.
minecraft:target_nearby_sensor reads the entity's current target, checks follow_range, and uses the current block view to determine whether a solid block occludes the path between their eyes.
The corpus test needs the sources that pnpm --filter @jsprismarine/bedrock-data run fetch:sources caches and runs only with JSP_VANILLA_ENTITIES set:
JSP_VANILLA_ENTITIES=1 pnpm --filter @jsprismarine/entities exec vitest run src/vanillaEntities.test.tsWhat a later agent adds
- Goal parity. All 170 vanilla goal names have registered factories, and the totality test keeps that inventory complete. The remaining work is validating each goal's world effects and timing against its game behavior.
- Spawn rules. The 21 spawn-rule components, the population pools and the herd placement. The filter evaluator and
spawnEventForalready take theinitial_event,eventandpermute_typenames a spawn rule hands over. - Trading.
minecraft:economy_trade_tableandminecraft:trade_tableparse as data today; the tier, demand and restock machinery is the trading agent's. - The world seams.
EntityActuatorfor navigation and look control,EntityEnvironment.removeandtransformfor despawn and transformation,effectsfor the six event actions that leave the package,routefor a trigger aimed at another entity,molangfor the expressions in component bodies, andfilterContextfor everything about the world a filter asks. - Remaining entity component behavior. Of the 202 non-goal component names in the vanilla pack, 106 currently expose data without runtime behavior. The component bodies remain accessible to the host, but registration alone does not mean the server simulates them.
Classes
Interfaces
AdmireItemParams
Defined in: entities/src/components/interactions.ts:120
What minecraft:admire_item declares. Durations are in seconds.
Properties
cooldownAfterBeingAttacked
readonlycooldownAfterBeingAttacked:number
Defined in: entities/src/components/interactions.ts:124
Time after damage during which the entity will not admire items.
duration
readonlyduration:number
Defined in: entities/src/components/interactions.ts:122
How long the entity admires an offered item.
AgeableParams
Defined in: entities/src/components/lifecycle.ts:301
What minecraft:ageable declares.
Properties
dropItems
readonlydropItems: readonlyunknown[]
Defined in: entities/src/components/lifecycle.ts:317
Items dropped when the entity grows up.
duration
readonlyduration:number
Defined in: entities/src/components/lifecycle.ts:303
How long the baby takes to grow up, in seconds; vanilla writes 1200 in all but one body.
feedItems
readonlyfeedItems: readonlyunknown[]
Defined in: entities/src/components/lifecycle.ts:311
Items that feed the baby, and the fraction of its remaining growth time each item advances.
growUp?
readonlyoptionalgrowUp?:SensorTrigger
Defined in: entities/src/components/lifecycle.ts:305
The event fired when the entity finishes growing.
interactFilters?
readonlyoptionalinteractFilters?:Filter
Defined in: entities/src/components/lifecycle.ts:319
Gates the feeding interaction.
pauseGrowth?
readonlyoptionalpauseGrowth?:SensorTrigger
Defined in: entities/src/components/lifecycle.ts:307
The event fired when one of pause_growth_items is used.
pauseGrowthItems
readonlypauseGrowthItems: readonlyunknown[]
Defined in: entities/src/components/lifecycle.ts:313
Items that pause growth when fed to the baby.
resetGrowth?
readonlyoptionalresetGrowth?:SensorTrigger
Defined in: entities/src/components/lifecycle.ts:309
The event fired when one of reset_growth_items is used.
resetGrowthItems
readonlyresetGrowthItems: readonlyunknown[]
Defined in: entities/src/components/lifecycle.ts:315
Items that reset the countdown when fed to the baby.
AmbientSoundChoice
Defined in: entities/src/components/lifecycle.ts:458
One {condition, event_name} entry of minecraft:ambient_sound_interval.event_names.
Properties
condition?
readonlyoptionalcondition?:string
Defined in: entities/src/components/lifecycle.ts:460
A Molang expression; the first entry whose condition holds wins.
eventName
readonlyeventName:string
Defined in: entities/src/components/lifecycle.ts:461
AmbientSoundIntervalParams
Defined in: entities/src/components/lifecycle.ts:465
What minecraft:ambient_sound_interval declares.
Properties
choices
readonlychoices: readonlyAmbientSoundChoice[]
Defined in: entities/src/components/lifecycle.ts:472
eventName
readonlyeventName:string
Defined in: entities/src/components/lifecycle.ts:471
The sound played when no conditional entry holds.
range
readonlyrange:number
Defined in: entities/src/components/lifecycle.ts:469
How many more seconds the engine may add to the wait.
value
readonlyvalue:number
Defined in: entities/src/components/lifecycle.ts:467
The shortest wait between sounds, in seconds.
AngryParams
Defined in: entities/src/components/combat.ts:276
What minecraft:angry declares.
Properties
angrySound?
readonlyoptionalangrySound?:string
Defined in: entities/src/components/combat.ts:294
broadcastAnger
readonlybroadcastAnger:boolean
Defined in: entities/src/components/combat.ts:284
Whether anger spreads to nearby matching entities.
broadcastAngerOnAttack
readonlybroadcastAngerOnAttack:boolean
Defined in: entities/src/components/combat.ts:286
Whether this entity broadcasts anger when it attacks.
broadcastAngerOnBeingAttacked
readonlybroadcastAngerOnBeingAttacked:boolean
Defined in: entities/src/components/combat.ts:288
Whether this entity broadcasts anger when another entity attacks it.
broadcastAngerWhenDying
readonlybroadcastAngerWhenDying:boolean
Defined in: entities/src/components/combat.ts:290
Whether this entity broadcasts anger when it dies; defaults to true.
broadcastFilters?
readonlyoptionalbroadcastFilters?:Filter
Defined in: entities/src/components/combat.ts:297
broadcastRange
readonlybroadcastRange:number
Defined in: entities/src/components/combat.ts:291
broadcastTargets?
readonlyoptionalbroadcastTargets?: readonlystring[]
Defined in: entities/src/components/combat.ts:299
Entity families that receive the anger; omitted means the same entity type.
calm?
readonlyoptionalcalm?:SensorTrigger
Defined in: entities/src/components/combat.ts:282
The event fired when the anger runs out.
duration
readonlyduration:number
Defined in: entities/src/components/combat.ts:278
How long the anger lasts, in seconds.
durationDelta
readonlydurationDelta:number
Defined in: entities/src/components/combat.ts:280
How far either side of duration the engine draws the real length.
filters?
readonlyoptionalfilters?:Filter
Defined in: entities/src/components/combat.ts:293
A mob that passes this filter is excluded from attack targets while this component is active.
soundInterval
readonlysoundInterval: readonly [number,number]
Defined in: entities/src/components/combat.ts:296
Integer seconds between repeated angry sounds; a zero interval disables repeats.
AreaAttackParams
Defined in: entities/src/components/combat.ts:43
What minecraft:area_attack declares.
Properties
cause
readonlycause:string
Defined in: entities/src/components/combat.ts:45
Damage cause reported to damage sensors and death handling.
damageCooldown
readonlydamageCooldown:number
Defined in: entities/src/components/combat.ts:47
Seconds between hits to the same target.
damagePerTick
readonlydamagePerTick:number
Defined in: entities/src/components/combat.ts:49
Damage dealt to each eligible target.
damageRange
readonlydamageRange:number
Defined in: entities/src/components/combat.ts:51
Maximum distance between the entities' collision boxes.
deathMessageOverride
readonlydeathMessageOverride:string|undefined
Defined in: entities/src/components/combat.ts:55
Localization key used when this attack kills a player.
entityFilter
readonlyentityFilter:Filter|undefined
Defined in: entities/src/components/combat.ts:53
Filter a target has to pass before this component damages it.
playAttackSound
readonlyplayAttackSound:boolean
Defined in: entities/src/components/combat.ts:57
Whether to play the attack sound for each eligible hit.
useSelfAsDamageSource
readonlyuseSelfAsDamageSource:boolean
Defined in: entities/src/components/combat.ts:59
Whether the attacker is recorded as the source of damage.
AttackParams
Defined in: entities/src/components/combat.ts:32
What minecraft:attack declares.
Properties
damage
readonlydamage:DamageRange
Defined in: entities/src/components/combat.ts:33
effectAmplifier
readonlyeffectAmplifier:number
Defined in: entities/src/components/combat.ts:39
One below the displayed potency of the effect.
effectDuration
readonlyeffectDuration:number
Defined in: entities/src/components/combat.ts:37
How long the effect lasts, in seconds.
effectName?
readonlyoptionaleffectName?:string
Defined in: entities/src/components/combat.ts:35
The status effect a hit applies, such as poison.
Attribute
Defined in: entities/src/attributes.ts:29
One attribute's live value with the bounds its component declared.
Properties
base
readonlybase:number
Defined in: entities/src/attributes.ts:31
The value the component declared, which a reset returns to.
current
readonlycurrent:number
Defined in: entities/src/attributes.ts:35
The value now, always within the bounds.
max
readonlymax:number
Defined in: entities/src/attributes.ts:33
min
readonlymin:number
Defined in: entities/src/attributes.ts:32
AttributeSpec
Defined in: entities/src/attributes.ts:39
How a component declares an attribute.
Properties
base
base:
number
Defined in: entities/src/attributes.ts:41
The starting value; the component's value.
max?
optionalmax?:number
Defined in: entities/src/attributes.ts:43
The component's max, defaulting to the base.
min?
optionalmin?:number
Defined in: entities/src/attributes.ts:45
The component's min, defaulting to 0.
BarterParams
Defined in: entities/src/components/interactions.ts:146
What minecraft:barter declares.
Properties
barterTable?
readonlyoptionalbarterTable?:string
Defined in: entities/src/components/interactions.ts:148
Loot table rolled when the entity completes a barter.
cooldownAfterBeingAttacked
readonlycooldownAfterBeingAttacked:number
Defined in: entities/src/components/interactions.ts:150
Time after damage during which the entity will not barter.
BlockSensorBreak
Defined in: entities/src/components/sensors.ts:234
One block identifier and event within minecraft:block_sensor.on_break.
Properties
blockList
readonlyblockList: readonlystring[]
Defined in: entities/src/components/sensors.ts:235
event
readonlyevent:string
Defined in: entities/src/components/sensors.ts:236
BlockSensorParams
Defined in: entities/src/components/sensors.ts:240
What minecraft:block_sensor declares.
Properties
onBreak
readonlyonBreak: readonlyBlockSensorBreak[]
Defined in: entities/src/components/sensors.ts:245
sensorRadius
readonlysensorRadius:number
Defined in: entities/src/components/sensors.ts:242
Maximum distance from the entity, capped at 32 blocks.
sources?
readonlyoptionalsources?:Filter
Defined in: entities/src/components/sensors.ts:244
Filter the breaker must pass, evaluated with the breaker as other.
BreathableParams
Defined in: entities/src/components/hazards.ts:182
What minecraft:breathable declares.
Properties
breathesAir
readonlybreathesAir:boolean
Defined in: entities/src/components/hazards.ts:187
breathesLava
readonlybreathesLava:boolean
Defined in: entities/src/components/hazards.ts:189
breathesWater
readonlybreathesWater:boolean
Defined in: entities/src/components/hazards.ts:188
generatesBubbles
readonlygeneratesBubbles:boolean
Defined in: entities/src/components/hazards.ts:190
inhaleTime
readonlyinhaleTime:number
Defined in: entities/src/components/hazards.ts:191
suffocateTime
readonlysuffocateTime:number
Defined in: entities/src/components/hazards.ts:186
How many seconds between suffocation ticks; -1 means the entity does not suffocate.
totalSupply
readonlytotalSupply:number
Defined in: entities/src/components/hazards.ts:184
How many seconds of air the entity holds.
BreedableItemParams
Defined in: entities/src/components/interactions.ts:614
One item minecraft:breedable accepts.
Properties
item
readonlyitem:string
Defined in: entities/src/components/interactions.ts:616
The item identifier, normalized to the default Minecraft namespace.
resultItem?
readonlyoptionalresultItem?:string
Defined in: entities/src/components/interactions.ts:618
Item replacing the consumed item after the entity enters its love state.
BreedableParams
Defined in: entities/src/components/interactions.ts:622
The minecraft:breedable values used when an entity receives a breeding item.
Extends
Indexable
[
key:string]:unknown
Properties
breedItems
readonlybreedItems: readonlyBreedableItemParams[]
Defined in: entities/src/components/interactions.ts:624
Items that can put the entity into its love state.
requireFullHealth
readonlyrequireFullHealth:boolean
Defined in: entities/src/components/interactions.ts:628
Whether the entity must be at full health before accepting a breeding item.
requireTame
readonlyrequireTame:boolean
Defined in: entities/src/components/interactions.ts:626
Whether the entity must be tamed before accepting a breeding item.
BurnsInDaylightParams
Defined in: entities/src/components/hazards.ts:113
The sunlight protection slot declared by minecraft:burns_in_daylight.
Properties
protectionSlot
readonlyprotectionSlot:"slot.armor.body"|"slot.armor.chest"|"slot.armor.feet"|"slot.armor.head"|"slot.armor.legs"|"slot.weapon.mainhand"|"slot.weapon.offhand"
Defined in: entities/src/components/hazards.ts:115
The occupied slot that protects the entity, defaulting to its head.
CollisionBoxParams
Defined in: entities/src/components/body.ts:37
What minecraft:collision_box declares, in blocks.
Properties
height
readonlyheight:number
Defined in: entities/src/components/body.ts:39
width
readonlywidth:number
Defined in: entities/src/components/body.ts:38
CombatRegenerationParams
Defined in: entities/src/components/combat.ts:175
What minecraft:combat_regeneration declares.
Properties
applyToFamily
readonlyapplyToFamily:boolean
Defined in: entities/src/components/combat.ts:177
Whether a same-family mob that kills this entity's attack target receives the buffs.
applyToSelf
readonlyapplyToSelf:boolean
Defined in: entities/src/components/combat.ts:179
Whether this entity receives the buffs when it kills its attack target.
regenerationDurationTicks
readonlyregenerationDurationTicks:number
Defined in: entities/src/components/combat.ts:181
Regeneration duration in ticks, or -1 when it never expires.
DamageCondition
Defined in: entities/src/components/hazards.ts:25
One entry of minecraft:hurt_on_condition.damage_conditions.
Properties
cause
readonlycause:string
Defined in: entities/src/components/hazards.ts:29
The damage cause to apply, such as lava.
damagePerTick
readonlydamagePerTick:number
Defined in: entities/src/components/hazards.ts:30
filters?
readonlyoptionalfilters?:Filter
Defined in: entities/src/components/hazards.ts:27
Gates the condition; absent means it always hurts.
DamageEvent
Defined in: entities/src/hooks.ts:140
One incoming damage event, as minecraft:damage_sensor and the hurt triggers read it.
Properties
amount
readonlyamount:number
Defined in: entities/src/hooks.ts:144
The damage before any component changes it.
cause
readonlycause:string
Defined in: entities/src/hooks.ts:142
The damage cause, such as fall or entity_attack.
damager?
readonlyoptionaldamager?:FilterEntityView
Defined in: entities/src/hooks.ts:149
Who dealt the damage, which the damager and other filter subjects read and minecraft:on_hurt_by_player tests for the player family.
DamageOutcome
Defined in: entities/src/hooks.ts:153
What a damage hook decides about one damage event.
Properties
amount
readonlyamount:number
Defined in: entities/src/hooks.ts:155
The damage to apply; zero means the entity takes none.
events?
readonlyoptionalevents?: readonlystring[]
Defined in: entities/src/hooks.ts:157
Events to fire as a result, applied on the entity's next tick.
DamageOverTimeParams
Defined in: entities/src/components/hazards.ts:139
What minecraft:damage_over_time declares.
Properties
damagePerHurt
readonlydamagePerHurt:number
Defined in: entities/src/components/hazards.ts:140
timeBetweenHurt
readonlytimeBetweenHurt:number
Defined in: entities/src/components/hazards.ts:142
Seconds between hurts; a zero falls back to the half-second hurt interval.
DamageRange
Defined in: entities/src/components/combat.ts:17
A damage amount, which vanilla writes as a number or a {range_min, range_max} object.
Properties
max
readonlymax:number
Defined in: entities/src/components/combat.ts:19
min
readonlymin:number
Defined in: entities/src/components/combat.ts:18
DamageResult
Defined in: entities/src/hooks.ts:180
What one damage event did to the entity.
Properties
amount
readonlyamount:number
Defined in: entities/src/hooks.ts:182
The damage applied after every component had its say; never negative.
died
readonlydied:boolean
Defined in: entities/src/hooks.ts:186
Whether the damage took the entity to zero health.
events
readonlyevents: readonlystring[]
Defined in: entities/src/hooks.ts:188
The events the damage queued, in the order they were raised.
health?
readonlyoptionalhealth?:number
Defined in: entities/src/hooks.ts:184
The health left, or undefined when the entity declares no minecraft:health.
DamageSensorParams
Defined in: entities/src/components/sensors.ts:575
What minecraft:damage_sensor declares.
Properties
triggers
readonlytriggers: readonlyDamageSensorTrigger[]
Defined in: entities/src/components/sensors.ts:576
DamageSensorTrigger
Defined in: entities/src/components/sensors.ts:565
One minecraft:damage_sensor trigger.
Properties
cause
readonlycause:string
Defined in: entities/src/components/sensors.ts:567
The damage cause it answers for, or any.
damageMultiplier
readonlydamageMultiplier:number
Defined in: entities/src/components/sensors.ts:569
dealsDamage
readonlydealsDamage:"yes"|"no"|"no_but_side_effects_apply"|"no_but_entity_effects_apply"
Defined in: entities/src/components/sensors.ts:568
event?
readonlyoptionalevent?:string
Defined in: entities/src/components/sensors.ts:571
filters?
readonlyoptionalfilters?:Filter
Defined in: entities/src/components/sensors.ts:570
DefinitionSource
Defined in: entities/src/definition.ts:88
Where a definition came from, for diagnostics.
Extended by
Properties
pack
pack:
string
Defined in: entities/src/definition.ts:90
The pack the file came from.
path?
optionalpath?:string
Defined in: entities/src/definition.ts:92
The pack-relative path of the file.
DespawnParams
Defined in: entities/src/components/lifecycle.ts:20
What minecraft:despawn declares.
Properties
filters?
readonlyoptionalfilters?:Filter
Defined in: entities/src/components/lifecycle.ts:22
When set, the entity despawns as soon as the filters pass and the distance rules do not apply.
maxDistance
readonlymaxDistance:number
Defined in: entities/src/components/lifecycle.ts:24
minDistance
readonlyminDistance:number
Defined in: entities/src/components/lifecycle.ts:23
minRangeRandomChance
readonlyminRangeRandomChance:number
Defined in: entities/src/components/lifecycle.ts:26
One in this many ticks, the entity beyond minDistance rolls to despawn.
removeChildEntities
readonlyremoveChildEntities:boolean
Defined in: entities/src/components/lifecycle.ts:27
Diagnostic
Defined in: entities/src/diagnostics.ts:11
One finding reported while parsing or resolving an entity definition.
Properties
code
code:
string
Defined in: entities/src/diagnostics.ts:14
A stable machine-readable code, such as entity.unknownKey.
message
message:
string
Defined in: entities/src/diagnostics.ts:19
pack
pack:
string
Defined in: entities/src/diagnostics.ts:16
The name of the pack the finding belongs to, or the identifier when no pack is known.
path?
optionalpath?:string
Defined in: entities/src/diagnostics.ts:18
The file within the pack, when the finding concerns one file.
severity
severity:
DiagnosticSeverity
Defined in: entities/src/diagnostics.ts:12
DyeableParams
Defined in: entities/src/components/dyeable.ts:8
What minecraft:is_dyeable declares.
Properties
interactText?
readonlyoptionalinteractText?:string
Defined in: entities/src/components/dyeable.ts:10
The touch-screen prompt shown when a player can dye this entity.
EntityActuator
Defined in: entities/src/hooks.ts:69
What a goal does to the entity it runs on.
This is the navigation and look-control seam. The package ships no implementation: a caller supplies one, and the reference goals prove the scheduler against a recording double in the tests.
Methods
jump()
jump():
void
Defined in: entities/src/hooks.ts:79
Makes the entity jump once.
Returns
void
lookAt()
lookAt(
position):void
Defined in: entities/src/hooks.ts:77
Points the head at a position.
Parameters
position
Returns
void
moveTo()
moveTo(
position,speedMultiplier):void
Defined in: entities/src/hooks.ts:73
Paths toward a position at a multiple of the entity's minecraft:movement speed.
Parameters
position
speedMultiplier
number
Returns
void
nearestPlayer()
nearestPlayer(
maxDistance):EntityPosition|undefined
Defined in: entities/src/hooks.ts:83
The position of the nearest player within the distance, or undefined when there is none.
Parameters
maxDistance
number
Returns
EntityPosition | undefined
position()
position():
EntityPosition
Defined in: entities/src/hooks.ts:71
Where the entity is now.
Returns
randomPosition()?
optionalrandomPosition(center,xDistance,yDistance,zDistance):EntityPosition|undefined
Defined in: entities/src/hooks.ts:85
A reachable random position around a point, or undefined when the navigator finds none.
Parameters
center
xDistance
number
yDistance
number
zDistance
number
Returns
EntityPosition | undefined
randomTarget()
randomTarget(
xzDistance,yDistance):EntityPosition|undefined
Defined in: entities/src/hooks.ts:81
A reachable position within the box around the entity, or undefined when the navigator finds none.
Parameters
xzDistance
number
yDistance
number
Returns
EntityPosition | undefined
stopMoving()
stopMoving():
void
Defined in: entities/src/hooks.ts:75
Abandons the current path.
Returns
void
targetPosition()?
optionaltargetPosition():EntityPosition|undefined
Defined in: entities/src/hooks.ts:92
The current attack target's position, or undefined when the entity has no live target.
Returns
EntityPosition | undefined
teleportTo()?
optionalteleportTo(position):void
Defined in: entities/src/hooks.ts:94
Moves the entity instantly, stopping its current path.
Parameters
position
Returns
void
EntityAddItemsRequest
Defined in: entities/src/hooks.ts:192
A Bedrock loot table whose items a successful interaction adds to the player's inventory.
Extended by
Properties
table
readonlytable:string
Defined in: entities/src/hooks.ts:194
The pack-relative Bedrock loot-table path.
EntityAngerBroadcast
Defined in: entities/src/hooks.ts:23
One request to spread an entity's anger to nearby matching entities.
Properties
filters?
readonlyoptionalfilters?:Filter
Defined in: entities/src/hooks.ts:27
Filters evaluated with the broadcaster as caller and each candidate as other.
range
readonlyrange:number
Defined in: entities/src/hooks.ts:25
Maximum distance from the broadcaster, in blocks.
target?
readonlyoptionaltarget?:FilterEntityView
Defined in: entities/src/hooks.ts:31
The entity that caused the broadcast, which candidates may target.
targets?
readonlyoptionaltargets?: readonlystring[]
Defined in: entities/src/hooks.ts:29
Families that receive the broadcast; omitted means the broadcaster's entity type.
EntityBlockBreakEvent
Defined in: entities/src/hooks.ts:35
One block break an active minecraft:block_sensor can inspect.
Properties
block
readonlyblock:FilterBlockView
Defined in: entities/src/hooks.ts:37
The block that was removed.
position
readonlyposition:EntityPosition
Defined in: entities/src/hooks.ts:39
The block's integer world position.
source?
readonlyoptionalsource?:FilterEntityView
Defined in: entities/src/hooks.ts:41
The player or entity that caused the break, when the runtime knows it.
EntityBlockState
Defined in: entities/src/hooks.ts:45
One block state as an entity component reads it from the world.
Properties
identifier
readonlyidentifier:string
Defined in: entities/src/hooks.ts:47
The namespaced block identifier.
states
readonlystates:Readonly<Record<string,string|number|boolean>>
Defined in: entities/src/hooks.ts:49
The block's state values.
EntityDefinition
Defined in: entities/src/definition.ts:73
One parsed entity definition.
Properties
componentGroups
readonlycomponentGroups:ReadonlyMap<string,ComponentMap>
Defined in: entities/src/definition.ts:81
Group name to component map, inactive until an event adds the group.
components
readonlycomponents:ComponentMap
Defined in: entities/src/definition.ts:79
The always-active component set.
description
readonlydescription:EntityDescription
Defined in: entities/src/definition.ts:77
events
readonlyevents:ReadonlyMap<string,EventNode>
Defined in: entities/src/definition.ts:82
formatVersion?
readonlyoptionalformatVersion?:FormatVersion
Defined in: entities/src/definition.ts:76
The file's format_version, which selects how the engine reads the rest.
identifier
readonlyidentifier:string
Defined in: entities/src/definition.ts:74
upgrades
readonlyupgrades:unknown
Defined in: entities/src/definition.ts:84
The upgrades handlers, kept raw; vanilla uses none yet.
EntityDefinitionInput
Defined in: entities/src/entityType.ts:61
One definition to resolve, with where it came from.
Properties
definition
readonlydefinition:EntityDefinition
Defined in: entities/src/entityType.ts:62
pack
readonlypack:string
Defined in: entities/src/entityType.ts:64
The pack the definition came from; diagnostics name it.
path?
readonlyoptionalpath?:string
Defined in: entities/src/entityType.ts:66
The pack-relative path of the file.
EntityDescription
Defined in: entities/src/definition.ts:53
The parsed description block.
Properties
animations
readonlyanimations:ReadonlyMap<string,string>
Defined in: entities/src/definition.ts:66
Behavior animation and animation controller names, by short name.
entityVersion?
readonlyoptionalentityVersion?:FormatVersion
Defined in: entities/src/definition.ts:69
The saved-data version, which drives the upgrades handlers.
identifier
readonlyidentifier:string
Defined in: entities/src/definition.ts:54
isExperimental
readonlyisExperimental:boolean
Defined in: entities/src/definition.ts:59
isSpawnable
readonlyisSpawnable:boolean
Defined in: entities/src/definition.ts:56
Adds a spawn egg to the creative inventory when true.
isSummonable
readonlyisSummonable:boolean
Defined in: entities/src/definition.ts:58
Allows /summon when true.
properties
readonlyproperties:ReadonlyMap<string,PropertyDefinition>
Defined in: entities/src/definition.ts:64
runtimeIdentifier?
readonlyoptionalruntimeIdentifier?:string
Defined in: entities/src/definition.ts:63
Inherits engine mechanics from a vanilla entity that has no component form.
scripts
readonlyscripts:EntityScripts
Defined in: entities/src/definition.ts:67
spawnCategory?
readonlyoptionalspawnCategory?:string
Defined in: entities/src/definition.ts:61
The pool the entity spawns with; Mojang recommends creators leave it unset.
EntityEffects
Defined in: entities/src/hooks.ts:98
Operations an entity component delegates to the world outside this package.
Methods
applyStatusEffect()?
optionalapplyStatusEffect(entity,target,effect):boolean
Defined in: entities/src/hooks.ts:105
Adds or refreshes an effect on an entity selected by a component.
Parameters
entity
target
effect
Returns
boolean
dropItem()?
optionaldropItem(entity,slot):void
Defined in: entities/src/hooks.ts:115
Drops what the entity carries in one slot, such as slot.weapon.mainhand.
Parameters
entity
slot
string
Returns
void
emitParticle()?
optionalemitParticle(entity,particle):void
Defined in: entities/src/hooks.ts:101
Parameters
entity
particle
string
Returns
void
emitVibration()?
optionalemitVibration(entity,vibration):void
Defined in: entities/src/hooks.ts:103
Emits a game-event vibration sculk sensors and wardens listen for.
Parameters
entity
vibration
"entity_interact" | "entity_act" | "entity_die"
Returns
void
executeEventOnBlock()?
optionalexecuteEventOnBlock(entity,position,event):void
Defined in: entities/src/hooks.ts:117
Fires a block event on the block at the entity's home position.
Parameters
entity
position
event
string
Returns
void
playSound()?
optionalplaySound(entity,sound):void
Defined in: entities/src/hooks.ts:100
Plays a sound at the entity; the name is the pack's own, such as saddle.
Parameters
entity
sound
string
Returns
void
queueCommand()?
optionalqueueCommand(entity,command,target):void
Defined in: entities/src/hooks.ts:113
Runs one command with the named subject as its executor.
Parameters
entity
command
string
target
"self" | "other" | "player" | "target" | "parent" | "baby" | "block" | "holder"
Whom the command runs as, self when the body names none.
Returns
void
removeStatusEffect()?
optionalremoveStatusEffect(entity,target,identifier):boolean
Defined in: entities/src/hooks.ts:107
Removes an effect from an entity selected by a component.
Parameters
entity
target
identifier
string
Returns
boolean
EntityEnvironment
Defined in: entities/src/entityInstance.ts:148
What an entity needs from the world around it.
Properties
actuator?
optionalactuator?:EntityActuator
Defined in: entities/src/entityInstance.ts:169
Moves, looks and jumps on behalf of the goals.
effects?
optionaleffects?:EntityEffects
Defined in: entities/src/entityInstance.ts:171
Carries out the event actions that leave the package, such as play_sound.
javaNavigation?
optionaljavaNavigation?:JavaEntityNavigation
Defined in: entities/src/entityInstance.ts:200
Java's path navigator and collision behavior, when the host has the pinned class dump.
javaStats?
optionaljavaStats?:Readonly<Record<string,JavaEntityStats>>
Defined in: entities/src/entityInstance.ts:198
Java Edition's entity stats, which decide the four attributes a Bedrock client never simulates. Leaving it out runs the pack's own numbers.
See
SHARED_STATS for which stat each edition decides.
random?
optionalrandom?:RandomSource
Defined in: entities/src/entityInstance.ts:173
Draws the randomize weights and the random_chance filter.
Methods
blockAt()?
optionalblockAt(position):EntityBlockState|undefined
Defined in: entities/src/entityInstance.ts:165
Reads a block at an integer world position, or leaves it unknown when the chunk is unloaded.
Parameters
position
The integer block position to read.
Returns
EntityBlockState | undefined
broadcastAnger()?
optionalbroadcastAnger(entity,request):void
Defined in: entities/src/entityInstance.ts:167
Delivers an angry component's broadcast to nearby matching entities.
Parameters
entity
request
Returns
void
componentSetChanged()?
optionalcomponentSetChanged(entity):void
Defined in: entities/src/entityInstance.ts:150
Refreshes world indexes when an event changes the active component set.
Parameters
entity
Returns
void
entitySensorCandidates()?
optionalentitySensorCandidates(entity,query): readonlyEntitySensorCandidate[]
Defined in: entities/src/entityInstance.ts:160
Finds live entities a minecraft:entity_sensor can sense.
Parameters
entity
query
Returns
readonly EntitySensorCandidate[]
filterContext()?
optionalfilterContext(entity):FilterContext
Defined in: entities/src/entityInstance.ts:156
Builds the filter context for one evaluation. The entity fills in its own facts (properties, components, type families, attributes) over whatever this returns.
Parameters
entity
Returns
molang()?
optionalmolang(source,entity):PropertyValue|undefined
Defined in: entities/src/entityInstance.ts:175
Evaluates a Molang expression for a set_property value or a component's expression.
Parameters
source
string
entity
Returns
PropertyValue | undefined
propertyDefault()?
optionalpropertyDefault(source,definition):PropertyValue|undefined
Defined in: entities/src/entityInstance.ts:181
Evaluates a property's Molang default. It takes no entity, because a default expression may only call query.had_component_group, which reads the saved data the entity is being built from.
Parameters
source
string
definition
Returns
PropertyValue | undefined
remove()?
optionalremove(entity,reason):void
Defined in: entities/src/entityInstance.ts:185
Takes the entity out of the world, for minecraft:despawn and minecraft:instant_despawn.
Parameters
entity
reason
string
Returns
void
report()?
optionalreport(message,entity):void
Defined in: entities/src/entityInstance.ts:191
Receives everything the runtime met and did not carry out.
Parameters
message
string
entity
Returns
void
route()?
optionalroute(trigger,entity):void
Defined in: entities/src/entityInstance.ts:183
Delivers an event an entity triggered on another entity.
Parameters
trigger
entity
Returns
void
spawnEntity()?
optionalspawnEntity(entity,request):boolean
Defined in: entities/src/entityInstance.ts:189
Creates an entity or item requested by a data component.
Parameters
entity
request
Returns
boolean
targetProximity()?
optionaltargetProximity(entity):EntityTargetProximity|undefined
Defined in: entities/src/entityInstance.ts:158
The current target's range and visibility, for minecraft:target_nearby_sensor.
Parameters
entity
Returns
EntityTargetProximity | undefined
transform()?
optionaltransform(entity,request):void
Defined in: entities/src/entityInstance.ts:187
Replaces the entity with another type, for minecraft:transformation.
Parameters
entity
request
Returns
void
EntityFile
Defined in: entities/src/entityTypes.ts:25
One entity file to load.
Extends
Properties
data
data:
unknown
Defined in: entities/src/entityTypes.ts:27
The already-parsed JSON of the file.
pack
pack:
string
Defined in: entities/src/definition.ts:90
The pack the file came from.
Inherited from
path?
optionalpath?:string
Defined in: entities/src/definition.ts:92
The pack-relative path of the file.
Inherited from
EntityHooks
Defined in: entities/src/hooks.ts:315
The hooks an entity component may implement.
onInitialize and onRemove are what make component groups a state machine: adding a group initializes its components, re-adding an active group initializes them again, and removing a group removes them whole rather than restoring what they replaced.
Properties
onAttack
onAttack: (
entity,target) =>void
Defined in: entities/src/hooks.ts:329
Runs when the entity attacks another entity.
Parameters
entity
target
Returns
void
onAttackTargetKilled
onAttackTargetKilled: (
entity,killer) =>void
Defined in: entities/src/hooks.ts:331
Runs when the entity's current attack target is killed.
Parameters
entity
killer
Returns
void
onBlockBroken
onBlockBroken: (
entity,event) =>void
Defined in: entities/src/hooks.ts:325
Runs when a block breaks near the entity.
Parameters
entity
event
Returns
void
onDamage
onDamage: (
entity,damage) =>DamageOutcome|undefined
Defined in: entities/src/hooks.ts:333
Decides what one damage event does; the first handler that answers wins.
Parameters
entity
damage
Returns
DamageOutcome | undefined
onDamageProcessed
onDamageProcessed: (
entity,damage,result) =>void
Defined in: entities/src/hooks.ts:335
Observes the result after sensors, immunities, and health changes without altering it.
Parameters
entity
damage
result
Returns
void
onEquipmentChanged
onEquipmentChanged: (
entity,slot,equipped) =>void
Defined in: entities/src/hooks.ts:327
Runs when an item is placed into or removed from a default equipment slot.
Parameters
entity
slot
equipped
boolean
Returns
void
onFriendlyAnger
onFriendlyAnger: (
entity) =>void
Defined in: entities/src/hooks.ts:323
Runs when a nearby entity with the same type broadcasts anger.
Parameters
entity
Returns
void
onInitialize
onInitialize: (
entity) =>void
Defined in: entities/src/hooks.ts:317
Runs when the component becomes active, and again each time its group is re-added.
Parameters
entity
Returns
void
onInteractWithItem
onInteractWithItem: (
entity,itemIdentifier,other?,state?) =>boolean|EntityItemInteractionEffect|undefined
Defined in: entities/src/hooks.ts:339
Applies one held item; the first handler that answers wins.
Parameters
entity
itemIdentifier
string
other?
state?
Returns
boolean | EntityItemInteractionEffect | undefined
onProjectileHit
onProjectileHit: (
entity,projectile) =>boolean
Defined in: entities/src/hooks.ts:337
Lets the entity evade a projectile before its hit effects are applied.
Parameters
entity
projectile
Returns
boolean
onRemove
onRemove: (
entity) =>void
Defined in: entities/src/hooks.ts:319
Runs when the component stops being active because its group was removed.
Parameters
entity
Returns
void
onTick
onTick: (
entity) =>void
Defined in: entities/src/hooks.ts:321
Runs once per server tick while the component is active.
Parameters
entity
Returns
void
EntityInstanceOptions
Defined in: entities/src/entityInstance.ts:204
Options for one EntityInstance.
Properties
environment?
optionalenvironment?:EntityEnvironment
Defined in: entities/src/entityInstance.ts:207
id?
optionalid?:string|number
Defined in: entities/src/entityInstance.ts:206
A stable identity, which the filter tests that compare two entities read.
restoring?
optionalrestoring?:boolean
Defined in: entities/src/entityInstance.ts:209
Whether this instance is being restored from saved state instead of spawned.
EntityItemInteractionEffect
Defined in: entities/src/hooks.ts:254
The effects requested by a data-defined item interaction.
Properties
addItems?
readonlyoptionaladdItems?:EntityAddItemsRequest
Defined in: entities/src/hooks.ts:258
Loot to add to the player's inventory when the interaction succeeds.
admire?
readonlyoptionaladmire?:boolean
Defined in: entities/src/hooks.ts:286
Whether the entity should admire the offered item after the interaction.
barter?
readonlyoptionalbarter?:boolean
Defined in: entities/src/hooks.ts:288
Whether the entity should barter for the offered item after the interaction.
breed?
readonlyoptionalbreed?:boolean
Defined in: entities/src/hooks.ts:280
Whether the entity should enter its love state.
consumeItem?
readonlyoptionalconsumeItem?:boolean
Defined in: entities/src/hooks.ts:266
Whether the live inventory should consume one item from the held stack.
dropItemSlot?
readonlyoptionaldropItemSlot?:string
Defined in: entities/src/hooks.ts:300
The entity slot whose item is dropped when this interaction succeeds.
dropItemYOffset?
readonlyoptionaldropItemYOffset?:number
Defined in: entities/src/hooks.ts:302
Vertical offset for an item dropped from an entity slot.
equipItemSlot?
readonlyoptionalequipItemSlot?:string
Defined in: entities/src/hooks.ts:298
The inventory or equipment slot that receives the held item.
giveItem?
readonlyoptionalgiveItem?:boolean
Defined in: entities/src/hooks.ts:304
Whether the entity takes the held item into its main hand.
healthAmount?
readonlyoptionalhealthAmount?:number
Defined in: entities/src/hooks.ts:256
Health gained, or lost when negative, when the interaction succeeds.
hurtItem?
readonlyoptionalhurtItem?:number
Defined in: entities/src/hooks.ts:260
Durability removed from the held item when the interaction succeeds.
particleOnStart?
readonlyoptionalparticleOnStart?:object
Defined in: entities/src/hooks.ts:292
The named particle effect emitted when the interaction starts.
offsetTowardsInteractor
readonlyoffsetTowardsInteractor:boolean
particleType
readonlyparticleType:string
yOffset
readonlyyOffset:number
playSounds?
readonlyoptionalplaySounds?: readonlystring[]
Defined in: entities/src/hooks.ts:272
Sounds the world plays when this interaction succeeds.
repairEntityItem?
readonlyoptionalrepairEntityItem?:EntityRepairItemRequest
Defined in: entities/src/hooks.ts:276
The entity item slot to repair and the amount of durability to restore.
resultItem?
readonlyoptionalresultItem?:string
Defined in: entities/src/hooks.ts:262
The item the used stack becomes, when the interaction transforms it.
resultItemData?
readonlyoptionalresultItemData?:number
Defined in: entities/src/hooks.ts:264
The transformed item's auxiliary value, such as a filled bucket's variant.
spawnItems?
readonlyoptionalspawnItems?:EntitySpawnItemsRequest
Defined in: entities/src/hooks.ts:270
A Bedrock loot table and drop offset to run as part of a successful interaction.
spawnOffspring?
readonlyoptionalspawnOffspring?:string
Defined in: entities/src/hooks.ts:282
The offspring type to spawn when a matching spawn egg is used on this entity.
statusEffects?
readonlyoptionalstatusEffects?: readonlyEntityStatusEffect[]
Defined in: entities/src/hooks.ts:268
Status effects to apply when the interaction is accepted.
swing?
readonlyoptionalswing?:boolean
Defined in: entities/src/hooks.ts:290
Whether the interacting player should swing, which defaults to true.
takeItem?
readonlyoptionaltakeItem?:boolean
Defined in: entities/src/hooks.ts:278
Whether the entity should offer its main-hand item to an empty player hand.
tame?
readonlyoptionaltame?:EntityTameInteractionEffect
Defined in: entities/src/hooks.ts:284
The result of a data-defined taming attempt.
vibration?
readonlyoptionalvibration?:string
Defined in: entities/src/hooks.ts:274
Game-event vibration the world emits when this interaction succeeds.
EntityItemInteractionState
Defined in: entities/src/hooks.ts:222
Body timers that determine whether an item can start a stateful interaction.
Properties
breedCooldown?
readonlyoptionalbreedCooldown?:number
Defined in: entities/src/hooks.ts:226
Ticks remaining before the entity may breed again.
loveTicks?
readonlyoptionalloveTicks?:number
Defined in: entities/src/hooks.ts:224
Ticks remaining in the entity's current love state.
spawnEgg?
readonlyoptionalspawnEgg?:object
Defined in: entities/src/hooks.ts:228
The spawn egg being used, with its resolved offspring type.
identifier
readonlyidentifier:string
offspringIdentifier
readonlyoffspringIdentifier:string
EntityPosition
Defined in: entities/src/hooks.ts:16
A position in the world, as the navigation seam passes one.
Properties
x
readonlyx:number
Defined in: entities/src/hooks.ts:17
y
readonlyy:number
Defined in: entities/src/hooks.ts:18
z
readonlyz:number
Defined in: entities/src/hooks.ts:19
EntityRepairItemRequest
Defined in: entities/src/hooks.ts:204
Repairs the item in one of the entity's inventory or equipment slots.
Properties
amount
readonlyamount:number
Defined in: entities/src/hooks.ts:206
Durability restored, which must be greater than zero.
slot?
readonlyoptionalslot?:string
Defined in: entities/src/hooks.ts:208
The entity slot to repair, or undefined when the interaction names none.
EntityScripts
Defined in: entities/src/definition.ts:47
The description.scripts block, which names behavior animations to run.
Properties
animate
readonlyanimate: readonly (string|Record<string,string>)[]
Defined in: entities/src/definition.ts:49
Entries of scripts.animate: a name, or a name mapped to a Molang condition.
EntitySensorCandidate
Defined in: entities/src/entityInstance.ts:142
One live entity within a sensor's search range.
Properties
view
readonlyview:FilterEntityView
Defined in: entities/src/entityInstance.ts:144
The facts filters can read about the sensed entity as other.
EntitySensorParams
Defined in: entities/src/components/sensors.ts:95
What minecraft:entity_sensor declares.
Properties
findPlayersOnly
readonlyfindPlayersOnly:boolean
Defined in: entities/src/components/sensors.ts:96
relativeRange
readonlyrelativeRange:boolean
Defined in: entities/src/components/sensors.ts:97
subsensors
readonlysubsensors: readonlyEntitySensorSubsensor[]
Defined in: entities/src/components/sensors.ts:98
EntitySensorQuery
Defined in: entities/src/entityInstance.ts:128
The spatial and entity-type limits for one minecraft:entity_sensor search.
Properties
findPlayersOnly
readonlyfindPlayersOnly:boolean
Defined in: entities/src/entityInstance.ts:138
Whether to search only live players.
horizontalRange
readonlyhorizontalRange:number
Defined in: entities/src/entityInstance.ts:130
Maximum horizontal distance from the sensor, in blocks.
relativeRange
readonlyrelativeRange:boolean
Defined in: entities/src/entityInstance.ts:136
Whether the sensor's dimensions extend the configured ranges.
verticalRange
readonlyverticalRange:number
Defined in: entities/src/entityInstance.ts:132
Maximum vertical distance from the sensor, in blocks.
yOffset
readonlyyOffset:number
Defined in: entities/src/entityInstance.ts:134
Vertical offset applied to the sensor's position before measuring range.
EntitySensorSubsensor
Defined in: entities/src/components/sensors.ts:75
One range and event rule within minecraft:entity_sensor.subsensors.
Properties
cooldown
readonlycooldown:number
Defined in: entities/src/components/sensors.ts:77
Additional seconds to wait after the base one-tick sensing delay.
event?
readonlyoptionalevent?:SensorTrigger
Defined in: entities/src/components/sensors.ts:79
Event to raise when the matching entity count is in range.
eventFilters?
readonlyoptionaleventFilters?:Filter
Defined in: entities/src/components/sensors.ts:81
Filter evaluated with the sensor owner as self and each candidate as other.
maximumCount
readonlymaximumCount:number
Defined in: entities/src/components/sensors.ts:83
Largest matching candidate count, or -1 for no upper bound.
minimumCount
readonlyminimumCount:number
Defined in: entities/src/components/sensors.ts:85
Smallest matching candidate count required to raise the event.
range
readonlyrange: readonly [number,number]
Defined in: entities/src/components/sensors.ts:87
Horizontal and vertical search limits, in blocks.
requireAll
readonlyrequireAll:boolean
Defined in: entities/src/components/sensors.ts:89
Whether every nearby candidate must pass event_filters.
yOffset
readonlyyOffset:number
Defined in: entities/src/components/sensors.ts:91
Vertical offset applied before testing the candidate range.
EntitySpawnItemsRequest
Defined in: entities/src/hooks.ts:198
Items a successful data-defined interaction asks the host to drop.
Extends
Properties
table
readonlytable:string
Defined in: entities/src/hooks.ts:194
The pack-relative Bedrock loot-table path.
Inherited from
yOffset
readonlyyOffset:number
Defined in: entities/src/hooks.ts:200
Vertical offset from the entity's feet, in blocks.
EntityState
Defined in: entities/src/entityInstance.ts:77
The per-instance state @jsprismarine/content's Instance carries for this domain.
Properties
activeGroups
readonlyactiveGroups:Set<string>
Defined in: entities/src/entityInstance.ts:83
The component groups active now, in the order they became active.
attributes
readonlyattributes:Attributes
Defined in: entities/src/entityInstance.ts:78
properties
readonlyproperties:PropertyValues
Defined in: entities/src/entityInstance.ts:79
variables
readonlyvariables:Map<string,MolangValue>
Defined in: entities/src/entityInstance.ts:81
variable.* storage the entity's Molang expressions read and write.
EntityStatusEffect
Defined in: entities/src/hooks.ts:235
One status effect request passed across the entity runtime boundary.
Extended by
Properties
ambient?
readonlyoptionalambient?:boolean
Defined in: entities/src/hooks.ts:243
Whether the effect has the ambient visual style.
amplifier
readonlyamplifier:number
Defined in: entities/src/hooks.ts:241
One below the displayed potency.
durationTicks
readonlydurationTicks:number
Defined in: entities/src/hooks.ts:239
Ticks remaining, or -1 for an effect that never expires.
id
readonlyid:string
Defined in: entities/src/hooks.ts:237
The Bedrock status effect name.
showIcon?
readonlyoptionalshowIcon?:boolean
Defined in: entities/src/hooks.ts:247
Whether the effect has a HUD icon.
showParticles?
readonlyoptionalshowParticles?:boolean
Defined in: entities/src/hooks.ts:245
Whether the effect draws particles.
EntityTameInteractionEffect
Defined in: entities/src/hooks.ts:212
The result of a successful or failed minecraft:tameable item attempt.
Properties
event?
readonlyoptionalevent?:string
Defined in: entities/src/hooks.ts:216
The event to raise after the host records the new owner.
succeeded
readonlysucceeded:boolean
Defined in: entities/src/hooks.ts:214
Whether the component's probability roll tamed the entity.
target?
readonlyoptionaltarget?:"self"|"other"|"player"|"target"|"parent"|"baby"|"block"|"holder"
Defined in: entities/src/hooks.ts:218
The target named by tame_event; omitted events do not need a target.
EntityTargetProximity
Defined in: entities/src/entityInstance.ts:118
The world facts minecraft:target_nearby_sensor reads about the current target.
Properties
distance
readonlydistance:number
Defined in: entities/src/entityInstance.ts:122
Distance between the entity and its current target, in blocks.
id
readonlyid:string|number
Defined in: entities/src/entityInstance.ts:120
The target identity, which lets a sensor detect target changes.
visible
readonlyvisible:boolean
Defined in: entities/src/entityInstance.ts:124
Whether the world reports the current target as visible.
EntityType
Defined in: entities/src/entityType.ts:45
A definition resolved into a type, with its groups and its coverage report.
Extends
Properties
behaviors
readonlybehaviors: readonlyBoundBehavior<EntityHooks>[]
Defined in: content/src/types.ts:42
The behaviors that attached, in attachment order.
Inherited from
components
readonlycomponents: readonlyBoundComponent<EntityHooks>[]
Defined in: content/src/types.ts:40
The components that bound, in declaration order; a rejected one is absent.
Inherited from
declaredComponents
readonlydeclaredComponents: readonlystring[]
Defined in: entities/src/entityType.ts:55
Every component name the definition uses, base and groups, in name order.
definition
readonlydefinition:Definition
Defined in: content/src/types.ts:38
The definition the type came from.
Inherited from
entity
readonlyentity:EntityDefinition
Defined in: entities/src/entityType.ts:47
The parsed definition the type came from.
flags
readonlyflags:Readonly<Record<F,boolean>>
Defined in: content/src/types.ts:63
The flags the domain's FlagSpec computed, one pass at load.
Inherited from
groups
readonlygroups:ReadonlyMap<string,ResolvedComponentGroup>
Defined in: entities/src/entityType.ts:53
Group name to its bound components.
hooks
readonlyhooks:HookTable<EntityHooks>
Defined in: content/src/types.ts:44
The dispatch table, built once here rather than per call.
Inherited from
identifier
readonlyidentifier:string
Defined in: content/src/types.ts:36
The identifier the type is registered under.
Inherited from
tags
readonlytags: readonlystring[]
Defined in: entities/src/entityType.ts:49
Java datapack entity type tags that include this Bedrock entity identifier.
unimplementedComponents
readonlyunimplementedComponents: readonlystring[]
Defined in: entities/src/entityType.ts:57
The subset of EntityType.declaredComponents no factory implements.
Methods
hasComponent()
hasComponent(
name):boolean
Defined in: content/src/types.ts:53
Whether the type bound a component under the name.
Parameters
name
string
Returns
boolean
Inherited from
hasTag()
hasTag(
tag):boolean
Defined in: entities/src/entityType.ts:51
Whether a Java datapack entity type tag includes this entity.
Parameters
tag
string
Returns
boolean
params()
params<
P>(factory):P|undefined
Defined in: content/src/types.ts:51
The parsed parameters of one component, narrowed against the factory whose schema produced them.
Type Parameters
P
P
Parameters
factory
ComponentFactory<EntityHooks, P>
Returns
P | undefined
The parameters, or undefined when the type has no such component.
Inherited from
EntityTypesOptions
Defined in: entities/src/entityTypes.ts:31
Options for an EntityTypes table.
Properties
components?
optionalcomponents?:EntityComponentRegistry
Defined in: entities/src/entityTypes.ts:36
The component registry to resolve against. Defaults to a fresh registry holding every component this package implements.
tagLookup?
optionaltagLookup?:EntityTypeTagLookup
Defined in: entities/src/entityTypes.ts:38
Java datapack tags to attach to each loaded entity type.
EnvironmentSensorParams
Defined in: entities/src/components/sensors.ts:44
What minecraft:environment_sensor declares.
Properties
triggers
readonlytriggers: readonlySensorTrigger[]
Defined in: entities/src/components/sensors.ts:45
EquipmentChangedParams
Defined in: entities/src/components/sensors.ts:671
What minecraft:on_equipment_changed declares.
Properties
slots
readonlyslots: readonlyEquipmentChangedSlot[]
Defined in: entities/src/components/sensors.ts:673
Slot rules in source order; the first matching rule decides each change.
EquipmentChangedSlot
Defined in: entities/src/components/sensors.ts:661
One slot watched by minecraft:on_equipment_changed.
Properties
onEquip?
readonlyoptionalonEquip?:string
Defined in: entities/src/components/sensors.ts:665
Event raised when an item is placed into the slot.
onUnequip?
readonlyoptionalonUnequip?:string
Defined in: entities/src/components/sensors.ts:667
Event raised when the slot is cleared.
slot
readonlyslot:EntityEquipmentSlot
Defined in: entities/src/components/sensors.ts:663
The default equipment slot, using Bedrock's fully qualified name.
EquipmentParams
Defined in: entities/src/components/body.ts:213
What minecraft:equipment declares.
Properties
slotDropChance
readonlyslotDropChance: readonlySlotDropChance[]
Defined in: entities/src/components/body.ts:216
table?
readonlyoptionaltable?:string
Defined in: entities/src/components/body.ts:215
The loot table the entity equips from.
EvaluateFilterOptions
Defined in: entities/src/filters.ts:439
Options for evaluateFilter.
Properties
onUnanswered?
optionalonUnanswered?: (test,reason) =>void
Defined in: entities/src/filters.ts:441
Called once per test the evaluator does not implement, or whose subject the context lacks.
Parameters
test
reason
"unknownTest" | "missingSubject" | "missingFact"
Returns
void
EventAction
Defined in: entities/src/events.ts:78
An action a node asks for, with the key the file writes and the body unchanged.
EventAction.parsed is the understood form. It is undefined for a key this package does not carry out, which is what makes an unimplemented action a reported line rather than silence.
Properties
name
readonlyname:string
Defined in: entities/src/events.ts:80
The action key as the file writes it, such as play_sound.
parsed?
readonlyoptionalparsed?:EntityAction
Defined in: entities/src/events.ts:83
The parsed action, or undefined when this package does not carry the key out.
value
readonlyvalue:unknown
Defined in: entities/src/events.ts:81
EventEffects
Defined in: entities/src/eventEngine.ts:82
What one event determined, before the entity applies it on its next tick.
Properties
actions
readonlyactions: readonlyEventAction[]
Defined in: entities/src/eventEngine.ts:93
Sounds, particles, vibrations and the other actions this package keeps raw.
addGroups
readonlyaddGroups: readonlystring[]
Defined in: entities/src/eventEngine.ts:86
Component groups to add, in the order the nodes named them.
event
readonlyevent:string
Defined in: entities/src/eventEngine.ts:84
The event name the effects came from.
outgoingTriggers
readonlyoutgoingTriggers: readonlyOutgoingTrigger[]
Defined in: entities/src/eventEngine.ts:91
Events for other entities; a self trigger is already folded in.
propertyWrites
readonlypropertyWrites: readonlyResolvedPropertyWrite[]
Defined in: entities/src/eventEngine.ts:89
removeGroups
readonlyremoveGroups: readonlystring[]
Defined in: entities/src/eventEngine.ts:88
Component groups to remove, in the order the nodes named them.
unhandled
readonlyunhandled: readonlystring[]
Defined in: entities/src/eventEngine.ts:95
What the engine met and could not carry out, one line each.
EventNode
Defined in: entities/src/events.ts:93
One event node, with every branch normalized to an array.
Properties
actions
readonlyactions: readonlyEventAction[]
Defined in: entities/src/events.ts:109
Everything else the node asks for, kept raw.
add
readonlyadd: readonlystring[]
Defined in: entities/src/events.ts:97
Component groups to add, in file order.
filters?
readonlyoptionalfilters?:Filter
Defined in: entities/src/events.ts:95
Gates the whole node; absent means the node always runs.
firstValid
readonlyfirstValid: readonlyEventNode[]
Defined in: entities/src/events.ts:107
Child nodes of which the first whose filters pass runs.
randomize
readonlyrandomize: readonlyWeightedEventNode[]
Defined in: entities/src/events.ts:105
Child nodes of which exactly one runs, drawn against the weights.
remove
readonlyremove: readonlystring[]
Defined in: entities/src/events.ts:99
Component groups to remove, in file order.
sequence
readonlysequence: readonlyEventNode[]
Defined in: entities/src/events.ts:103
Child nodes run in order; a later one's filters do not see an earlier one's changes.
setProperties
readonlysetProperties: readonlyPropertyWrite[]
Defined in: entities/src/events.ts:100
triggers
readonlytriggers: readonlyEventTrigger[]
Defined in: entities/src/events.ts:101
EventRuntime
Defined in: entities/src/eventEngine.ts:110
What determineEvent reads while it walks an event tree.
Properties
context
context:
FilterContext
Defined in: entities/src/eventEngine.ts:114
The entity's filter context, read as it was before the event's changes.
properties
properties:
PropertyValues
Defined in: entities/src/eventEngine.ts:116
The entity's properties, which set_property writes and reads.
random
random:
RandomSource
Defined in: entities/src/eventEngine.ts:118
Draws the randomize weights.
Methods
evaluate()?
optionalevaluate(source):PropertyValue|undefined
Defined in: entities/src/eventEngine.ts:124
Evaluates a Molang expression for a set_property value.
Parameters
source
string
Returns
PropertyValue | undefined
The value, or undefined when the expression does not evaluate.
event()
event(
name):EventNode|undefined
Defined in: entities/src/eventEngine.ts:112
The named event of the entity's type, or undefined when it declares none.
Parameters
name
string
Returns
EventNode | undefined
EventTrigger
Defined in: entities/src/events.ts:34
One trigger entry: an event name, whom to fire it on, and an optional gate.
Properties
event
readonlyevent:string
Defined in: entities/src/events.ts:35
filters?
readonlyoptionalfilters?:Filter
Defined in: entities/src/events.ts:37
target
readonlytarget:"self"|"other"|"player"|"target"|"parent"|"baby"|"block"|"holder"
Defined in: entities/src/events.ts:36
ExperienceRewardParams
Defined in: entities/src/components/body.ts:87
What minecraft:experience_reward declares; both fields are Molang expressions.
Properties
onBred?
readonlyoptionalonBred?:string
Defined in: entities/src/components/body.ts:89
onDeath?
readonlyoptionalonDeath?:string
Defined in: entities/src/components/body.ts:88
FilterBlockView
Defined in: entities/src/filterContext.ts:138
One block, as is_block and is_waterlogged read it.
Methods
identifier()
identifier():
string
Defined in: entities/src/filterContext.ts:139
Returns
string
tags()?
optionaltags(): readonlystring[]
Defined in: entities/src/filterContext.ts:141
Returns
readonly string[]
waterlogged()?
optionalwaterlogged():boolean
Defined in: entities/src/filterContext.ts:140
Returns
boolean
FilterContext
Defined in: entities/src/filterContext.ts:227
Everything one filter evaluation can see. self is the only required subject, because it is the default a test with no subject key reads.
Properties
baby?
readonlyoptionalbaby?:FilterEntityView
Defined in: entities/src/filterContext.ts:233
block?
readonlyoptionalblock?:FilterBlockView
Defined in: entities/src/filterContext.ts:237
damager?
readonlyoptionaldamager?:FilterEntityView
Defined in: entities/src/filterContext.ts:234
holder?
readonlyoptionalholder?:FilterEntityView
Defined in: entities/src/filterContext.ts:235
item?
readonlyoptionalitem?:FilterItemView
Defined in: entities/src/filterContext.ts:236
other?
readonlyoptionalother?:FilterEntityView
Defined in: entities/src/filterContext.ts:229
parent?
readonlyoptionalparent?:FilterEntityView
Defined in: entities/src/filterContext.ts:232
player?
readonlyoptionalplayer?:FilterEntityView
Defined in: entities/src/filterContext.ts:230
random?
readonlyoptionalrandom?:RandomSource
Defined in: entities/src/filterContext.ts:239
self
readonlyself:FilterEntityView
Defined in: entities/src/filterContext.ts:228
target?
readonlyoptionaltarget?:FilterEntityView
Defined in: entities/src/filterContext.ts:231
world?
readonlyoptionalworld?:FilterWorldView
Defined in: entities/src/filterContext.ts:238
FilterEntityView
Defined in: entities/src/filterContext.ts:161
One entity a filter test can read, whether it is the subject or a related entity the context reaches through FilterEntityView.vehicle and its siblings.
The position-dependent tests (light_level, is_biome, is_underground and the rest) are answered here because the engine evaluates them at the subject's position.
Methods
attackTarget()?
optionalattackTarget():FilterEntityView|undefined
Defined in: entities/src/filterContext.ts:187
This entity's current attack target, for is_target.
Returns
FilterEntityView | undefined
carries()?
optionalcarries(matches):boolean|undefined
Defined in: entities/src/filterContext.ts:181
Whether the entity carries any item answering the predicate, for the item tests.
Parameters
matches
(item) => boolean
Returns
boolean | undefined
equipment()?
optionalequipment(slot,index):FilterItemView|undefined
Defined in: entities/src/filterContext.ts:177
The item in one slot of a container, or undefined when the slot is empty.
Parameters
slot
"any" | "head" | "inventory" | "armor" | "feet" | "hand" | "leg" | "main_hand" | "off_hand" | "torso"
index
number
Returns
FilterItemView | undefined
flag()?
optionalflag(name):boolean|undefined
Defined in: entities/src/filterContext.ts:165
A boolean fact, named by the filter test that reads it.
Parameters
name
"is_baby" | "has_container_open" | "has_nametag" | "has_ranged_weapon" | "has_silk_touch" | "has_target" | "has_trade_supply" | "in_caravan" | "in_clouds" | "in_contact_with_water" | "in_lava" | "in_water" | "in_water_or_rain" | "is_avoiding_mobs" | "is_bound_to_creaking_heart" | "is_climbing" | "is_humid" | "is_immobile" | "is_in_village" | "is_leashed" | "is_missing_health" | "is_moving" | "is_navigating" | "is_panicking" | "is_persistent" | "is_raider" | "is_riding" | "is_sitting" | "is_sleeping" | "is_sneak_held" | "is_sneaking" | "is_snow_covered" | "is_sprinting" | "is_tamed" | "is_underground" | "is_underwater" | "is_visible" | "on_fire" | "on_ground" | "on_hot_block" | "on_ladder" | "surface_mob" | "taking_fire_damage"
Returns
boolean | undefined
hasComponent()?
optionalhasComponent(name):boolean
Defined in: entities/src/filterContext.ts:175
Whether the named component is active on the entity now.
Parameters
name
string
Returns
boolean
hasProperty()?
optionalhasProperty(name):boolean
Defined in: entities/src/filterContext.ts:173
Whether the entity declares the named property at all.
Parameters
name
string
Returns
boolean
id()?
optionalid():string|number
Defined in: entities/src/filterContext.ts:163
A stable identity, so the tests that compare two subjects can tell them apart.
Returns
string | number
leashHolder()?
optionalleashHolder():FilterEntityView|undefined
Defined in: entities/src/filterContext.ts:189
The entity holding this one's leash, for is_leashed_to.
Returns
FilterEntityView | undefined
measure()?
optionalmeasure(name):number|undefined
Defined in: entities/src/filterContext.ts:167
A numeric fact, named by the filter test that reads it.
Parameters
name
"actor_health" | "distance_to_nearest_player" | "home_distance" | "inactivity_timer" | "is_altitude" | "is_brightness" | "is_mark_variant" | "is_skin_id" | "is_temperature_value" | "is_variant" | "light_level" | "owner_distance" | "redstone_strength_at_position" | "rider_count" | "target_distance" | "y_rotation"
Returns
number | undefined
names()?
optionalnames(name): readonlystring[] |undefined
Defined in: entities/src/filterContext.ts:169
A set of names, such as the type families is_family compares against.
Parameters
name
"is_family" | "has_biome_tag" | "has_ability" | "has_damage" | "has_mob_effect" | "has_tag" | "in_block" | "is_biome" | "is_color" | "is_controlling_passenger_family" | "is_temperature_type" | "was_last_hurt_by" | "weather_at_position"
Returns
readonly string[] | undefined
owner()?
optionalowner():FilterEntityView|undefined
Defined in: entities/src/filterContext.ts:185
The entity that owns this one, for is_owner.
Returns
FilterEntityView | undefined
property()?
optionalproperty(name):PropertyValue|undefined
Defined in: entities/src/filterContext.ts:171
The current value of one entity property.
Parameters
name
string
Returns
PropertyValue | undefined
slotFill()?
optionalslotFill(slot):SlotFill|undefined
Defined in: entities/src/filterContext.ts:179
How full a container is, for all_slots_empty and any_slot_empty.
Parameters
slot
"any" | "head" | "inventory" | "armor" | "feet" | "hand" | "leg" | "main_hand" | "off_hand" | "torso"
Returns
SlotFill | undefined
trusts()?
optionaltrusts(other):boolean|undefined
Defined in: entities/src/filterContext.ts:191
Whether this entity trusts the other one.
Parameters
other
Returns
boolean | undefined
vehicle()?
optionalvehicle():FilterEntityView|undefined
Defined in: entities/src/filterContext.ts:183
The entity this one is riding.
Returns
FilterEntityView | undefined
FilterItemView
Defined in: entities/src/filterContext.ts:123
One item stack, as the equipment and item tests read it.
Methods
damaged()?
optionaldamaged():boolean
Defined in: entities/src/filterContext.ts:134
Whether the stack has lost durability.
Returns
boolean
data()?
optionaldata():number
Defined in: entities/src/filterContext.ts:127
The auxiliary value has_equipment compares after the : in its value.
Returns
number
enchantment()?
optionalenchantment(name):number
Defined in: entities/src/filterContext.ts:130
The level of the named enchantment, or 0 when the item does not carry it.
Parameters
name
string
Returns
number
hasComponent()?
optionalhasComponent(name):boolean
Defined in: entities/src/filterContext.ts:132
Whether the stack carries the named item component.
Parameters
name
string
Returns
boolean
identifier()
identifier():
string
Defined in: entities/src/filterContext.ts:125
The item identifier, such as minecraft:bucket.
Returns
string
tags()?
optionaltags(): readonlystring[]
Defined in: entities/src/filterContext.ts:128
Returns
readonly string[]
FilterWorldView
Defined in: entities/src/filterContext.ts:195
The world facts the time, weather, difficulty and game rule tests read.
Methods
difficulty()?
optionaldifficulty():string
Defined in: entities/src/filterContext.ts:199
The difficulty name, one of peaceful, easy, normal or hard.
Returns
string
dimension()?
optionaldimension():string
Defined in: entities/src/filterContext.ts:201
The dimension identifier, for in_nether and in_overworld.
Returns
string
gameRule()?
optionalgameRule(name):number|boolean|undefined
Defined in: entities/src/filterContext.ts:203
A game rule's value, for is_game_rule.
Parameters
name
string
Returns
number | boolean | undefined
moonIntensity()?
optionalmoonIntensity():number
Defined in: entities/src/filterContext.ts:207
The moon's brightness, in [0, 1].
Returns
number
moonPhase()?
optionalmoonPhase():number
Defined in: entities/src/filterContext.ts:205
The moon phase, 0 to 7.
Returns
number
timeOfDay()?
optionaltimeOfDay():number
Defined in: entities/src/filterContext.ts:197
Time of day in ticks, in [0, 24000).
Returns
number
weather()?
optionalweather():string
Defined in: entities/src/filterContext.ts:209
The current weather name, one of clear, precipitation, rain or thunder.
Returns
string
FloatParams
Defined in: entities/src/goals/reference.ts:18
What minecraft:behavior.float declares.
Properties
chancePerTickToFloat
readonlychancePerTickToFloat:number
Defined in: entities/src/goals/reference.ts:20
The chance per tick of swimming up while in a liquid, in [0, 1].
Goal
Defined in: entities/src/goals.ts:32
One goal running on one entity.
The scheduler calls canStart on a goal that is not running and canContinue on one that is, so a goal that stops under the same condition it starts under implements only canStart.
Methods
canContinue()?
optionalcanContinue():boolean
Defined in: entities/src/goals.ts:36
Whether a running goal keeps its control flags; defaults to Goal.canStart.
Returns
boolean
canStart()
canStart():
boolean
Defined in: entities/src/goals.ts:34
Whether the goal is ready to take its control flags.
Returns
boolean
requiresUpdateEveryTick()?
optionalrequiresUpdateEveryTick():boolean
Defined in: entities/src/goals.ts:44
Whether Java ticks this goal on selector gaps as well as selector ticks.
Returns
boolean
start()?
optionalstart():void
Defined in: entities/src/goals.ts:38
Runs once when the goal takes its control flags.
Returns
void
stop()?
optionalstop():void
Defined in: entities/src/goals.ts:40
Runs once when the goal gives its control flags up, whether it finished or was preempted.
Returns
void
tick()?
optionaltick():void
Defined in: entities/src/goals.ts:42
Runs once per tick while the goal holds its control flags.
Returns
void
GoalFactory
Defined in: entities/src/goals.ts:64
One goal implementation, which is what a later agent writes per minecraft:behavior.* name.
Type Parameters
P
P
Properties
controlFlags
readonlycontrolFlags: readonly ("move"|"look"|"jump")[]
Defined in: entities/src/goals.ts:68
The control flags the goal holds when the definition names none.
name
readonlyname:string
Defined in: entities/src/goals.ts:66
The component name, such as minecraft:behavior.random_stroll.
schema
readonlyschema:ComponentSchema<P>
Defined in: entities/src/goals.ts:70
Parses the goal's own parameters; priority and control_flags are handled here.
Methods
create()
create(
params,entity):Goal
Defined in: entities/src/goals.ts:75
Builds the goal for one entity. It runs when the component initializes, so a re-added component group builds a fresh goal with fresh state.
Parameters
params
P
entity
Returns
GoalParams
Defined in: entities/src/goals.ts:56
A goal component's parsed value: the shared settings plus the goal's own parameters.
Extends
Type Parameters
P
P
Properties
controlFlags
readonlycontrolFlags: readonly ("move"|"look"|"jump")[]
Defined in: entities/src/goals.ts:52
The control flags the goal holds while it runs.
Inherited from
params
readonlyparams:P
Defined in: entities/src/goals.ts:57
priority
readonlypriority:number
Defined in: entities/src/goals.ts:50
0 is the highest priority; a lower number preempts a higher one.
Inherited from
GoalSettings
Defined in: entities/src/goals.ts:48
The two fields every minecraft:behavior.* component carries.
Extended by
Properties
controlFlags
readonlycontrolFlags: readonly ("move"|"look"|"jump")[]
Defined in: entities/src/goals.ts:52
The control flags the goal holds while it runs.
priority
readonlypriority:number
Defined in: entities/src/goals.ts:50
0 is the highest priority; a lower number preempts a higher one.
HealableEffectParams
Defined in: entities/src/components/interactions.ts:580
One status effect a minecraft:healable item may apply.
Properties
amplifier
readonlyamplifier:number
Defined in: entities/src/components/interactions.ts:586
One below the displayed potency.
chance
readonlychance:number
Defined in: entities/src/components/interactions.ts:588
The chance in [0, 1] that this effect is applied.
duration
readonlyduration:number|"infinite"
Defined in: entities/src/components/interactions.ts:584
Duration in seconds, or infinite for an effect that never expires.
name
readonlyname:string
Defined in: entities/src/components/interactions.ts:582
The Bedrock status effect name.
HealableItemParams
Defined in: entities/src/components/interactions.ts:592
One item minecraft:healable accepts.
Properties
effects
readonlyeffects: readonlyHealableEffectParams[]
Defined in: entities/src/components/interactions.ts:600
Status effects applied when the item is accepted.
healAmount
readonlyhealAmount:number
Defined in: entities/src/components/interactions.ts:596
Health restored when the entity accepts the item.
item
readonlyitem:string
Defined in: entities/src/components/interactions.ts:594
The item identifier, normalized to the default Minecraft namespace.
resultItem?
readonlyoptionalresultItem?:string
Defined in: entities/src/components/interactions.ts:598
Item replacing the consumed item, if the definition names one.
HealableParams
Defined in: entities/src/components/interactions.ts:604
What minecraft:healable declares.
Properties
filters?
readonlyoptionalfilters?:Filter
Defined in: entities/src/components/interactions.ts:608
Conditions required before a matching item can be used.
forceUse
readonlyforceUse:boolean
Defined in: entities/src/components/interactions.ts:610
Whether a matching item is accepted at full health.
items
readonlyitems: readonlyHealableItemParams[]
Defined in: entities/src/components/interactions.ts:606
Items that can be used to heal the entity.
HurtOnConditionParams
Defined in: entities/src/components/hazards.ts:34
What minecraft:hurt_on_condition declares.
Properties
conditions
readonlyconditions: readonlyDamageCondition[]
Defined in: entities/src/components/hazards.ts:35
IgnoreCannotBeAttackedParams
Defined in: entities/src/components/combat.ts:232
What minecraft:ignore_cannot_be_attacked declares.
Properties
filters
readonlyfilters:Filter|undefined
Defined in: entities/src/components/combat.ts:234
Targets this entity may attack despite their minecraft:cannot_be_attacked component.
InsideBlockNotifierEntry
Defined in: entities/src/components/sensors.ts:332
One block state and its enter and exit events in minecraft:inside_block_notifier.
Properties
blockName
readonlyblockName:string
Defined in: entities/src/components/sensors.ts:334
The block identifier to watch.
enteredBlockEvent?
readonlyoptionalenteredBlockEvent?:SensorTrigger
Defined in: entities/src/components/sensors.ts:338
Event raised when the entity enters a matching block.
exitedBlockEvent?
readonlyoptionalexitedBlockEvent?:SensorTrigger
Defined in: entities/src/components/sensors.ts:340
Event raised when the entity leaves a matching block.
states
readonlystates:Readonly<Record<string,boolean>>
Defined in: entities/src/components/sensors.ts:336
Boolean block states that must match; omitted states accept every state.
InsideBlockNotifierParams
Defined in: entities/src/components/sensors.ts:344
What minecraft:inside_block_notifier declares.
Properties
blockList
readonlyblockList: readonlyInsideBlockNotifierEntry[]
Defined in: entities/src/components/sensors.ts:345
InteractParams
Defined in: entities/src/components/interactions.ts:114
What minecraft:interact declares.
Properties
interactions
readonlyinteractions: readonlyInteractEntry[]
Defined in: entities/src/components/interactions.ts:116
Ordered interactions; the first matching entry with a supported effect wins.
InventoryParams
Defined in: entities/src/components/body.ts:146
What minecraft:inventory declares.
Properties
additionalSlotsPerStrength
readonlyadditionalSlotsPerStrength:number
Defined in: entities/src/components/body.ts:151
canBeSiphonedFrom
readonlycanBeSiphonedFrom:boolean
Defined in: entities/src/components/body.ts:152
containerType
readonlycontainerType:string
Defined in: entities/src/components/body.ts:147
inventorySize
readonlyinventorySize:number
Defined in: entities/src/components/body.ts:148
isPrivate
readonlyisPrivate:boolean
Defined in: entities/src/components/body.ts:149
restrictToOwner
readonlyrestrictToOwner:boolean
Defined in: entities/src/components/body.ts:150
JavaEntityNavigation
Defined in: entities/src/javaNavigation.ts:4
Java's navigation, path costs, and pushability, read after the entity registers its goals.
Properties
canFloat
readonlycanFloat:boolean
Defined in: entities/src/javaNavigation.ts:8
Whether Java's goal registrations enabled floating through liquid.
canNavigateGround
readonlycanNavigateGround:boolean
Defined in: entities/src/javaNavigation.ts:10
Whether the navigator can follow paths on solid ground.
navigationClass
readonlynavigationClass:string
Defined in: entities/src/javaNavigation.ts:6
The Java class that owns the entity's path navigation.
pathfindingMalus
readonlypathfindingMalus:Readonly<Record<string,number>>
Defined in: entities/src/javaNavigation.ts:14
Java's per-path-type cost, with negative values marking blocked terrain.
pushable
readonlypushable:boolean
Defined in: entities/src/javaNavigation.ts:12
Whether Java lets this living entity push and be pushed by other entities.
JavaEntityStats
Defined in: entities/src/javaStats.ts:211
One Java entity type's hitbox and the attributes its class declares.
Properties
attributes
readonlyattributes:Readonly<Record<string,number>>
Defined in: entities/src/javaStats.ts:217
Java attribute id to its base value, such as minecraft:max_health.
height
readonlyheight:number
Defined in: entities/src/javaStats.ts:215
The hitbox height in blocks.
width
readonlywidth:number
Defined in: entities/src/javaStats.ts:213
The hitbox width in blocks.
JavaStatException
Defined in: entities/src/javaStats.ts:106
One entity and stat that keeps Bedrock's value inside a Java-decided stat.
Properties
identifier
readonlyidentifier:string
Defined in: entities/src/javaStats.ts:108
The entity identifier, such as minecraft:wither.
reason
readonlyreason:string
Defined in: entities/src/javaStats.ts:111
Why Java's dumped number is not Java's behavior for this entity.
stat
readonlystat:SharedStat
Defined in: entities/src/javaStats.ts:109
JumpParams
Defined in: entities/src/components/movement.ts:95
What minecraft:jump.static declares.
Properties
jumpPower
readonlyjumpPower:number
Defined in: entities/src/components/movement.ts:96
LookAtPlayerParams
Defined in: entities/src/goals/reference.ts:101
What minecraft:behavior.look_at_player declares.
Properties
lookDistance
readonlylookDistance:number
Defined in: entities/src/goals/reference.ts:103
How far the entity notices a player, in blocks.
lookTime
readonlylookTime: readonly [number,number]
Defined in: entities/src/goals/reference.ts:107
How long one look lasts, in seconds, as a [min, max] pair.
probability
readonlyprobability:number
Defined in: entities/src/goals/reference.ts:105
The chance per tick of starting to look, in [0, 1].
LootParams
Defined in: entities/src/components/body.ts:72
What minecraft:loot declares.
Properties
table?
readonlyoptionaltable?:string
Defined in: entities/src/components/body.ts:74
The pack-relative path of the loot table, such as loot_tables/entities/zombie.json.
MobEffectParams
Defined in: entities/src/components/effects.ts:15
What minecraft:mob_effect declares.
Properties
ambient
readonlyambient:boolean
Defined in: entities/src/components/effects.ts:27
Whether the applied effect uses the ambient visual style.
cooldownTicks
readonlycooldownTicks:number
Defined in: entities/src/components/effects.ts:23
Ticks to wait between applications after one or more targets accept it.
durationTicks
readonlydurationTicks:number
Defined in: entities/src/components/effects.ts:19
The effect duration, or -1 when it never expires.
effect
readonlyeffect:string
Defined in: entities/src/components/effects.ts:17
The effect applied to matching entities.
effectRange
readonlyeffectRange:number
Defined in: entities/src/components/effects.ts:21
Distance to search in the horizontal and vertical axes.
entityFilter?
readonlyoptionalentityFilter?:Filter
Defined in: entities/src/components/effects.ts:25
Optional filter evaluated with the source as self and each candidate as other.
MovementModeParams
Defined in: entities/src/components/movement.ts:73
What a minecraft:movement.* component declares.
Properties
kind
readonlykind:string
Defined in: entities/src/components/movement.ts:75
The movement flavor, such as basic or sway.
maxTurn
readonlymaxTurn:number
Defined in: entities/src/components/movement.ts:77
The most degrees the entity turns per tick.
NameableParams
Defined in: entities/src/components/nameable.ts:21
What minecraft:nameable declares.
Properties
allowNameTagRenaming
readonlyallowNameTagRenaming:boolean
Defined in: entities/src/components/nameable.ts:23
Whether a name tag may change the custom name; defaults to true.
alwaysShow
readonlyalwaysShow:boolean
Defined in: entities/src/components/nameable.ts:25
Whether the client always displays the custom name; defaults to false.
defaultTrigger?
readonlyoptionaldefaultTrigger?:NameableTrigger
Defined in: entities/src/components/nameable.ts:27
The event raised whenever a name tag names the entity.
nameActions
readonlynameActions: readonlyobject[]
Defined in: entities/src/components/nameable.ts:29
Name-specific events raised when the assigned name matches.
NameableTrigger
Defined in: entities/src/components/nameable.ts:11
One event a nameable entity raises when a name tag assigns a matching name.
Properties
event
readonlyevent:string
Defined in: entities/src/components/nameable.ts:13
The event name.
filters?
readonlyoptionalfilters?:Filter
Defined in: entities/src/components/nameable.ts:17
The filter that must pass before the event is raised.
target
readonlytarget:"self"|"other"|"player"|"target"|"parent"|"baby"|"block"|"holder"
Defined in: entities/src/components/nameable.ts:15
The entity subject that receives the event.
NavigationParams
Defined in: entities/src/components/movement.ts:9
What minecraft:navigation.* declares; every field is a capability of the path finder.
Properties
avoidDamageBlocks
readonlyavoidDamageBlocks:boolean
Defined in: entities/src/components/movement.ts:31
avoidPortals
readonlyavoidPortals:boolean
Defined in: entities/src/components/movement.ts:30
avoidSun
readonlyavoidSun:boolean
Defined in: entities/src/components/movement.ts:29
avoidWater
readonlyavoidWater:boolean
Defined in: entities/src/components/movement.ts:28
blocksToAvoid
readonlyblocksToAvoid: readonlyunknown[]
Defined in: entities/src/components/movement.ts:34
Block names and tags the path finder treats as impassable.
canBreach
readonlycanBreach:boolean
Defined in: entities/src/components/movement.ts:21
canBreakDoors
readonlycanBreakDoors:boolean
Defined in: entities/src/components/movement.ts:26
canFloat
readonlycanFloat:boolean
Defined in: entities/src/components/movement.ts:15
canFly
readonlycanFly:boolean
Defined in: entities/src/components/movement.ts:20
canJump
readonlycanJump:boolean
Defined in: entities/src/components/movement.ts:22
canOpenDoors
readonlycanOpenDoors:boolean
Defined in: entities/src/components/movement.ts:23
canOpenIronDoors
readonlycanOpenIronDoors:boolean
Defined in: entities/src/components/movement.ts:24
canPassDoors
readonlycanPassDoors:boolean
Defined in: entities/src/components/movement.ts:25
canPathFromAir
readonlycanPathFromAir:boolean
Defined in: entities/src/components/movement.ts:14
canPathOverLava
readonlycanPathOverLava:boolean
Defined in: entities/src/components/movement.ts:13
canPathOverWater
readonlycanPathOverWater:boolean
Defined in: entities/src/components/movement.ts:12
canSink
readonlycanSink:boolean
Defined in: entities/src/components/movement.ts:16
canSwim
readonlycanSwim:boolean
Defined in: entities/src/components/movement.ts:17
canWalk
readonlycanWalk:boolean
Defined in: entities/src/components/movement.ts:18
canWalkInLava
readonlycanWalkInLava:boolean
Defined in: entities/src/components/movement.ts:19
isAmphibious
readonlyisAmphibious:boolean
Defined in: entities/src/components/movement.ts:32
kind
readonlykind:string
Defined in: entities/src/components/movement.ts:11
The navigation flavor, such as walk or generic.
usingDoorAnnotation
readonlyusingDoorAnnotation:boolean
Defined in: entities/src/components/movement.ts:27
OutgoingTrigger
Defined in: entities/src/eventEngine.ts:76
One event to fire on another entity, which the caller routes.
Properties
event
readonlyevent:string
Defined in: entities/src/eventEngine.ts:77
target
readonlytarget:"other"|"player"|"target"|"parent"|"baby"|"block"|"holder"
Defined in: entities/src/eventEngine.ts:78
ParseEntityResult
Defined in: entities/src/definition.ts:96
What parseEntityDefinition returns.
Properties
definition?
optionaldefinition?:EntityDefinition
Defined in: entities/src/definition.ts:98
The parsed definition, or undefined when the file has no usable entity body.
diagnostics
diagnostics: readonly
Diagnostic[]
Defined in: entities/src/definition.ts:99
PhysicsParams
Defined in: entities/src/components/body.ts:104
What minecraft:physics declares.
Properties
hasCollision
readonlyhasCollision:boolean
Defined in: entities/src/components/body.ts:106
hasGravity
readonlyhasGravity:boolean
Defined in: entities/src/components/body.ts:105
pushTowardsClosestSpace
readonlypushTowardsClosestSpace:boolean
Defined in: entities/src/components/body.ts:107
PropertyDefinition
Defined in: entities/src/properties.ts:28
One declared property, after its type, range or value list is validated.
Properties
clientSync
readonlyclientSync:boolean
Defined in: entities/src/properties.ts:33
Sent to clients for render and animation controllers when true.
default
readonlydefault:PropertyDefault
Defined in: entities/src/properties.ts:31
name
readonlyname:string
Defined in: entities/src/properties.ts:29
range?
readonlyoptionalrange?: readonly [number,number]
Defined in: entities/src/properties.ts:35
The inclusive bounds of an int or float property; writes clamp into it.
type
readonlytype:"int"|"float"|"bool"|"enum"
Defined in: entities/src/properties.ts:30
values?
readonlyoptionalvalues?: readonlystring[]
Defined in: entities/src/properties.ts:37
The members of an enum property, in declaration order.
PropertyWrite
Defined in: entities/src/events.ts:28
One set_property write.
Properties
name
readonlyname:string
Defined in: entities/src/events.ts:29
value
readonlyvalue:EventValue
Defined in: entities/src/events.ts:30
PushableParams
Defined in: entities/src/components/body.ts:126
What minecraft:pushable declares.
Properties
isPushable
readonlyisPushable:boolean
Defined in: entities/src/components/body.ts:127
isPushableByPiston
readonlyisPushableByPiston:boolean
Defined in: entities/src/components/body.ts:128
RandomSource
Defined in: entities/src/filterContext.ts:213
Draws the random numbers random_chance and the event engine's randomize need.
Methods
next()
next():
number
Defined in: entities/src/filterContext.ts:215
The next value in [0, 1).
Returns
number
nextInt()?
optionalnextInt(bound):number
Defined in: entities/src/filterContext.ts:217
The next integer in [0, bound), when the source can draw it directly.
Parameters
bound
number
Returns
number
RandomStrollParams
Defined in: entities/src/goals/reference.ts:48
What minecraft:behavior.random_stroll declares.
Properties
interval
readonlyinterval:number
Defined in: entities/src/goals/reference.ts:53
One in this many ticks, the goal looks for somewhere to walk.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: entities/src/goals/reference.ts:49
xzDistance
readonlyxzDistance:number
Defined in: entities/src/goals/reference.ts:50
yDistance
readonlyyDistance:number
Defined in: entities/src/goals/reference.ts:51
RandomTeleportCube
Defined in: entities/src/components/teleport.ts:12
The half-widths of the area from which a teleport destination is drawn.
Properties
x
readonlyx:number
Defined in: entities/src/components/teleport.ts:13
y
readonlyy:number
Defined in: entities/src/components/teleport.ts:14
z
readonlyz:number
Defined in: entities/src/components/teleport.ts:15
ResolveEntityOptions
Defined in: entities/src/entityType.ts:70
Options for resolveEntityTypes.
Properties
behaviors?
optionalbehaviors?:BehaviorRegistry<EntityHooks>
Defined in: entities/src/entityType.ts:74
Behaviors the server and its plugins attach by identifier.
components
components:
EntityComponentRegistry
Defined in: entities/src/entityType.ts:72
The component names this domain implements.
strict?
optionalstrict?:boolean
Defined in: entities/src/entityType.ts:78
Fail the resolve when any diagnostic is reported.
tagLookup?
optionaltagLookup?:EntityTypeTagLookup
Defined in: entities/src/entityType.ts:76
Java datapack tags, mapped to the Bedrock identifier for each type.
ResolveEntityResult
Defined in: entities/src/entityType.ts:82
What resolveEntityTypes returns.
Properties
diagnostics
diagnostics: readonly
Diagnostic[]
Defined in: entities/src/entityType.ts:85
types
types:
ReadonlyMap<string,EntityType>
Defined in: entities/src/entityType.ts:84
Identifier to type, in input order, ready for Registry.rebuild.
ResolvedComponentGroup
Defined in: entities/src/entityType.ts:38
One component group, bound once at load.
Properties
components
readonlycomponents: readonlyBoundComponent<EntityHooks>[]
Defined in: entities/src/entityType.ts:41
The components that bound, in declaration order; a rejected one is absent.
name
readonlyname:string
Defined in: entities/src/entityType.ts:39
ResolvedPropertyWrite
Defined in: entities/src/eventEngine.ts:70
One property write an event determined, with its value already resolved.
Properties
name
readonlyname:string
Defined in: entities/src/eventEngine.ts:71
value
readonlyvalue:PropertyValue
Defined in: entities/src/eventEngine.ts:72
RideableParams
Defined in: entities/src/riding.ts:24
What minecraft:rideable declares.
Properties
crouchingSkipInteract
readonlycrouchingSkipInteract:boolean
Defined in: entities/src/riding.ts:32
familyTypes
readonlyfamilyTypes: readonlystring[]
Defined in: entities/src/riding.ts:30
The type families allowed to ride; empty means any.
interactText?
readonlyoptionalinteractText?:string
Defined in: entities/src/riding.ts:31
onRiderEnterEvent?
readonlyoptionalonRiderEnterEvent?:string
Defined in: entities/src/riding.ts:35
Fired on the vehicle when a rider takes a seat.
onRiderExitEvent?
readonlyoptionalonRiderExitEvent?:string
Defined in: entities/src/riding.ts:37
Fired on the vehicle when a rider leaves.
pullInEntities
readonlypullInEntities:boolean
Defined in: entities/src/riding.ts:33
seatCount
readonlyseatCount:number
Defined in: entities/src/riding.ts:26
How many riders fit, which is what caps the seats.
seats
readonlyseats: readonlyRideableSeat[]
Defined in: entities/src/riding.ts:28
Written as one object in 50 vanilla instances and an array in 17.
RideableSeat
Defined in: entities/src/riding.ts:11
One seat of minecraft:rideable.
Properties
lockRiderRotation
readonlylockRiderRotation:number
Defined in: entities/src/riding.ts:18
How far the rider may turn from the seat's facing, in degrees.
maxRiderCount
readonlymaxRiderCount:number
Defined in: entities/src/riding.ts:16
minRiderCount
readonlyminRiderCount:number
Defined in: entities/src/riding.ts:15
The rider count at which this seat starts being used.
position
readonlyposition: readonly [number,number,number]
Defined in: entities/src/riding.ts:13
Where the rider sits, relative to the vehicle, in blocks.
rotateRiderBy?
readonlyoptionalrotateRiderBy?:string|number
Defined in: entities/src/riding.ts:20
A literal angle or a Molang expression, which the boat writes.
ScheduledGoal
Defined in: entities/src/goals.ts:116
One goal registered with a scheduler.
Extends
Properties
controlFlags
readonlycontrolFlags: readonly ("move"|"look"|"jump")[]
Defined in: entities/src/goals.ts:52
The control flags the goal holds while it runs.
Inherited from
goal
readonlygoal:Goal
Defined in: entities/src/goals.ts:119
name
readonlyname:string
Defined in: entities/src/goals.ts:118
The component name the goal was declared under.
priority
readonlypriority:number
Defined in: entities/src/goals.ts:50
0 is the highest priority; a lower number preempts a higher one.
Inherited from
SensorTrigger
Defined in: entities/src/components/shared.ts:29
One {filters, event, target} trigger, which five component bodies share.
Properties
event?
readonlyoptionalevent?:string
Defined in: entities/src/components/shared.ts:31
filters?
readonlyoptionalfilters?:Filter
Defined in: entities/src/components/shared.ts:30
target
readonlytarget:"self"|"other"|"player"|"target"|"parent"|"baby"|"block"|"holder"
Defined in: entities/src/components/shared.ts:32
ShareableItemParams
Defined in: entities/src/components/shareables.ts:8
One item name or tag and the pickup and sharing rules attached to it.
Properties
admire
readonlyadmire:boolean
Defined in: entities/src/components/shareables.ts:21
barter
readonlybarter:boolean
Defined in: entities/src/components/shareables.ts:22
consumeItem
readonlyconsumeItem:boolean
Defined in: entities/src/components/shareables.ts:23
craftInto
readonlycraftInto:string|undefined
Defined in: entities/src/components/shareables.ts:26
items
readonlyitems: readonlystring[]
Defined in: entities/src/components/shareables.ts:10
Names or Bedrock item tags that match this rule.
maxAmount
readonlymaxAmount:number
Defined in: entities/src/components/shareables.ts:14
Maximum matching items the entity keeps, or -1 for no limit.
pickupLimit
readonlypickupLimit:number
Defined in: entities/src/components/shareables.ts:16
Maximum matching items taken in one pickup.
pickupOnly
readonlypickupOnly:boolean
Defined in: entities/src/components/shareables.ts:24
priority
readonlypriority:number
Defined in: entities/src/components/shareables.ts:12
Lower values win when the entity chooses among dropped items.
storedInInventory
readonlystoredInInventory:boolean
Defined in: entities/src/components/shareables.ts:25
surplusAmount
readonlysurplusAmount:number
Defined in: entities/src/components/shareables.ts:18
The amount considered surplus when the entity shares items.
wantAmount
readonlywantAmount:number
Defined in: entities/src/components/shareables.ts:20
The amount the entity wants when sharing items.
ShareablesParams
Defined in: entities/src/components/shareables.ts:30
The item rules and fallback settings declared by minecraft:shareables.
Properties
allItems
readonlyallItems:boolean
Defined in: entities/src/components/shareables.ts:32
Whether unmatched items are accepted as the lowest priority group.
allItemsMaxAmount
readonlyallItemsMaxAmount:number
Defined in: entities/src/components/shareables.ts:33
allItemsSurplusAmount
readonlyallItemsSurplusAmount:number
Defined in: entities/src/components/shareables.ts:34
allItemsWantAmount
readonlyallItemsWantAmount:number
Defined in: entities/src/components/shareables.ts:35
items
readonlyitems: readonlyShareableItemParams[]
Defined in: entities/src/components/shareables.ts:37
Rules in source order; the first matching rule shadows later matches.
singularPickup
readonlysingularPickup:boolean
Defined in: entities/src/components/shareables.ts:39
Whether the entity may pick up another stack of an item it already holds.
SlotDropChance
Defined in: entities/src/components/body.ts:207
One entry of minecraft:equipment.slot_drop_chance.
Properties
dropChance
readonlydropChance:number
Defined in: entities/src/components/body.ts:209
slot
readonlyslot:string
Defined in: entities/src/components/body.ts:208
SlotFill
Defined in: entities/src/filterContext.ts:145
How full one equipment container is.
Properties
capacity
readonlycapacity:number
Defined in: entities/src/filterContext.ts:149
How many slots the container has.
filled
readonlyfilled:number
Defined in: entities/src/filterContext.ts:147
How many slots of the container hold an item.
SpawnEntityParams
Defined in: entities/src/components/lifecycle.ts:186
What minecraft:spawn_entity declares.
Properties
entries
readonlyentries: readonlySpawnEntityEntry[]
Defined in: entities/src/components/lifecycle.ts:187
SpellEffectParams
Defined in: entities/src/components/effects.ts:31
The accepted status-effect request produced by minecraft:spell_effects.
Extends
Properties
ambient?
readonlyoptionalambient?:boolean
Defined in: entities/src/hooks.ts:243
Whether the effect has the ambient visual style.
Inherited from
amplifier
readonlyamplifier:number
Defined in: entities/src/hooks.ts:241
One below the displayed potency.
Inherited from
durationTicks
readonlydurationTicks:number
Defined in: entities/src/hooks.ts:239
Ticks remaining, or -1 for an effect that never expires.
Inherited from
EntityStatusEffect.durationTicks
id
readonlyid:string
Defined in: entities/src/hooks.ts:237
The Bedrock status effect name.
Inherited from
showIcon?
readonlyoptionalshowIcon?:boolean
Defined in: entities/src/hooks.ts:247
Whether the effect has a HUD icon.
Inherited from
showParticles?
readonlyoptionalshowParticles?:boolean
Defined in: entities/src/hooks.ts:245
Whether the effect draws particles.
Inherited from
EntityStatusEffect.showParticles
visible
readonlyvisible:boolean
Defined in: entities/src/components/effects.ts:33
Whether the target displays the effect's particles and HUD icon.
SpellEffectsParams
Defined in: entities/src/components/effects.ts:37
What minecraft:spell_effects declares.
Properties
addEffects
readonlyaddEffects: readonlySpellEffectParams[]
Defined in: entities/src/components/effects.ts:38
removeEffects
readonlyremoveEffects: readonlystring[]
Defined in: entities/src/components/effects.ts:39
StatAuthority
Defined in: entities/src/javaStats.ts:31
Which edition decides one shared stat.
Properties
attribute?
readonlyoptionalattribute?:"absorption"|"attack_damage"|"flying_speed"|"follow_range"|"health"|"jump_strength"|"knockback_resistance"|"lava_movement"|"luck"|"movement"|"underwater_movement"
Defined in: entities/src/javaStats.ts:35
The attribute the stat lands on, absent for the two hitbox stats.
decidedBy
readonlydecidedBy:"bedrock"|"java"
Defined in: entities/src/javaStats.ts:33
The edition whose value the server runs with.
javaAttribute?
readonlyoptionaljavaAttribute?:string
Defined in: entities/src/javaStats.ts:37
The key the Java attribute dump holds it under, absent for the two hitbox stats.
reason
readonlyreason:string
Defined in: entities/src/javaStats.ts:39
Why that edition decides it.
StatRuling
Defined in: entities/src/javaStats.ts:178
What the decision says about one entity's value for one shared stat.
Properties
kind
readonlykind:"bedrock"|"java"|"exception"
Defined in: entities/src/javaStats.ts:184
java when the server replaces the pack's value with Java's, bedrock when the stat is one Bedrock decides, and exception when a reviewed row keeps Bedrock's value inside a stat Java otherwise decides.
reason
readonlyreason:string
Defined in: entities/src/javaStats.ts:186
Why, taken from SHARED_STATS or from the matching JAVA_STAT_EXCEPTIONS row.
StrengthParams
Defined in: entities/src/components/body.ts:174
What minecraft:strength declares.
Properties
max
readonlymax:number
Defined in: entities/src/components/body.ts:178
The maximum strength value this entity can reach.
value
readonlyvalue:number
Defined in: entities/src/components/body.ts:176
The current strength value, which increases an entity's inventory capacity.
TameableItemParams
Defined in: entities/src/components/interactions.ts:813
One item minecraft:tameable accepts.
Properties
item
readonlyitem:string
Defined in: entities/src/components/interactions.ts:815
The item identifier, normalized to the default Minecraft namespace.
resultItem?
readonlyoptionalresultItem?:string
Defined in: entities/src/components/interactions.ts:817
Item replacing the consumed item after a successful tame, if declared.
TameableParams
Defined in: entities/src/components/interactions.ts:821
What minecraft:tameable declares.
Properties
items
readonlyitems: readonlyTameableItemParams[]
Defined in: entities/src/components/interactions.ts:823
Items that can tame the entity.
probability
readonlyprobability:number
Defined in: entities/src/components/interactions.ts:825
Probability of taming on each matching item interaction.
tameEvent?
readonlyoptionaltameEvent?:SensorTrigger
Defined in: entities/src/components/interactions.ts:827
Event raised after a successful tame.
TargetNearbySensorParams
Defined in: entities/src/components/sensors.ts:464
What minecraft:target_nearby_sensor declares.
Properties
insideRange
readonlyinsideRange:number
Defined in: entities/src/components/sensors.ts:465
mustSee
readonlymustSee:boolean
Defined in: entities/src/components/sensors.ts:467
onInsideRange?
readonlyoptionalonInsideRange?:SensorTrigger
Defined in: entities/src/components/sensors.ts:468
onOutsideRange?
readonlyoptionalonOutsideRange?:SensorTrigger
Defined in: entities/src/components/sensors.ts:469
onVisionLostInsideRange?
readonlyoptionalonVisionLostInsideRange?:SensorTrigger
Defined in: entities/src/components/sensors.ts:470
outsideRange
readonlyoutsideRange:number
Defined in: entities/src/components/sensors.ts:466
TeleportParams
Defined in: entities/src/components/teleport.ts:19
Parameters for minecraft:teleport.
Properties
darkTeleportChance
readonlydarkTeleportChance:number
Defined in: entities/src/components/teleport.ts:20
lightTeleportChance
readonlylightTeleportChance:number
Defined in: entities/src/components/teleport.ts:21
maxRandomTeleportTime
readonlymaxRandomTeleportTime:number
Defined in: entities/src/components/teleport.ts:22
minRandomTeleportTime
readonlyminRandomTeleportTime:number
Defined in: entities/src/components/teleport.ts:23
projectileFilter
readonlyprojectileFilter:Filter|undefined
Defined in: entities/src/components/teleport.ts:24
randomTeleportCube
readonlyrandomTeleportCube:RandomTeleportCube
Defined in: entities/src/components/teleport.ts:25
randomTeleports
readonlyrandomTeleports:boolean
Defined in: entities/src/components/teleport.ts:26
targetDistance
readonlytargetDistance:number
Defined in: entities/src/components/teleport.ts:27
targetTeleportChance
readonlytargetTeleportChance:number
Defined in: entities/src/components/teleport.ts:28
teleportsOnProjectileHit
readonlyteleportsOnProjectileHit:boolean
Defined in: entities/src/components/teleport.ts:29
TimerChoice
Defined in: entities/src/components/lifecycle.ts:91
One weighted entry of minecraft:timer.random_time_choices.
Properties
value
readonlyvalue:number
Defined in: entities/src/components/lifecycle.ts:93
weight
readonlyweight:number
Defined in: entities/src/components/lifecycle.ts:92
TimerParams
Defined in: entities/src/components/lifecycle.ts:97
What minecraft:timer declares.
Properties
choices
readonlychoices: readonlyTimerChoice[]
Defined in: entities/src/components/lifecycle.ts:103
Weighted durations the timer draws from instead of time.
down?
readonlyoptionaldown?:SensorTrigger
Defined in: entities/src/components/lifecycle.ts:105
The event the timer fires when it runs out, with whom it fires on.
looping
readonlylooping:boolean
Defined in: entities/src/components/lifecycle.ts:100
randomInterval
readonlyrandomInterval:boolean
Defined in: entities/src/components/lifecycle.ts:101
time
readonlytime: readonly [number,number]
Defined in: entities/src/components/lifecycle.ts:99
How long the timer runs, in seconds, as a fixed value or a [min, max] pair.
TransformRequest
Defined in: entities/src/entityInstance.ts:103
What minecraft:transformation asks the world to do.
Properties
addGroups
readonlyaddGroups: readonlystring[]
Defined in: entities/src/entityInstance.ts:109
Component groups to add to the new entity.
dropEquipment
readonlydropEquipment:boolean
Defined in: entities/src/entityInstance.ts:113
dropInventory
readonlydropInventory:boolean
Defined in: entities/src/entityInstance.ts:114
event?
readonlyoptionalevent?:string
Defined in: entities/src/entityInstance.ts:107
The event to run on the new entity, from the identifier<event> form.
identifier
readonlyidentifier:string
Defined in: entities/src/entityInstance.ts:105
The entity type to become.
keepLevel
readonlykeepLevel:boolean
Defined in: entities/src/entityInstance.ts:110
keepOwner
readonlykeepOwner:boolean
Defined in: entities/src/entityInstance.ts:111
preserveEquipment
readonlypreserveEquipment:boolean
Defined in: entities/src/entityInstance.ts:112
TransformationParams
Defined in: entities/src/components/lifecycle.ts:539
What minecraft:transformation declares.
Properties
addGroups
readonlyaddGroups: readonlystring[]
Defined in: entities/src/components/lifecycle.ts:544
delay
readonlydelay:number
Defined in: entities/src/components/lifecycle.ts:543
How long the change takes, in seconds.
dropEquipment
readonlydropEquipment:boolean
Defined in: entities/src/components/lifecycle.ts:548
dropInventory
readonlydropInventory:boolean
Defined in: entities/src/components/lifecycle.ts:549
into
readonlyinto:string
Defined in: entities/src/components/lifecycle.ts:541
The entity to become, in the identifier<event> form when it names an event.
keepLevel
readonlykeepLevel:boolean
Defined in: entities/src/components/lifecycle.ts:545
keepOwner
readonlykeepOwner:boolean
Defined in: entities/src/components/lifecycle.ts:546
preserveEquipment
readonlypreserveEquipment:boolean
Defined in: entities/src/components/lifecycle.ts:547
TriggerComponentParams
Defined in: entities/src/triggers.ts:70
What an event-shaped minecraft:on_* component declares.
Properties
event?
readonlyoptionalevent?:string
Defined in: entities/src/triggers.ts:72
The event to fire; a body with none fires nothing, which four vanilla bodies do.
filters?
readonlyoptionalfilters?:Filter
Defined in: entities/src/triggers.ts:76
Gates the whole trigger, evaluated when the engine reaches the fixed point.
target
readonlytarget:"self"|"other"|"player"|"target"|"parent"|"baby"|"block"|"holder"
Defined in: entities/src/triggers.ts:74
Whom the event fires on, self when the body names none.
TypeFamilyParams
Defined in: entities/src/components/body.ts:54
What minecraft:type_family declares.
Properties
family
readonlyfamily: readonlystring[]
Defined in: entities/src/components/body.ts:56
The families is_family matches against.
WeightedEventNode
Defined in: entities/src/events.ts:87
One node of randomize, with the weight the engine draws against.
Properties
node
readonlynode:EventNode
Defined in: entities/src/events.ts:89
weight
readonlyweight:number
Defined in: entities/src/events.ts:88
Type Aliases
AttributeName
AttributeName = typeof
ATTRIBUTES[number]
Defined in: entities/src/attributes.ts:26
One of ATTRIBUTES.
BuiltInSpawnEvent
BuiltInSpawnEvent = typeof
BUILT_IN_SPAWN_EVENTS[number]
Defined in: entities/src/eventEngine.ts:26
One of BUILT_IN_SPAWN_EVENTS.
BurnsInDaylightProtectionSlot
BurnsInDaylightProtectionSlot = typeof
BURNS_IN_DAYLIGHT_PROTECTION_SLOTS[number]
Defined in: entities/src/components/hazards.ts:106
A Bedrock protection slot accepted by minecraft:burns_in_daylight.
ComponentMap
ComponentMap =
ReadonlyMap<string,unknown>
Defined in: entities/src/definition.ts:44
A component map as the file writes it: component name to raw JSON value.
ComponentRecord
ComponentRecord =
Record<string,unknown>
Defined in: entities/src/components/schemas.ts:20
A JSON object, which is what nearly every component value is.
ControlFlag
ControlFlag = typeof
CONTROL_FLAGS[number]
Defined in: entities/src/goals.ts:23
One of CONTROL_FLAGS.
DealsDamage
DealsDamage = typeof
DEALS_DAMAGE[number]
Defined in: entities/src/components/sensors.ts:562
One of DEALS_DAMAGE.
DiagnosticSeverity
DiagnosticSeverity =
"error"|"warning"
Defined in: entities/src/diagnostics.ts:8
How much a finding matters. An error drops content; a warning loads it with something unhandled.
EntityAction
EntityAction = {
name:"play_sound";sound:string; } | {name:"emit_particle";particle:string; } | {name:"emit_vibration";vibration:VibrationKind; } | {commands: readonlystring[];name:"queue_command";target:EventTarget; } | {name:"set_home_position"; } | {event:string;name:"execute_event_on_home_block"; } | {name:"drop_item";slot:string; } | {horizontal:boolean;name:"stop_movement";vertical:boolean; } | {name:"reset_target"; }
Defined in: entities/src/events.ts:57
One event action, parsed into the shape EntityInstance.perform carries out.
The nine members are every action the composed vanilla pack writes plus queue_command, which the documentation describes and no vanilla entity uses. Measured over the 129 files of Bedrock Dedicated Server 1.26.51.1: play_sound 23 uses, set_home_position 17, emit_vibration 9, drop_item 2, execute_event_on_home_block 2, and one each of emit_particle, reset_target and stop_movement.
Union Members
Type Literal
{ name: "play_sound"; sound: string; }
Type Literal
{ name: "emit_particle"; particle: string; }
Type Literal
{ name: "emit_vibration"; vibration: VibrationKind; }
Type Literal
{ commands: readonly string[]; name: "queue_command"; target: EventTarget; }
Vanilla writes one command string; the engine also accepts a list.
Type Literal
{ name: "set_home_position"; }
Type Literal
{ event: string; name: "execute_event_on_home_block"; }
Type Literal
{ name: "drop_item"; slot: string; }
The slot name, such as slot.weapon.mainhand.
Type Literal
{ horizontal: boolean; name: "stop_movement"; vertical: boolean; }
Type Literal
{ name: "reset_target"; }
EntityComponentRegistry
EntityComponentRegistry =
ComponentRegistry<EntityHooks>
Defined in: entities/src/entityType.ts:29
The registry an entity domain fills with component factories.
EntityEquipmentSlot
EntityEquipmentSlot =
"slot.armor.body"|"slot.armor.chest"|"slot.armor.feet"|"slot.armor.head"|"slot.armor.legs"|"slot.weapon.mainhand"|"slot.weapon.offhand"
Defined in: entities/src/hooks.ts:53
A Bedrock equipment slot watched by minecraft:on_equipment_changed.
EntityFlag
EntityFlag = typeof
ENTITY_FLAGS[number]
Defined in: entities/src/filterContext.ts:60
One of ENTITY_FLAGS.
EntityItemStatusEffect
EntityItemStatusEffect =
EntityStatusEffect
Defined in: entities/src/hooks.ts:251
A status effect an accepted data-driven item interaction applies to its target.
EntityMeasure
EntityMeasure = typeof
ENTITY_MEASURES[number]
Defined in: entities/src/filterContext.ts:83
One of ENTITY_MEASURES.
EntityNameSet
EntityNameSet = typeof
ENTITY_NAME_SETS[number]
Defined in: entities/src/filterContext.ts:103
One of ENTITY_NAME_SETS.
EntitySpawnRequest
EntitySpawnRequest = {
cause:"born"|"spawned";count:number;event?:string;identifier:string;kind:"entity";shouldLeash:boolean;sound?:string; } | {count:number;identifier:string;itemEvent?: {event:string;target:EventTarget; };kind:"item";sound?:string; }
Defined in: entities/src/hooks.ts:121
One entity or item a data component asks the world to create.
EntityTypeFlag
EntityTypeFlag =
"spawnable"|"summonable"|"experimental"
Defined in: entities/src/entityType.ts:35
The load-time flags an entity type carries.
EntityTypeTagLookup
EntityTypeTagLookup = (
identifier) => readonlystring[]
Defined in: entities/src/entityType.ts:32
Looks up Java datapack tags for the Bedrock identifier of an entity type.
Parameters
identifier
string
Returns
readonly string[]
EquipmentSlot
EquipmentSlot = typeof
EQUIPMENT_SLOTS[number]
Defined in: entities/src/filterContext.ts:120
One of EQUIPMENT_SLOTS; any when a test's domain names none.
EventReport
EventReport = (
code,message) =>void
Defined in: entities/src/events.ts:138
How the parser reports a finding about one node.
Parameters
code
string
message
string
Returns
void
EventTarget
EventTarget = typeof
EVENT_TARGETS[number]
Defined in: entities/src/events.ts:16
One of EVENT_TARGETS; self when the file writes none.
EventValue
EventValue = {
kind:"literal";value:number|boolean; } | {kind:"text";text:string; }
Defined in: entities/src/events.ts:24
A value an event writes. A number or a boolean is a literal. A string is ambiguous in the file, because the engine reads a set_property string as Molang and vanilla also writes enum members bare, so the parser keeps the text and the engine resolves it against the property it is writing.
FilterSubjects
FilterSubjects =
Omit<FilterContext,"self"|"random">
Defined in: entities/src/filterContext.ts:246
The subjects of a context other than self, which an entity always answers for itself. A fixed point such as a damage event supplies the ones it knows.
JavaNavigationSource
JavaNavigationSource =
Readonly<Record<string,JavaEntityNavigation>>
Defined in: entities/src/javaNavigation.ts:18
Java mob navigation data keyed by the Java entity identifier.
JavaStatSource
JavaStatSource =
Readonly<Record<string,JavaEntityStats>>
Defined in: entities/src/javaStats.ts:228
Java's entity stats by identifier.
@jsprismarine/bedrock-data exports the vanilla table as java_entity_attributes. This package takes it as data so that the entity runtime does not depend on the goldens, and so a test can pass a table of its own.
PropertyDefault
PropertyDefault = {
kind:"literal";value:PropertyValue; } | {kind:"molang";source:string; }
Defined in: entities/src/properties.ts:24
A declared default. The engine accepts a literal or a Molang expression, and a default expression may only call query.had_component_group.
PropertyType
PropertyType = typeof
PROPERTY_TYPES[number]
Defined in: entities/src/properties.ts:15
One of PROPERTY_TYPES.
PropertyValue
PropertyValue =
number|boolean|string
Defined in: entities/src/properties.ts:18
A property value at run time; an enum property holds the member's name.
SharedStat
SharedStat =
"attack_damage"|"flying_speed"|"follow_range"|"height"|"jump_strength"|"knockback_resistance"|"max_health"|"movement_speed"|"width"
Defined in: entities/src/javaStats.ts:19
A stat both editions publish for the same entity.
SpawnCause
SpawnCause =
"spawned"|"born"|"transformed"|"primed"
Defined in: entities/src/eventEngine.ts:29
Why an entity is being created, which picks its spawn event.
TriggerComponentName
TriggerComponentName = typeof
EVENT_TRIGGER_COMPONENTS[number]
Defined in: entities/src/triggers.ts:46
One of EVENT_TRIGGER_COMPONENTS, which can be fired directly.
VibrationKind
VibrationKind = typeof
VIBRATION_KINDS[number]
Defined in: entities/src/events.ts:44
One of VIBRATION_KINDS.
Variables
ATTRIBUTES
constATTRIBUTES: readonly ["absorption","attack_damage","flying_speed","follow_range","health","jump_strength","knockback_resistance","lava_movement","luck","movement","underwater_movement"]
Defined in: entities/src/attributes.ts:11
The attribute names the implemented components write.
BUILT_IN_SPAWN_EVENTS
constBUILT_IN_SPAWN_EVENTS: readonly ["minecraft:entity_spawned","minecraft:entity_born","minecraft:entity_transformed","minecraft:on_prime"]
Defined in: entities/src/eventEngine.ts:18
The four events the engine itself runs on a new entity.
BURNS_IN_DAYLIGHT_PROTECTION_SLOTS
constBURNS_IN_DAYLIGHT_PROTECTION_SLOTS: readonly ["slot.armor.body","slot.armor.chest","slot.armor.feet","slot.armor.head","slot.armor.legs","slot.weapon.mainhand","slot.weapon.offhand"]
Defined in: entities/src/components/hazards.ts:95
Equipment slots accepted for minecraft:burns_in_daylight protection.
CONTROL_FLAGS
constCONTROL_FLAGS: readonly ["move","look","jump"]
Defined in: entities/src/goals.ts:20
The parts of an entity a goal takes over while it runs.
DATA_COMPONENTS
constDATA_COMPONENTS: readonlystring[]
Defined in: entities/src/components/index.ts:107
The component names this package parses and exposes without running behavior of its own.
Dedicated factories validate and normalize their values. Generic factories preserve the raw object. Both make the component available through EntityInstance.componentParams, which is all a flag like minecraft:can_climb or a table reference like minecraft:shareables is.
The list covers every canonical non-goal key after type resolution normalizes the legacy minecraft:offspring name to minecraft:offspring_data. Components with dedicated factories are registered separately; these factories preserve the remaining component bodies for systems that need their data, without claiming to run their behavior.
DEALS_DAMAGE
constDEALS_DAMAGE: readonly ["yes","no","no_but_side_effects_apply","no_but_entity_effects_apply"]
Defined in: entities/src/components/sensors.ts:559
How a minecraft:damage_sensor trigger changes the damage it sees.
DEFAULT_UNDERWATER_MOVEMENT
constDEFAULT_UNDERWATER_MOVEMENT:0.02=0.02
Defined in: entities/src/components/body.ts:11
The component default used when an entity has no underwater movement component.
ENTITY_FLAGS
constENTITY_FLAGS: readonly ["has_container_open","has_nametag","has_ranged_weapon","has_silk_touch","has_target","has_trade_supply","in_caravan","in_clouds","in_contact_with_water","in_lava","in_water","in_water_or_rain","is_avoiding_mobs","is_baby","is_bound_to_creaking_heart","is_climbing","is_humid","is_immobile","is_in_village","is_leashed","is_missing_health","is_moving","is_navigating","is_panicking","is_persistent","is_raider","is_riding","is_sitting","is_sleeping","is_sneak_held","is_sneaking","is_snow_covered","is_sprinting","is_tamed","is_underground","is_underwater","is_visible","on_fire","on_ground","on_hot_block","on_ladder","surface_mob","taking_fire_damage"]
Defined in: entities/src/filterContext.ts:13
The boolean facts about an entity, each named by the filter test that reads it.
ENTITY_MEASURES
constENTITY_MEASURES: readonly ["actor_health","distance_to_nearest_player","home_distance","inactivity_timer","is_altitude","is_brightness","is_mark_variant","is_skin_id","is_temperature_value","is_variant","light_level","owner_distance","redstone_strength_at_position","rider_count","target_distance","y_rotation"]
Defined in: entities/src/filterContext.ts:63
The numeric facts about an entity, each named by the filter test that reads it.
ENTITY_NAME_SETS
constENTITY_NAME_SETS: readonly ["has_ability","has_biome_tag","has_damage","has_mob_effect","has_tag","in_block","is_biome","is_color","is_controlling_passenger_family","is_family","is_temperature_type","was_last_hurt_by","weather_at_position"]
Defined in: entities/src/filterContext.ts:86
The name-set facts about an entity, each named by the filter test that reads it.
ENTITY_ROOT_KEY
constENTITY_ROOT_KEY:"minecraft:entity"='minecraft:entity'
Defined in: entities/src/definition.ts:24
The key the entity body sits under in an entity file.
EQUIPMENT_SLOTS
constEQUIPMENT_SLOTS: readonly ["any","armor","feet","hand","head","inventory","leg","main_hand","off_hand","torso"]
Defined in: entities/src/filterContext.ts:106
The equipment containers a filter domain names.
EVENT_ACTION_VERSIONS
constEVENT_ACTION_VERSIONS:ReadonlyMap<string, readonly [number,number,number]>
Defined in: entities/src/events.ts:117
The action keys EventActions.md documents, with the format_version each needs. An action used below its version loads anyway and is reported, which is the lenient reading format_version dispatch calls for.
EVENT_TARGETS
constEVENT_TARGETS: readonly ["self","other","player","target","baby","parent","holder","block"]
Defined in: entities/src/events.ts:13
Whom a trigger entry fires its event on.
EVENT_TRIGGER_COMPONENTS
constEVENT_TRIGGER_COMPONENTS: readonly ["minecraft:on_death","minecraft:on_friendly_anger","minecraft:on_hurt","minecraft:on_hurt_by_player","minecraft:on_ignite","minecraft:on_start_landing","minecraft:on_start_takeoff","minecraft:on_target_acquired","minecraft:on_target_escape","minecraft:on_wake_with_owner"]
Defined in: entities/src/triggers.ts:17
The ten event-shaped minecraft:on_* components.
FIRE_DAMAGE_CAUSES
constFIRE_DAMAGE_CAUSES: readonlystring[]
Defined in: entities/src/hooks.ts:167
The causes minecraft:fire_immune turns aside.
Bedrock writes the component as an empty marker, so the cause list is the whole of what it means. magma is the block's own cause and is listed separately from fire, which is why both are here.
FREEZING_DAMAGE_CAUSES
constFREEZING_DAMAGE_CAUSES: readonlystring[]
Defined in: entities/src/hooks.ts:177
The causes minecraft:freezing_immune turns aside.
HURT_INTERVAL_TICKS
constHURT_INTERVAL_TICKS:10=10
Defined in: entities/src/components/hazards.ts:22
How many ticks apart an environmental hurt lands.
Both editions give an entity half a second of invulnerability after environmental damage, which is what makes minecraft:hurt_on_condition's damage_per_tick: 4 in lava the four damage per half second a player sees rather than eighty a second.
IMPLEMENTED_FILTER_TESTS
constIMPLEMENTED_FILTER_TESTS: readonlystring[]
Defined in: entities/src/filters.ts:359
Every filter test this package evaluates, in name order.
JAVA_STAT_EXCEPTIONS
constJAVA_STAT_EXCEPTIONS: readonlyJavaStatException[]
Defined in: entities/src/javaStats.ts:121
The rows that keep Bedrock's value inside a stat Java decides.
Each one is a case where Java's attribute supplier publishes a number that Java Edition itself never runs with, because the class overwrites it at spawn or expresses the behavior in code instead.
MAX_BLOCK_SENSOR_RADIUS
constMAX_BLOCK_SENSOR_RADIUS:32=32
Defined in: entities/src/components/sensors.ts:249
The largest radius a minecraft:block_sensor can search.
MAX_ENUM_VALUES
constMAX_ENUM_VALUES:16=16
Defined in: entities/src/properties.ts:44
At most 16 members per enum property, per the entity properties documentation.
MAX_PROPERTIES_PER_ENTITY
constMAX_PROPERTIES_PER_ENTITY:32=32
Defined in: entities/src/properties.ts:41
At most 32 properties per entity type, per the entity properties documentation.
PROPERTY_TYPES
constPROPERTY_TYPES: readonly ["int","float","bool","enum"]
Defined in: entities/src/properties.ts:12
The four property types the engine supports.
SELF_FIRED_TRIGGERS
constSELF_FIRED_TRIGGERS: readonlyTriggerComponentName[]
Defined in: entities/src/triggers.ts:56
Event-shaped trigger components fired at fixed points the entity runtime owns.
EntityInstance.damage fires the hurt and death triggers, EntityInstance.setAttackTarget fires the target triggers, and the entity runtime fires friendly anger, ignition, landing, and takeoff. The pet sleep goal fires the owner-wake trigger.
SHARED_STATS
constSHARED_STATS:Readonly<Record<SharedStat,StatAuthority>>
Defined in: entities/src/javaStats.ts:52
The edition that decides each shared stat.
Java decides the four a Bedrock client never simulates: it draws hearts from the health attribute, computes no damage of its own, and runs no mob AI. Bedrock decides the five that reach the client's own simulation. ClientMovementPredictionSyncPacket enumerates what the client predicts an actor with, and the bounding box, the movement speeds and the jump strength are all on that list.
SUFFOCATION_DAMAGE
constSUFFOCATION_DAMAGE:2=2
Defined in: entities/src/components/hazards.ts:195
How much health one suffocation hurt takes, which both editions put at one heart.
TICKS_PER_SECOND
constTICKS_PER_SECOND:20=20
Defined in: entities/src/hooks.ts:13
How many server ticks there are in one second, which is how component bodies write durations.
TRIGGER_COMPONENTS
constTRIGGER_COMPONENTS: readonly ["minecraft:on_death","minecraft:on_equipment_changed","minecraft:on_friendly_anger","minecraft:on_hurt","minecraft:on_hurt_by_player","minecraft:on_ignite","minecraft:on_start_landing","minecraft:on_start_takeoff","minecraft:on_target_acquired","minecraft:on_target_escape","minecraft:on_wake_with_owner"]
Defined in: entities/src/triggers.ts:31
The eleven minecraft:on_* components vanilla declares.
VIBRATION_KINDS
constVIBRATION_KINDS: readonly ["entity_interact","entity_act","entity_die"]
Defined in: entities/src/events.ts:41
The three vibration names emit_vibration accepts.
admireItem
constadmireItem:ComponentFactory<EntityHooks,AdmireItemParams>
Defined in: entities/src/components/interactions.ts:128
The Bedrock admiration component, consumed by the data-driven entity runtime.
ageable
constageable:ComponentFactory<EntityHooks,AgeableParams>
Defined in: entities/src/components/lifecycle.ts:359
minecraft:ageable, carried by the baby group of 35 vanilla entities.
The countdown runs while the component is active and fires grow_up when it runs out, which is the event that swaps the baby group for the adult one. Feeding, pausing, and resetting are routed through the active component, so their item, event, timer, and filter data stay attached to the behavior that owns the timer.
airDragModifier
constairDragModifier:ComponentFactory<EntityHooks,number>
Defined in: entities/src/components/body.ts:292
minecraft:air_drag_modifier, the multiplier on air resistance.
ambientSoundInterval
constambientSoundInterval:ComponentFactory<EntityHooks,AmbientSoundIntervalParams>
Defined in: entities/src/components/lifecycle.ts:486
minecraft:ambient_sound_interval, carried by 32 vanilla entities.
The component waits value seconds plus up to range more, plays its sound through the world, and draws the next wait. A body whose value and range are both zero, which the bee writes, names no interval and plays nothing.
event_names entries win over event_name, in file order, and their condition goes to the entity's Molang evaluator. An entry whose condition does not evaluate is skipped rather than taken.
angry
constangry:ComponentFactory<EntityHooks,AngryParams>
Defined in: entities/src/components/combat.ts:314
minecraft:angry, carried by 20 vanilla entities.
The component counts the anger down and fires calm_event when it runs out, which is what takes the angry group back off. broadcast_anger asks the world to notify nearby matching entities when anger starts, the mob attacks, it is attacked, or it dies. Its filters exclude targets and its angry sound repeats on the configured interval.
The bee and the dolphin write the pre-rename broadcastAnger and broadcastRange, so both spellings read.
areaAttack
constareaAttack:ComponentFactory<EntityHooks,AreaAttackParams>
Defined in: entities/src/components/combat.ts:63
minecraft:area_attack, whose range damage is applied by the dimension runtime.
attack
constattack:ComponentFactory<EntityHooks,AttackParams>
Defined in: entities/src/components/combat.ts:155
minecraft:attack, the melee damage an entity deals. It also declares the attack_damage attribute, so a group that swaps the component changes the stat.
attributeComponents
constattributeComponents: readonlyComponentFactory<EntityHooks, {max:number;value:number; }>[]
Defined in: entities/src/components/body.ts:14
The attribute components, each one number the server reads off the entity.
barter
constbarter:ComponentFactory<EntityHooks,BarterParams>
Defined in: entities/src/components/interactions.ts:154
The Bedrock barter component, consumed by the data-driven entity runtime.
blockSensor
constblockSensor:ComponentFactory<EntityHooks,BlockSensorParams>
Defined in: entities/src/components/sensors.ts:290
minecraft:block_sensor, which raises events for matching nearby block breaks.
bounciness
constbounciness:ComponentFactory<EntityHooks,number>
Defined in: entities/src/components/body.ts:298
minecraft:bounciness, the fraction of impact velocity restored on a collision.
breathable
constbreathable:ComponentFactory<EntityHooks,BreathableParams>
Defined in: entities/src/components/hazards.ts:219
minecraft:breathable, carried by 84 vanilla entities.
The component holds the air supply and spends it. An entity in a medium it cannot breathe loses a tick of supply per tick; one back in a medium it can breathe refills to full, over inhale_time when the body names one. An entity out of supply suffocates every suffocate_time seconds, or every half second when the body writes the vanilla 0.
Which medium the entity is in comes from the in_water and in_lava filter facts, so an environment that answers neither leaves the entity breathing.
Two vanilla files still write the pre-rename totalSupply and suffocateTime, so both spellings read.
breedable
constbreedable:ComponentFactory<EntityHooks,BreedableParams>
Defined in: entities/src/components/interactions.ts:632
minecraft:breedable, which owns feeding eligibility and item replacement.
burnsInDaylight
constburnsInDaylight:ComponentFactory<EntityHooks,BurnsInDaylightParams>
Defined in: entities/src/components/hazards.ts:124
minecraft:burns_in_daylight, whose direct-sun test and fire state belong to the world runtime.
The component package validates the Bedrock equipment slot. The dimension runtime owns sky exposure, rain, fire ticks, damage, and the minecraft:on_ignite fixed point.
collisionBox
constcollisionBox:ComponentFactory<EntityHooks,CollisionBoxParams>
Defined in: entities/src/components/body.ts:43
minecraft:collision_box, the entity's hitbox.
combatRegeneration
constcombatRegeneration:ComponentFactory<EntityHooks,CombatRegenerationParams>
Defined in: entities/src/components/combat.ts:188
minecraft:combat_regeneration, which rewards the killer of the entity's current attack target with Regeneration I and removes Mining Fatigue.
damageOverTime
constdamageOverTime:ComponentFactory<EntityHooks,DamageOverTimeParams>
Defined in: entities/src/components/hazards.ts:152
minecraft:damage_over_time, which hurts the entity while it is active.
The axolotl, the dolphin and the vex are the three vanilla users, and two of them write time_between_hurt: 0, which the engine floors at HURT_INTERVAL_TICKS rather than hurting every tick.
damageSensor
constdamageSensor:ComponentFactory<EntityHooks,DamageSensorParams>
Defined in: entities/src/components/sensors.ts:592
minecraft:damage_sensor, which decides what one damage cause does and fires an event when it lands.
The first trigger whose cause and filters match answers, which is why the hook returns a value: dispatchFirst stops there.
defaultRandom
constdefaultRandom:RandomSource
Defined in: entities/src/filterContext.ts:221
A random source backed by Math.random.
despawn
constdespawn:ComponentFactory<EntityHooks,DespawnParams>
Defined in: entities/src/components/lifecycle.ts:38
minecraft:despawn, carried by 76 vanilla entities and written as the empty default by 67 of them.
With filters, the entity despawns as soon as they pass. Without them, the standard rules apply: anything past max_distance goes at once, and anything past min_distance rolls min_range_random_chance each tick.
dyeable
constdyeable:ComponentFactory<EntityHooks,DyeableParams>
Defined in: entities/src/components/dyeable.ts:23
minecraft:is_dyeable, including its optional touch-screen prompt.
entitySensor
constentitySensor:ComponentFactory<EntityHooks,EntitySensorParams>
Defined in: entities/src/components/sensors.ts:177
minecraft:entity_sensor, which emits events when nearby entity filters and count bounds pass.
environmentSensor
constenvironmentSensor:ComponentFactory<EntityHooks,EnvironmentSensorParams>
Defined in: entities/src/components/sensors.ts:53
minecraft:environment_sensor, which tests the world each tick and fires an event when its filters pass. The zombie's is_underwater trigger is what starts the conversion to a drowned.
equipment
constequipment:ComponentFactory<EntityHooks,EquipmentParams>
Defined in: entities/src/components/body.ts:220
minecraft:equipment, the loot table a mob wears.
equipmentChanged
constequipmentChanged:ComponentFactory<EntityHooks,EquipmentChangedParams>
Defined in: entities/src/components/sensors.ts:687
minecraft:on_equipment_changed, with a distinct event for equip and unequip per slot.
experienceReward
constexperienceReward:ComponentFactory<EntityHooks,ExperienceRewardParams>
Defined in: entities/src/components/body.ts:93
minecraft:experience_reward, the experience an entity drops.
float
constfloat:GoalFactory<FloatParams>
Defined in: entities/src/goals/reference.ts:27
minecraft:behavior.float, which keeps an entity at the surface of water or lava. 49 vanilla entities carry it, 40 of them at priority 0.
frictionModifier
constfrictionModifier:ComponentFactory<EntityHooks,number>
Defined in: entities/src/components/body.ts:295
minecraft:friction_modifier, the multiplier on ground friction.
healable
consthealable:ComponentFactory<EntityHooks,HealableParams>
Defined in: entities/src/components/interactions.ts:695
minecraft:healable, which owns the entity's item-based healing interaction.
home
consthome:ComponentFactory<EntityHooks,ComponentRecord>
Defined in: entities/src/components/home.ts:8
minecraft:home, which records the entity's spawning position for home-based behavior.
hurtOnCondition
consthurtOnCondition:ComponentFactory<EntityHooks,HurtOnConditionParams>
Defined in: entities/src/components/hazards.ts:46
minecraft:hurt_on_condition, carried by 87 vanilla entities and in all but a few of them the lava rule.
Every condition whose filters pass hurts, on the HURT_INTERVAL_TICKS cadence, so the damage reaches the sensors, the immunities and the hurt triggers through EntityInstance.damage like any other.
ignoreCannotBeAttacked
constignoreCannotBeAttacked:ComponentFactory<EntityHooks,IgnoreCannotBeAttackedParams>
Defined in: entities/src/components/combat.ts:242
minecraft:ignore_cannot_be_attacked, with its exception filter scoped to the active component.
insideBlockNotifier
constinsideBlockNotifier:ComponentFactory<EntityHooks,InsideBlockNotifierParams>
Defined in: entities/src/components/sensors.ts:395
minecraft:inside_block_notifier, which raises events on block-state transitions.
instantDespawn
constinstantDespawn:ComponentFactory<EntityHooks,ComponentRecord>
Defined in: entities/src/components/lifecycle.ts:81
minecraft:instant_despawn, which removes the entity the moment it becomes active.
integerStateComponents
constintegerStateComponents: readonlyComponentFactory<EntityHooks,number>[]
Defined in: entities/src/components/body.ts:282
The integer state components filters and the wire both read.
interact
constinteract:ComponentFactory<EntityHooks,InteractParams>
Defined in: entities/src/components/interactions.ts:192
The held-item behavior currently implemented for minecraft:interact.
It evaluates each entry's on_interact.filters, enforces cooldowns, queues its event, plays play_sounds, emits its vibration game event, rolls spawn_items or adds add_items to the interacting player's inventory, creates spawn_entities, equips or drops an entity slot, and applies transform_to_item, give_item, and use_item to the live held stack. It emits a named particle_on_start.particle_type with its vertical and interactor offsets, and its swing setting relays the player's arm animation after a successful interaction. admire and barter start the piglin's corresponding item behavior when its active components and brain support them. Other interaction fields remain visible as a one-time runtime report so incomplete behavior is not silently treated as vanilla.
inventory
constinventory:ComponentFactory<EntityHooks,InventoryParams>
Defined in: entities/src/components/body.ts:156
minecraft:inventory, the container a mob carries.
jumpStatic
constjumpStatic:ComponentFactory<EntityHooks,JumpParams>
Defined in: entities/src/components/movement.ts:100
minecraft:jump.static, the fixed jump height 79 entities use.
lookAtPlayer
constlookAtPlayer:GoalFactory<LookAtPlayerParams>
Defined in: entities/src/goals/reference.ts:115
minecraft:behavior.look_at_player, the most used goal in the vanilla pack: 69 of the 129 entities carry it, usually at priority 7 to 9 with a probability of 0.02.
loot
constloot:ComponentFactory<EntityHooks,LootParams>
Defined in: entities/src/components/body.ts:78
minecraft:loot, the table a later agent rolls on death.
mobEffect
constmobEffect:ComponentFactory<EntityHooks,MobEffectParams>
Defined in: entities/src/components/effects.ts:96
minecraft:mob_effect, which applies an effect to matching nearby entities and players.
nameable
constnameable:ComponentFactory<EntityHooks,NameableParams>
Defined in: entities/src/components/nameable.ts:68
minecraft:nameable, including the event raised when a name tag is used.
parseEntityFilter
constparseEntityFilter: (value) =>Filter=parseFilter
Defined in: entities/src/filters.ts:356
Parses a filter out of an entity definition. @jsprismarine/packs owns the grammar and reads every shape the vanilla files write, including the two this package used to rewrite first, so this is its parser under the name the entity side calls it by.
Parses a filter from its JSON form into the normalized shape: aliases resolve to their canonical combinator, integer subjects and operators resolve to their names, and the self and == defaults are filled in.
Parameters
value
unknown
Returns
Throws
When the value does not follow the grammar.
Throws
When the value does not follow the grammar.
physics
constphysics:ComponentFactory<EntityHooks,PhysicsParams>
Defined in: entities/src/components/body.ts:111
minecraft:physics, carried by 126 of the 129 vanilla entities.
pushable
constpushable:ComponentFactory<EntityHooks,PushableParams>
Defined in: entities/src/components/body.ts:132
minecraft:pushable, which the 1.26.50 component schema omits but 27 entities use.
randomStroll
constrandomStroll:GoalFactory<RandomStrollParams>
Defined in: entities/src/goals/reference.ts:63
minecraft:behavior.random_stroll, the wander 64 vanilla entities carry. It takes the move flag for one walk and gives it back when the walk ends.
recordSchema
constrecordSchema:ComponentSchema<ComponentRecord>
Defined in: entities/src/components/schemas.ts:27
Accepts an object and nothing else, which is the shape of every component body.
referenceGoals
constreferenceGoals: readonly [GoalFactory<FloatParams>,GoalFactory<RandomStrollParams>,GoalFactory<LookAtPlayerParams>]
Defined in: entities/src/goals/reference.ts:154
The goals this package ships. A later agent adds the other 167.
rideable
constrideable:ComponentFactory<EntityHooks,RideableParams>
Defined in: entities/src/components/body.ts:244
minecraft:rideable, carried by 36 vanilla entities.
The seats themselves are state the vehicle holds, so mounting goes through EntityInstance.mount and the component's part is the seat count, the families allowed in and the two events. Taking the component off empties the seats, which is what a group swap that removes a saddle does.
shareables
constshareables:ComponentFactory<EntityHooks,ShareablesParams>
Defined in: entities/src/components/shareables.ts:122
minecraft:shareables, which describes the items an entity picks up or shares.
spawnEggInteraction
constspawnEggInteraction:ComponentFactory<EntityHooks,ComponentRecord>
Defined in: entities/src/components/interactions.ts:26
minecraft:spawn_egg_interaction, which creates the entity's offspring from its matching egg.
spawnEntity
constspawnEntity:ComponentFactory<EntityHooks,SpawnEntityParams>
Defined in: entities/src/components/lifecycle.ts:205
minecraft:spawn_entity, which periodically creates the configured item or entity.
Its schedule belongs to the active component instance: removing its group clears the clock, and adding it again starts a new one.
spellEffects
constspellEffects:ComponentFactory<EntityHooks,SpellEffectsParams>
Defined in: entities/src/components/effects.ts:197
minecraft:spell_effects, the one-time effect operation performed when the component is added.
strength
conststrength:ComponentFactory<EntityHooks,StrengthParams>
Defined in: entities/src/components/body.ts:182
minecraft:strength, which contributes slots to an entity's inventory.
tameable
consttameable:ComponentFactory<EntityHooks,TameableParams>
Defined in: entities/src/components/interactions.ts:831
minecraft:tameable, which owns item matching and its probability roll.
targetNearbySensor
consttargetNearbySensor:ComponentFactory<EntityHooks,TargetNearbySensorParams>
Defined in: entities/src/components/sensors.ts:488
minecraft:target_nearby_sensor, which changes behavior as the current target enters or leaves its hysteresis range, or loses visibility inside.
teleport
constteleport:ComponentFactory<EntityHooks,TeleportParams>
Defined in: entities/src/components/teleport.ts:39
minecraft:teleport, which handles timed, target-driven, and projectile evasion teleports.
timer
consttimer:ComponentFactory<EntityHooks,TimerParams>
Defined in: entities/src/components/lifecycle.ts:119
minecraft:timer, which fires an event after a delay.
Timing restarts on initialize, which is exactly the documented behavior of re-adding a group: "an already-added minecraft:timer that is added again will start its timing logic over".
transformation
consttransformation:ComponentFactory<EntityHooks,TransformationParams>
Defined in: entities/src/components/lifecycle.ts:560
minecraft:transformation, which replaces the entity with another type after a delay and runs minecraft:entity_transformed on the new one.
typeFamily
consttypeFamily:ComponentFactory<EntityHooks,TypeFamilyParams>
Defined in: entities/src/components/body.ts:60
minecraft:type_family, the families the most used filter test reads.
Functions
asList()
asList(
value): readonlyunknown[]
Defined in: entities/src/components/schemas.ts:43
Normalizes a value vanilla writes as either one object or an array of them.
Parameters
value
unknown
Returns
readonly unknown[]
attributeComponent()
attributeComponent(
name,attribute,fallback):ComponentFactory<EntityHooks, {max:number;value:number; }>
Defined in: entities/src/components/schemas.ts:93
A component that declares one attribute, such as minecraft:health or minecraft:movement.
Writing the attribute on initialize is what makes a re-added component group reset the stat: the zombie's baby group carries its own minecraft:movement, and adding it again puts the speed back.
Parameters
name
string
attribute
"absorption" | "attack_damage" | "flying_speed" | "follow_range" | "health" | "jump_strength" | "knockback_resistance" | "lava_movement" | "luck" | "movement" | "underwater_movement"
fallback
number
Returns
ComponentFactory<EntityHooks, { max: number; value: number; }>
booleanAt()
booleanAt(
body,key,fallback):boolean
Defined in: entities/src/components/schemas.ts:35
Reads a boolean from a component body, falling back when the key is absent.
Parameters
body
key
string
fallback
boolean
Returns
boolean
canEntityAttack()
canEntityAttack(
attacker,target):boolean
Defined in: entities/src/components/combat.ts:272
Whether the attacker may damage the entity under the active attack filters.
Parameters
attacker
target
Returns
boolean
canEntityAttackView()
canEntityAttackView(
attacker,target):boolean
Defined in: entities/src/components/combat.ts:258
Whether the attacker may damage a target view under the active attack filters.
Parameters
attacker
target
Returns
boolean
coerce()
coerce(
definition,value):PropertyValue|undefined
Defined in: entities/src/properties.ts:159
Brings a value into a property's domain: an int rounds and clamps, a float clamps, a bool accepts a boolean or Molang's 0 and 1, and an enum accepts one of its declared members.
Clamping is silent, which is what the engine documents for int and float.
Parameters
definition
value
Returns
PropertyValue | undefined
The stored value, or undefined when the value has no place in the domain.
createEntityComponentRegistry()
createEntityComponentRegistry():
EntityComponentRegistry
Defined in: entities/src/components/index.ts:305
Builds a registry holding every component and reference goal this package implements.
Returns
damagerSubjects()
damagerSubjects(
damager):FilterSubjects
Defined in: entities/src/filterContext.ts:253
The subjects a damage event supplies. Whoever dealt the damage answers both damager and other, which is the subject a vanilla minecraft:damage_sensor filter names.
Parameters
damager
FilterEntityView | undefined
Returns
dataComponent()
dataComponent(
name):ComponentFactory<EntityHooks,ComponentRecord>
Defined in: entities/src/components/schemas.ts:63
A component that carries no parameters, such as minecraft:physics or minecraft:can_climb. The body still parses, so a typo in it is reported.
Parameters
name
string
Returns
ComponentFactory<EntityHooks, ComponentRecord>
determineEvent()
determineEvent(
runtime,event):EventEffects
Defined in: entities/src/eventEngine.ts:149
Runs one event and returns what it decided, without changing the entity.
A node's own filters gate the whole node. Within a node the engine applies add, remove, set_property, the raw actions and trigger, then walks sequence in order, then draws one branch of randomize, then takes the first passing branch of first_valid. A trigger on self is folded into the same result, so one tick applies the whole chain; a trigger on another target is left for the caller to route.
Parameters
runtime
event
string
Returns
evaluateFilter()
evaluateFilter(
filter,context,options?):boolean
Defined in: entities/src/filters.ts:451
Evaluates one parsed filter.
An unknown test, a subject the context does not hold, and a fact no view answers all evaluate to false and report through EvaluateFilterOptions.onUnanswered, so a filter never stops a tick.
Parameters
filter
context
options?
Returns
boolean
eventActionNames()
eventActionNames(
node): readonlystring[]
Defined in: entities/src/events.ts:409
Every action key a node tree asks for, which is what the version gate checks.
Parameters
node
Returns
readonly string[]
eventActions()
eventActions(
node): readonlyEventAction[]
Defined in: entities/src/events.ts:396
Every action a node tree asks for, however deeply nested, in tree order.
Parameters
node
Returns
readonly EventAction[]
goalComponent()
goalComponent<
P>(factory):ComponentFactory<EntityHooks,GoalParams<P>>
Defined in: entities/src/goals.ts:84
Wraps a goal as a component factory.
The wrapper owns priority and control_flags, registers the goal with the entity's scheduler on initialize, and takes it off again on remove.
Type Parameters
P
P
Parameters
factory
GoalFactory<P>
Returns
ComponentFactory<EntityHooks, GoalParams<P>>
hasFilterTest()
hasFilterTest(
name):boolean
Defined in: entities/src/filters.ts:362
Whether the evaluator knows the named test.
Parameters
name
string
Returns
boolean
isAreaAttackParams()
isAreaAttackParams(
value):value is AreaAttackParams
Defined in: entities/src/components/combat.ts:133
Checks the parsed component parameters before the runtime reads them.
Parameters
value
unknown
Returns
value is AreaAttackParams
isDyeableParams()
isDyeableParams(
value):value is DyeableParams
Defined in: entities/src/components/dyeable.ts:19
Whether a parsed value has the shape exposed by minecraft:is_dyeable.
Parameters
value
unknown
The parsed component parameters.
Returns
value is DyeableParams
Whether the value is a dyeable component body.
isEmptyEventNode()
isEmptyEventNode(
node):boolean
Defined in: entities/src/events.ts:385
Whether a node asks for nothing at all, which is how vanilla writes a "do nothing" branch.
Parameters
node
Returns
boolean
isJavaStatException()
isJavaStatException(
identifier,stat):boolean
Defined in: entities/src/javaStats.ts:174
Whether a reviewed row keeps Bedrock's value for a stat Java otherwise decides.
Parameters
identifier
string
stat
Returns
boolean
isNameableParams()
isNameableParams(
value):value is NameableParams
Defined in: entities/src/components/nameable.ts:38
Whether a parsed component value has the shape minecraft:nameable exposes to its host.
Parameters
value
unknown
Returns
value is NameableParams
isPlayerView()
isPlayerView(
view):boolean
Defined in: entities/src/filterContext.ts:257
Whether a view belongs to the player type family.
Parameters
view
FilterEntityView | undefined
Returns
boolean
isRecord()
isRecord(
value):value is ComponentRecord
Defined in: entities/src/components/schemas.ts:23
Whether a value is a plain JSON object.
Parameters
value
unknown
Returns
value is ComponentRecord
isRideableParams()
isRideableParams(
value):value is RideableParams
Defined in: entities/src/riding.ts:41
Whether a value is the parsed body of minecraft:rideable.
Parameters
value
unknown
Returns
value is RideableParams
isShareablesParams()
isShareablesParams(
value):value is ShareablesParams
Defined in: entities/src/components/shareables.ts:163
Whether a parsed minecraft:shareables value has its normalized shape.
Parameters
value
unknown
Returns
value is ShareablesParams
isStrengthParams()
isStrengthParams(
value):value is StrengthParams
Defined in: entities/src/components/body.ts:197
Whether a value has the normalized shape produced by minecraft:strength.
Parameters
value
unknown
Returns
value is StrengthParams
isTriggerParams()
isTriggerParams(
value):value is TriggerComponentParams
Defined in: entities/src/triggers.ts:80
Whether a value is the parsed body of an event-shaped trigger component.
Parameters
value
unknown
Returns
value is TriggerComponentParams
javaAttributeBases()
javaAttributeBases(
identifier,source):ReadonlyMap<"absorption"|"attack_damage"|"flying_speed"|"follow_range"|"health"|"jump_strength"|"knockback_resistance"|"lava_movement"|"luck"|"movement"|"underwater_movement",number>
Defined in: entities/src/javaStats.ts:303
The attribute base values Java Edition decides for one entity type.
A component that declares one of these attributes gets Java's number instead of the one the Bedrock pack wrote, with the reviewed exceptions left alone. Attributes Java does not publish for the type are absent, so the pack's value stands.
The identifier is the one the entity spawns under, which for five types is Bedrock's legacy spelling rather than Java's, so the row is found through javaEntityStats rather than by a direct read.
Parameters
identifier
string
The Bedrock entity identifier, such as minecraft:wither.
source
Readonly<Record<string, JavaEntityStats>> | undefined
Java's stat table, or undefined to run on the pack's values alone.
Returns
ReadonlyMap<"absorption" | "attack_damage" | "flying_speed" | "follow_range" | "health" | "jump_strength" | "knockback_resistance" | "lava_movement" | "luck" | "movement" | "underwater_movement", number>
Attribute name to the base value, empty when nothing is overridden.
javaEntityNavigation()
javaEntityNavigation(
identifier,source):JavaEntityNavigation|undefined
Defined in: entities/src/javaNavigation.ts:46
Java's navigation for the entity a Bedrock identifier spawns, when the dump has that type.
Parameters
identifier
string
source
Readonly<Record<string, JavaEntityNavigation>> | undefined
Returns
JavaEntityNavigation | undefined
javaEntityStats()
javaEntityStats(
identifier,source):JavaEntityStats|undefined
Defined in: entities/src/javaStats.ts:278
Java's stats for the entity a Bedrock identifier spawns, by that identifier.
Most of the dump is keyed by a name both editions spell the same way, so the direct read answers first and the rename index is only consulted for the rest.
Parameters
identifier
string
source
Readonly<Record<string, JavaEntityStats>> | undefined
Returns
JavaEntityStats | undefined
movementComponent()
movementComponent(
kind,defaultMaxTurn?):ComponentFactory<EntityHooks,MovementModeParams>
Defined in: entities/src/components/movement.ts:81
Builds one minecraft:movement.<kind> component.
Parameters
kind
string
defaultMaxTurn?
number = 30
Returns
ComponentFactory<EntityHooks, MovementModeParams>
navigationComponent()
navigationComponent(
kind):ComponentFactory<EntityHooks,NavigationParams>
Defined in: entities/src/components/movement.ts:38
Builds one minecraft:navigation.<kind> component.
Parameters
kind
string
Returns
ComponentFactory<EntityHooks, NavigationParams>
noEffects()
noEffects(
event):EventEffects
Defined in: entities/src/eventEngine.ts:99
An EventEffects with nothing in it, which is what an absent event determines.
Parameters
event
string
Returns
numberAt()
numberAt(
body,key,fallback):number
Defined in: entities/src/components/schemas.ts:31
Reads a number from a component body, falling back when the key is absent.
Parameters
body
key
string
fallback
number
Returns
number
numberComponent()
numberComponent(
name,key,fallback):ComponentFactory<EntityHooks,number>
Defined in: entities/src/components/schemas.ts:74
A component whose whole meaning is one number under a key, such as minecraft:scale or minecraft:variant.
Parameters
name
string
key
string
fallback
number
Returns
ComponentFactory<EntityHooks, number>
parseEntityAction()
parseEntityAction(
key,body,report):EntityAction|undefined
Defined in: entities/src/events.ts:225
Parses one event action body into the form the entity carries out.
An action the package implements whose body is unusable, such as a play_sound with no sound, is reported and left unparsed, so it reaches the same report as an action the package does not implement at all.
Parameters
key
string
body
unknown
report
Returns
EntityAction | undefined
The parsed action, or undefined when the key is not one of the nine EntityAction covers or its body cannot be read.
parseEntityDefinition()
parseEntityDefinition(
data,source):ParseEntityResult
Defined in: entities/src/definition.ts:118
Parses one entity file into an EntityDefinition.
Validation is structural. A key the parser does not know loads the file anyway and reports entity.unknownKey, because Mojang's schema types only the top level and a pack written against a newer game must still load.
Parameters
data
unknown
The already-parsed JSON of one entity file.
source
The pack and path diagnostics name.
Returns
parseEventNode()
parseEventNode(
value,report):EventNode
Defined in: entities/src/events.ts:146
Parses one event node, including every nested node.
Nothing throws: an unusable branch reports and is left out, because an entity whose one broken event is dropped still runs.
Parameters
value
unknown
report
Returns
parseEventTarget()
parseEventTarget(
value,report):"self"|"other"|"player"|"target"|"parent"|"baby"|"block"|"holder"
Defined in: entities/src/events.ts:357
Reads a target key, which every shape that names one spells the same way.
Parameters
value
unknown
report
Returns
"self" | "other" | "player" | "target" | "parent" | "baby" | "block" | "holder"
The named target, or self when the key is absent or unknown.
parseFilterValue()
parseFilterValue(
value,label):ParseResult<Filter>
Defined in: entities/src/components/schemas.ts:50
Parses a filter, turning a grammar error into a schema rejection so the component reports through the same report as everything else.
Parameters
value
unknown
label
string
Returns
parseProperties()
parseProperties(
value,identifier,pack,collector):ReadonlyMap<string,PropertyDefinition>
Defined in: entities/src/properties.ts:257
Parses a whole description.properties map, reporting the documented limit of 32 properties per entity type rather than refusing the extras.
Parameters
value
unknown
identifier
string
pack
string
collector
Returns
ReadonlyMap<string, PropertyDefinition>
parsePropertyDefinition()
parsePropertyDefinition(
name,value,report):PropertyDefinition|undefined
Defined in: entities/src/properties.ts:57
Parses one description.properties entry.
A malformed entry reports and yields undefined rather than throwing, so one bad property does not cost the whole entity.
Parameters
name
string
value
unknown
report
(code, message) => void
Where to send findings; each names the property.
Returns
PropertyDefinition | undefined
The parsed property, or undefined when the entry is unusable.
registerEntityComponents()
registerEntityComponents(
registry):EntityComponentRegistry
Defined in: entities/src/components/index.ts:231
Fills a registry with every component this package implements.
Parameters
registry
A fresh registry, or one a server has already put its own components in; registering a name twice is an error, so a caller that overrides a vanilla component registers it before calling this.
Returns
resolveEntityTypes()
resolveEntityTypes(
inputs,options):ResolveEntityResult
Defined in: entities/src/entityType.ts:102
Resolves parsed entity definitions into entity types.
A component name no factory implements resolves the type anyway and is reported once per pack, so "component not implemented" is a line in the load report rather than a missing entity.
Parameters
inputs
Iterable<EntityDefinitionInput>
options
Returns
Throws
In strict mode, when any diagnostic is reported; the error comes from resolveTypes and carries the whole report.
spawnEventFor()
spawnEventFor(
cause,named?):string
Defined in: entities/src/eventEngine.ts:56
Picks the one event that runs when an entity is created.
Exactly one runs. A caller that names an event, which is what /summon, a spawn rule's initial_event, minecraft:spawn_entity.spawn_event and the type<event> form in transformation.into all do, replaces the built-in one rather than adding to it.
Parameters
cause
named?
string
The event the caller asked for, if any.
Returns
string
splitSpawnReference()
splitSpawnReference(
reference):object
Defined in: entities/src/eventEngine.ts:63
Splits the identifier<event> form vanilla writes in transformation.into and permute_type.entity_type, such as minecraft:drowned<minecraft:as_adult>.
Parameters
reference
string
Returns
object
event?
readonlyoptionalevent?:string
identifier
readonlyidentifier:string
statRuling()
statRuling(
identifier,stat):StatRuling
Defined in: entities/src/javaStats.ts:200
How one entity's value for one shared stat resolves.
A caller that has measured a disagreement between the two editions turns it into a reviewed row with this, rather than keeping a second copy of the decision. A bedrock or exception ruling is an accepted divergence with its reason; a java ruling means the resolved value should already be Java's, so a disagreement that still reports one is a defect.
Parameters
identifier
string
The Bedrock entity identifier, such as minecraft:wither.
stat
Returns
stringAt()
stringAt(
body,key):string|undefined
Defined in: entities/src/components/schemas.ts:39
Reads a string from a component body, or undefined when the key is absent.
Parameters
body
key
string
Returns
string | undefined
triggerComponent()
triggerComponent(
name):ComponentFactory<EntityHooks,TriggerComponentParams>
Defined in: entities/src/components/sensors.ts:643
Builds one of the ten event-shaped minecraft:on_* components.
The component carries no hooks because it runs at a fixed point rather than on a schedule of its own. EntityInstance.trigger reads the parsed body back and fires it, which is what makes the component do something: minecraft:damage_sensor and EntityInstance.damage reach the hurt and death ones, and EntityInstance.setAttackTarget reaches the two target ones.
Parameters
name
string