Skip to content

API reference / @jsprismarine/entity-goals

@jsprismarine/entity-goals ​

Join the Discord Servernpm

All 170 vanilla Bedrock minecraft:behavior.* goals, plus the A* path finder they navigate with. It is written against the goal seam of @jsprismarine/entities, which owns the Goal interface, the priority and control_flags parsing and the scheduler; this package owns what each goal does.

typescript
import { EntityTypes } from '@jsprismarine/entities';
import { createGoalEntityRegistry } from '@jsprismarine/entity-goals';

const types = new EntityTypes({ components: createGoalEntityRegistry({ world: (entity) => worlds.get(entity) }) });
const zombie = types.spawn('minecraft:zombie', { environment: { actuator } });

zombie.tick(); // the scheduler runs one goal per control flag

createGoalEntityRegistry registers these goals first and then every non-goal component the entity runtime implements. The order matters: registerEntityComponents skips a name that is already registered, and it ships its own reference versions of float, random_stroll and look_at_player. Calling registerVanillaGoals(registry) on a registry that already holds those three leaves them alone and returns their names.

The goal inventory ​

utils/build-inventory.ts reads the composed vanilla behavior pack and writes src/generated/goalInventory.json: every goal name, how many of the 129 entity files use it, the union of parameter keys observed under it with their JSON types, and which entities carry it. Everything here is written against that file, and src/totality.test.ts fails when a name in it has no registered factory.

Regenerate it with pnpm --filter @jsprismarine/entity-goals run inventory, which needs the sources pnpm --filter @jsprismarine/bedrock-data run fetch:sources caches.

Measured against Bedrock Dedicated Server 1.26.51.1:

MeasureResult
Entity definitions129
Distinct minecraft:behavior.* names170
Names with a registered factory170
Entities whose every goal is implemented129 of 129
Entities that declare at least one goal92
Entities with no goals at all37
Most goals on one entity27 (minecraft:villager_v2)
Goals exactly one entity uses91
Goals at most two entities use123

The twenty most used goals, with how many entity files declare each: look_at_player 69, random_stroll 64, random_look_around 55, float 49, nearest_attackable_target 49, hurt_by_target 42, panic 37, melee_box_attack 32, tempt 31, avoid_mob_type 28, breed 26, mount_pathing 26, follow_parent 24, pickup_items 20, equip_item 17, ranged_attack 14, random_swim 12, player_ride_tamed 10, find_mount 8, flee_sun 7.

Where the values come from ​

Thirty of Java's goal class names match a Bedrock goal name after snake-casing, so for those the constants are read out of the unobfuscated 26.3 server jar rather than guessed, and the JSDoc on the goal names the class. Examples: the 0.02 chance per tick and the 40 to 80 tick hold in look_at_player are LookAtPlayerGoal.DEFAULT_PROBABILITY and its start; the 20-tick swing cadence and 10-tick re-path interval in the melee goals are MeleeAttackGoal; the 2-to-4-block window and 1-in-5 roll in leap_at_target are LeapAtTargetGoal; the 8-block partner search, 60-tick courtship and 3-block distance in breed are BreedGoal; the 300-tick revenge memory in hurt_by_target is HurtByTargetGoal.

Where the two editions disagree the Bedrock parameter wins, because these are Bedrock definitions. Two cases are worth naming. Java's TemptGoal scares the entity off when the player moves more than 0.1 blocks or turns more than 5 degrees; Bedrock spells that as the single can_get_scared flag, which is parsed and handed to the server, because the goal seam carries no player rotation. Java splits melee into one class; Bedrock has melee_attack and melee_box_attack, which differ in whether the reach test uses the distance or the collision boxes, and with no collision boxes in the seam both run the same loop with reach_multiplier as the only difference.

The navigation model ​

findPath is A* over whole blocks against an injected NavigationView. A server implements the view; the first four members are required and the rest are optional, so a goal degrades rather than throwing when the server cannot answer one yet.

typescript
export interface NavigationView {
    blockAt(position: EntityPosition): string | undefined;
    isPassable(position: EntityPosition): boolean;
    isSolid(position: EntityPosition): boolean;
    isWater(position: EntityPosition): boolean;
    isLava(position: EntityPosition): boolean;
    doorAt?(position: EntityPosition): DoorState | undefined;
    isDamaging?(position: EntityPosition): boolean;
    isSunlit?(position: EntityPosition): boolean;
    isPortal?(position: EntityPosition): boolean;
    isClimbable?(position: EntityPosition): boolean;
    isLadder?(position: EntityPosition): boolean;
}

Three media decide which cells a profile may enter, and a cell is enterable when any enabled medium accepts it: ground when the entity stands on something, swim when the cell is a liquid it moves through, and fly when the cell is open air. minecraft:navigation.climb adds vertical moves through climbable blocks, while minecraft:can_climb enables vertical moves through ladder blocks for any navigation type. A ground move keeps its height, steps up one block when the profile jumps, or falls to the first supported cell within the fall limit. Diagonal moves cost sqrt(2) and may not cut a corner.

NavigationProfile comes from the entity's active minecraft:navigation.* component, which @jsprismarine/entities already parses, plus three facts that component does not carry: the height from minecraft:collision_box, the step height from minecraft:variable_max_auto_step, and a fall limit of 3 blocks. The separate minecraft:can_climb marker adds ladder traversal. The flags map onto the search like this.

  • can_pass_doors, can_open_doors, can_open_iron_doors, can_break_doors. An open door needs can_pass_doors. A closed one needs can_open_doors, and an iron one needs can_open_iron_doors as well, or can_break_doors.
  • avoid_water. A water cell costs 8 extra when the profile can float, swim or is amphibious, and is refused otherwise.
  • can_path_over_water, can_path_over_lava, can_walk_in_lava. These decide whether a liquid below the entity carries it, and whether a lava cell may be entered at all.
  • avoid_damage_blocks, avoid_portals, blocks_to_avoid. These refuse a cell outright.
  • avoid_sun. A sunlit cell costs 8 extra rather than being refused, so an entity still paths when there is no shade. flee_sun is the goal that refuses sunlight outright.
  • can_fly, can_swim, can_walk, is_amphibious, can_float. These enable the three media.

The search expands at most 512 nodes unless the caller raises the budget, and returns the closest node it reached only when the request asks for a partial path.

Navigator is the one place that calls the path finder. A goal says where it wants to be and the navigator feeds the actuator one waypoint at a time. With no NavigationView it hands the destination straight to EntityActuator.moveTo and tracks arrival by distance, which is the degraded mode a server gets before it implements the view.

The two seams a server satisfies ​

EntityActuator, from @jsprismarine/entities, is unchanged: position, moveTo, stopMoving, lookAt, jump, randomTarget and nearestPlayer. The goals here use all seven. randomTarget is only consulted when no NavigationView is supplied; with one, the navigator draws candidates and keeps the first the path finder reaches.

GoalWorld is this package's own seam, because the vanilla goals attack, search for blocks, pick up items, mount, trade, breed and teleport, and nothing in EntityActuator reaches any of that. Every member is optional, following the convention FilterEntityView sets: a goal whose world cannot answer what it needs refuses to start. A server supplies one per entity through registerVanillaGoals(registry, { world }).

The members, grouped by what needs them:

  • Sight and surroundings: navigation, mobs, players, items, blocks, canSee, poi, home, setHome.
  • Combat: target, setTarget, damagers, lastPusher, attack, shoot, knockback, push, explode.
  • Items: pickUp, dropItem, giveItem, carriedItem, setCarriedItem, inventory, dropLoot.
  • Blocks and the world: setBlock, breakBlock, spawn, teleportTo, playSound.
  • Relationships: owner, vehicle, riders, mount, dismount, canBreedWith, isReadyToBreed, breedWith, openTrade, tradingPlayer.
  • Flags and reporting: setSitting, setSleeping, trigger, report.

mobs(radius, families) may use the optional family list to narrow a candidate search. It must include every entity in those families; the goal still evaluates the complete data-driven filter before choosing a target.

Everything a filter can already answer is read through EntityInstance.filterContext rather than added here, so the entity's own flags (in_water, is_baby, is_sitting, on_ground and the rest), the time of day and the weather need no new member.

GoalWorld.trigger exists because a goal event with a target other than self has to be routed by the server. An event aimed at self goes through EntityInstance.fire, so its effects land on the entity's next tick like every other event.

Families ​

FileGoalsWhat they share
goals/targeting.ts9Find, hold and release the attack target; no control flags
goals/attacking.ts30Read the target and hurt it; move and look
goals/looking.ts6Turn the head; look only
goals/movement.ts44Wander, swim, fly, flee, follow and walk to a found position
goals/social.ts26Breeding, tempting, owners, mounting, trading and gifts
goals/work.ts14Jobs, farming, item pickup and placing blocks
goals/environment.ts17Sleeping, hiding, sitting and eating a block
goals/specials.ts24The dragon phases and 200-tick death animation, the squid states, the slime and the timer flags

Testing ​

src/harness.ts ships the doubles the package's own tests use, and a server can check its seam implementations against the same ones. RecordingActuator logs every call and moves the entity to whatever it was asked to walk to, voxelGrid builds a NavigationView from layers of text, and GoalHarness puts a real EntityInstance with a real scheduler behind both.

typescript
const harness = new GoalHarness({
    goals: { 'minecraft:behavior.float': { priority: 0, chance_per_tick_to_float: 1 } },
    flags: { in_water: true }
});

harness.tick(3);
harness.holderOf('jump'); // 'minecraft:behavior.float'

src/scheduler.test.ts runs the zombie's nine base goals, with the priorities the vanilla file writes, and shows which goal holds each flag as a player comes into range.

What is left to the server ​

Four things the goals parse and hand over rather than carry out, because the behavior belongs somewhere else.

  • The explosion itself. minecraft:behavior.swell holds the creeper still and the minecraft:explode component does the rest.
  • Villager points of interest. Bedrock has no memory or point-of-interest registry at all, so the work site, the bed, the bell and the village come through GoalWorld.poi and the server decides what counts.
  • Whether two entities may breed. minecraft:breedable owns that rule, so breed and make_love ask GoalWorld.canBreedWith.
  • The ender dragon's flight path. Its eight phase goals are {"priority": n} in the vanilla file and nothing else, so each one holds its phase's control flags for a fixed time and leaves the flight to the server.

Classes ​

Interfaces ​

AdmireItemParams ​

Defined in: goals/social.ts:1093

What minecraft:behavior.admire_item declares.

Properties ​

admireSound ​

readonly admireSound: string | undefined

Defined in: goals/social.ts:1094

onStart ​

readonly onStart: GoalEvent | undefined

Defined in: goals/social.ts:1096

onStop ​

readonly onStop: GoalEvent | undefined

Defined in: goals/social.ts:1097

soundInterval ​

readonly soundInterval: Range

Defined in: goals/social.ts:1095


AvoidBlockParams ​

Defined in: goals/movement.ts:641

What minecraft:behavior.avoid_block declares.

Properties ​

avoidBlockSound ​

readonly avoidBlockSound: string | undefined

Defined in: goals/movement.ts:654

onEscape ​

readonly onEscape: readonly GoalEvent[]

Defined in: goals/movement.ts:656

searchHeight ​

readonly searchHeight: number

Defined in: goals/movement.ts:647

How far it looks vertically, in blocks.

searchRange ​

readonly searchRange: number

Defined in: goals/movement.ts:645

How far it looks for them horizontally, in blocks.

selectionMethod ​

readonly selectionMethod: string

Defined in: goals/movement.ts:649

How the entity picks between the blocks it found.

soundInterval ​

readonly soundInterval: Range

Defined in: goals/movement.ts:655

sprintSpeedModifier ​

readonly sprintSpeedModifier: number

Defined in: goals/movement.ts:653

targetBlocks ​

readonly targetBlocks: readonly string[]

Defined in: goals/movement.ts:643

The blocks the entity runs from.

tickInterval ​

readonly tickInterval: number

Defined in: goals/movement.ts:651

How many ticks between searches.

walkSpeedModifier ​

readonly walkSpeedModifier: number

Defined in: goals/movement.ts:652


AvoidMobTypeParams ​

Defined in: goals/movement.ts:541

What minecraft:behavior.avoid_mob_type declares.

Properties ​

avoidSound ​

readonly avoidSound: string | undefined

Defined in: goals/movement.ts:553

entityTypes ​

readonly entityTypes: readonly TargetEntityType[]

Defined in: goals/movement.ts:542

ignoreVisibility ​

readonly ignoreVisibility: boolean

Defined in: goals/movement.ts:548

Whether the entity runs from something it cannot see.

maxDistance ​

readonly maxDistance: number

Defined in: goals/movement.ts:544

How far the entity notices something to avoid, in blocks.

maxFlee ​

readonly maxFlee: number

Defined in: goals/movement.ts:546

How far the entity runs, in blocks.

onEscapeEvent ​

readonly onEscapeEvent: GoalEvent | undefined

Defined in: goals/movement.ts:555

probabilityPerStrength ​

readonly probabilityPerStrength: number

Defined in: goals/movement.ts:552

How likely the entity is to flee per point of the threat's strength.

removeTarget ​

readonly removeTarget: boolean

Defined in: goals/movement.ts:550

Whether the entity drops its attack target when it starts fleeing.

soundInterval ​

readonly soundInterval: Range

Defined in: goals/movement.ts:554


BlockQuery ​

Defined in: world.ts:103

What a goal searches the world for, as the block-seeking goals describe it.

Properties ​

height ​

readonly height: number

Defined in: world.ts:109

How far to look vertically, in blocks.

identifiers? ​

readonly optional identifiers?: readonly string[]

Defined in: world.ts:105

Identifiers to match; an empty or absent list matches every block.

limit? ​

readonly optional limit?: number

Defined in: world.ts:111

Maximum number of nearest matches to return; omitted returns every match.

range ​

readonly range: number

Defined in: world.ts:107

How far to look horizontally, in blocks.


BreedParams ​

Defined in: goals/social.ts:64

What minecraft:behavior.breed declares.

Properties ​

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/social.ts:65


CelebrateParams ​

Defined in: goals/specials.ts:411

What minecraft:behavior.celebrate declares.

Properties ​

celebrationSound ​

readonly celebrationSound: string | undefined

Defined in: goals/specials.ts:418

duration ​

readonly duration: number

Defined in: goals/specials.ts:413

How long the celebration lasts, in ticks.

jumpInterval ​

readonly jumpInterval: Range

Defined in: goals/specials.ts:415

How long between jumps, in ticks.

onCelebrationEnd ​

readonly onCelebrationEnd: GoalEvent | undefined

Defined in: goals/specials.ts:419

soundInterval ​

readonly soundInterval: Range

Defined in: goals/specials.ts:417

How long between sounds, in ticks.


CelebrateSurviveParams ​

Defined in: goals/specials.ts:469

What minecraft:behavior.celebrate_survive declares.

Properties ​

duration ​

readonly duration: number

Defined in: goals/specials.ts:471

How long the celebration lasts, in ticks.

fireworksInterval ​

readonly fireworksInterval: Range

Defined in: goals/specials.ts:473

How long between fireworks, in ticks.

onCelebrationEnd ​

readonly onCelebrationEnd: GoalEvent | undefined

Defined in: goals/specials.ts:474


ChargeAttackParams ​

Defined in: goals/attacking.ts:413

What a charge-style attack declares.

Properties ​

attackReach ​

readonly attackReach: number

Defined in: goals/attacking.ts:421

How close the charge has to come to connect, in blocks.

chargeSpeed ​

readonly chargeSpeed: number

Defined in: goals/attacking.ts:415

How fast the entity charges, as a speed multiplier.

cooldown ​

readonly cooldown: Range

Defined in: goals/attacking.ts:425

How long between charges, in ticks.

knockbackForce ​

readonly knockbackForce: number

Defined in: goals/attacking.ts:423

How hard the hit throws the target.

maxChargeDistance ​

readonly maxChargeDistance: number

Defined in: goals/attacking.ts:417

How far the charge reaches, in blocks.

overshootDistance ​

readonly overshootDistance: number

Defined in: goals/attacking.ts:419

How far past the target the entity runs, in blocks.


ChargeHeldItemParams ​

Defined in: goals/attacking.ts:1592

What minecraft:behavior.charge_held_item declares.

Properties ​

items ​

readonly items: readonly string[]

Defined in: goals/attacking.ts:1594

The items the entity charges, such as minecraft:arrow.


CircleAroundAnchorParams ​

Defined in: goals/movement.ts:1383

What minecraft:behavior.circle_around_anchor declares.

Properties ​

goalRadius ​

readonly goalRadius: number

Defined in: goals/movement.ts:1385

How close to the circle counts as on it, in blocks.

heightAboveTargetRange ​

readonly heightAboveTargetRange: Range

Defined in: goals/movement.ts:1387

How high above the anchor the entity flies, in blocks.

heightOffsetRange ​

readonly heightOffsetRange: Range

Defined in: goals/movement.ts:1389

How much the height drifts between circuits, in blocks.


CroakParams ​

Defined in: goals/environment.ts:568

What minecraft:behavior.croak declares.

Properties ​

duration ​

readonly duration: Range

Defined in: goals/environment.ts:570

How long one croak lasts, in ticks.

filters ​

readonly filters: Filter | undefined

Defined in: goals/environment.ts:574

What has to be true for the entity to croak.

interval ​

readonly interval: Range

Defined in: goals/environment.ts:572

How long between croaks, in ticks.


DefendTrustedTargetParams ​

Defined in: goals/targeting.ts:322

What minecraft:behavior.defend_trusted_target declares.

Properties ​

aggroSound ​

readonly aggroSound: string | undefined

Defined in: goals/targeting.ts:327

The sound the entity plays when it takes a target.

entityTypes ​

readonly entityTypes: readonly TargetEntityType[]

Defined in: goals/targeting.ts:323

mustSee ​

readonly mustSee: boolean

Defined in: goals/targeting.ts:325

onDefendStart ​

readonly onDefendStart: GoalEvent | undefined

Defined in: goals/targeting.ts:329

The event fired when the goal starts defending.

withinRadius ​

readonly withinRadius: number

Defined in: goals/targeting.ts:324


DefendVillageTargetParams ​

Defined in: goals/targeting.ts:381

What minecraft:behavior.defend_village_target declares.

Properties ​

entityTypes ​

readonly entityTypes: readonly TargetEntityType[]

Defined in: goals/targeting.ts:382

mustReach ​

readonly mustReach: boolean

Defined in: goals/targeting.ts:383


DelayedAttackParams ​

Defined in: goals/attacking.ts:211

What minecraft:behavior.delayed_attack declares.

Extends ​

Properties ​

attackDuration ​

readonly attackDuration: number

Defined in: goals/attacking.ts:213

How long one swing takes, in ticks.

attackOnce ​

readonly attackOnce: boolean

Defined in: goals/attacking.ts:140

Inherited from ​

MeleeAttackParams.attackOnce

canSpreadOnFire ​

readonly canSpreadOnFire: boolean

Defined in: goals/attacking.ts:149

Inherited from ​

MeleeAttackParams.canSpreadOnFire

cooldownTime ​

readonly cooldownTime: number

Defined in: goals/attacking.ts:144

How long between swings, in ticks.

Inherited from ​

MeleeAttackParams.cooldownTime

hitDelayPercent ​

readonly hitDelayPercent: number

Defined in: goals/attacking.ts:215

How far into the swing the damage lands, in [0, 1].

meleeFov ​

readonly meleeFov: number

Defined in: goals/attacking.ts:148

How wide the swing arc is, in degrees.

Inherited from ​

MeleeAttackParams.meleeFov

onAttack ​

readonly onAttack: GoalEvent | undefined

Defined in: goals/attacking.ts:150

Inherited from ​

MeleeAttackParams.onAttack

onKill ​

readonly onKill: GoalEvent | undefined

Defined in: goals/attacking.ts:151

Inherited from ​

MeleeAttackParams.onKill

randomStopInterval ​

readonly randomStopInterval: number

Defined in: goals/attacking.ts:142

Inherited from ​

MeleeAttackParams.randomStopInterval

reachMultiplier ​

readonly reachMultiplier: number

Defined in: goals/attacking.ts:146

How far a swing reaches, as a multiple of the entity's width.

Inherited from ​

MeleeAttackParams.reachMultiplier

requireCompletePath ​

readonly requireCompletePath: boolean

Defined in: goals/attacking.ts:141

Inherited from ​

MeleeAttackParams.requireCompletePath

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/attacking.ts:138

Inherited from ​

MeleeAttackParams.speedMultiplier

trackTarget ​

readonly trackTarget: boolean

Defined in: goals/attacking.ts:139

Inherited from ​

MeleeAttackParams.trackTarget


DigParams ​

Defined in: goals/environment.ts:635

What minecraft:behavior.dig declares.

Properties ​

duration ​

readonly duration: number

Defined in: goals/environment.ts:637

How long the dig takes, in ticks.

idleTime ​

readonly idleTime: number

Defined in: goals/environment.ts:639

How long the entity stands still first, in ticks.

onStart ​

readonly onStart: GoalEvent | undefined

Defined in: goals/environment.ts:644

suspicionIsDisturbance ​

readonly suspicionIsDisturbance: boolean

Defined in: goals/environment.ts:641

Whether a suspicion interrupts the dig.

vibrationIsDisturbance ​

readonly vibrationIsDisturbance: boolean

Defined in: goals/environment.ts:643

Whether a vibration interrupts it.


DoorState ​

Defined in: navigation/view.ts:20

One door the path finder meets, as can_pass_doors and its siblings read it.

Properties ​

iron ​

readonly iron: boolean

Defined in: navigation/view.ts:24

Whether only a mechanism can open it, which is what can_open_iron_doors covers.

open ​

readonly open: boolean

Defined in: navigation/view.ts:22

Whether the door stands open now.


DrinkPotionParams ​

Defined in: goals/attacking.ts:1551

What minecraft:behavior.drink_potion declares.

Properties ​

potions ​

readonly potions: readonly PotionChoice[]

Defined in: goals/attacking.ts:1552

speedModifier ​

readonly speedModifier: number

Defined in: goals/attacking.ts:1553


DropItemForParams ​

Defined in: goals/social.ts:1137

What minecraft:behavior.drop_item_for declares.

Properties ​

cooldown ​

readonly cooldown: number

Defined in: goals/social.ts:1140

How long before the entity gives another present, in ticks.

dropChance ​

readonly dropChance: number

Defined in: goals/social.ts:1142

The chance of actually dropping something, in [0, 1].

entityTypes ​

readonly entityTypes: readonly TargetEntityType[]

Defined in: goals/social.ts:1138

goalRadius ​

readonly goalRadius: number

Defined in: goals/social.ts:1148

How close counts as arriving, in blocks.

lootTable ​

readonly lootTable: string | undefined

Defined in: goals/social.ts:1144

The table the present is rolled from.

offeringDistance ​

readonly offeringDistance: number

Defined in: goals/social.ts:1146

How close the entity drops the present, in blocks.

onDropAttempt ​

readonly onDropAttempt: GoalEvent | undefined

Defined in: goals/social.ts:1155

searchHeight ​

readonly searchHeight: number

Defined in: goals/social.ts:1150

searchRange ​

readonly searchRange: number

Defined in: goals/social.ts:1149

secondsBeforePickup ​

readonly secondsBeforePickup: number

Defined in: goals/social.ts:1152

How long before the recipient may pick the present up, in ticks.

timeOfDayRange ​

readonly timeOfDayRange: Range

Defined in: goals/social.ts:1154

The hours of the day the goal runs in, in ticks.


EatBlockPair ​

Defined in: goals/environment.ts:393

One eat_and_replace_block_pairs entry: what the entity eats and what is left.

Properties ​

eatBlock ​

readonly eatBlock: string

Defined in: goals/environment.ts:395

The block the entity eats.

replaceBlock ​

readonly replaceBlock: string

Defined in: goals/environment.ts:397

What stands there afterward.


EatBlockParams ​

Defined in: goals/environment.ts:401

What minecraft:behavior.eat_block declares.

Properties ​

onEat ​

readonly onEat: GoalEvent | undefined

Defined in: goals/environment.ts:408

pairs ​

readonly pairs: readonly EatBlockPair[]

Defined in: goals/environment.ts:403

The blocks the entity eats, each with its replacement.

successChance ​

readonly successChance: string | undefined

Defined in: goals/environment.ts:407

The Molang expression deciding whether one attempt works.

timeUntilEat ​

readonly timeUntilEat: number

Defined in: goals/environment.ts:405

How long one mouthful takes, in ticks.


EatMobParams ​

Defined in: goals/attacking.ts:1468

What minecraft:behavior.eat_mob declares.

Properties ​

eatAnimationTime ​

readonly eatAnimationTime: number

Defined in: goals/attacking.ts:1470

How long the swallow animation takes, in ticks.

eatSound ​

readonly eatSound: string | undefined

Defined in: goals/attacking.ts:1476

lootTable ​

readonly lootTable: string | undefined

Defined in: goals/attacking.ts:1478

The loot the swallowed mob leaves behind.

pullInForce ​

readonly pullInForce: number

Defined in: goals/attacking.ts:1474

How hard the prey is pulled in.

reachMobDistance ​

readonly reachMobDistance: number

Defined in: goals/attacking.ts:1472

How close the prey has to come, in blocks.

runSpeed ​

readonly runSpeed: number

Defined in: goals/attacking.ts:1475


EmergeParams ​

Defined in: goals/specials.ts:383

What minecraft:behavior.emerge declares.

Properties ​

duration ​

readonly duration: number

Defined in: goals/specials.ts:385

How long the emerge animation lasts, in ticks.

onDone ​

readonly onDone: GoalEvent | undefined

Defined in: goals/specials.ts:386


ExploreOutskirtsParams ​

Defined in: goals/movement.ts:1286

What minecraft:behavior.explore_outskirts declares.

Properties ​

exploreDistance ​

readonly exploreDistance: number

Defined in: goals/movement.ts:1289

How far from the village edge the entity wanders, in blocks.

maxWaitTime ​

readonly maxWaitTime: number

Defined in: goals/movement.ts:1291

How long it waits at the destination, in ticks.

minDistanceFromTarget ​

readonly minDistanceFromTarget: number

Defined in: goals/movement.ts:1293

How far the destination has to be from the entity, in blocks.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/movement.ts:1287


FarmParams ​

Defined in: goals/work.ts:351

What the farm goals declare.

Properties ​

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/work.ts:352


FindMountParams ​

Defined in: goals/social.ts:511

What minecraft:behavior.find_mount declares.

Properties ​

avoidWater ​

readonly avoidWater: boolean

Defined in: goals/social.ts:521

Whether it refuses a mount standing in water.

maxFailedAttempts ​

readonly maxFailedAttempts: number

Defined in: goals/social.ts:517

How many failures it takes before it gives up.

mountDistance ​

readonly mountDistance: number

Defined in: goals/social.ts:519

How close it has to be to climb on, in blocks.

startDelay ​

readonly startDelay: number

Defined in: goals/social.ts:515

How long it waits before the first attempt, in ticks.

targetNeeded ​

readonly targetNeeded: boolean

Defined in: goals/social.ts:523

Whether it only looks for a mount while it has a target.

withinRadius ​

readonly withinRadius: number

Defined in: goals/social.ts:513

How far the entity looks for something to ride, in blocks.


FireAtTargetParams ​

Defined in: goals/attacking.ts:349

What minecraft:behavior.fire_at_target declares.

Properties ​

attackCooldown ​

readonly attackCooldown: number

Defined in: goals/attacking.ts:351

How long between shots, in ticks.

attackRange ​

readonly attackRange: Range

Defined in: goals/attacking.ts:353

How far the target may be for the goal to fire, in blocks.

postShootDelay ​

readonly postShootDelay: number

Defined in: goals/attacking.ts:359

How long the entity holds the pose after the shot, in ticks.

preShootDelay ​

readonly preShootDelay: number

Defined in: goals/attacking.ts:357

How long the entity aims before the shot, in ticks.

projectile ​

readonly projectile: string | undefined

Defined in: goals/attacking.ts:355

The projectile entity to create.

rangedFov ​

readonly rangedFov: number

Defined in: goals/attacking.ts:361

How wide the firing arc is, in degrees.


FloatWanderParams ​

Defined in: goals/movement.ts:232

What minecraft:behavior.float_wander declares.

Extends ​

Properties ​

floatDuration ​

readonly floatDuration: Range

Defined in: goals/movement.ts:234

How long one drift lasts, in ticks.

hasMoveControl ​

readonly hasMoveControl: boolean

Defined in: goals/movement.ts:238

Whether the goal steers the entity itself rather than through the move control.

interval ​

readonly interval: number

Defined in: goals/movement.ts:113

One tick in this many starts a walk.

Inherited from ​

WanderParams.interval

mustReach ​

readonly mustReach: boolean

Defined in: goals/movement.ts:240

Whether the destination has to be reachable.

randomReselect ​

readonly randomReselect: boolean

Defined in: goals/movement.ts:236

Whether a new destination is drawn before the old one is reached.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/movement.ts:107

Inherited from ​

WanderParams.speedMultiplier

useHomePositionRestriction ​

readonly useHomePositionRestriction: boolean

Defined in: goals/movement.ts:242

Whether the drift stays inside the entity's home radius.

xzDistance ​

readonly xzDistance: number

Defined in: goals/movement.ts:109

How far the destination may be horizontally, in blocks.

Inherited from ​

WanderParams.xzDistance

yDistance ​

readonly yDistance: number

Defined in: goals/movement.ts:111

How far it may be vertically, in blocks.

Inherited from ​

WanderParams.yDistance

yOffset ​

readonly yOffset: number

Defined in: goals/movement.ts:244

How high above the drawn position the entity floats, in blocks.


FollowOwnerParams ​

Defined in: goals/social.ts:351

What minecraft:behavior.follow_owner declares.

Properties ​

canTeleport ​

readonly canTeleport: boolean

Defined in: goals/social.ts:358

Whether the entity teleports when it cannot walk to the owner.

ignoreVibration ​

readonly ignoreVibration: boolean

Defined in: goals/social.ts:362

Whether the entity follows an owner who is sneaking away.

postTeleportDistance ​

readonly postTeleportDistance: number

Defined in: goals/social.ts:360

How far from the owner a teleport lands, in blocks; -1 uses the stop distance.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/social.ts:352

startDistance ​

readonly startDistance: number

Defined in: goals/social.ts:354

How far away the owner has to be before the entity sets off, in blocks.

stopDistance ​

readonly stopDistance: number

Defined in: goals/social.ts:356

How close the entity gets before it stops, in blocks.


FollowParams ​

Defined in: goals/movement.ts:1647

What the follow goals declare.

Properties ​

filters ​

readonly filters: Filter | undefined

Defined in: goals/movement.ts:1656

Which entities are worth following.

preferredActorType ​

readonly preferredActorType: string | undefined

Defined in: goals/movement.ts:1658

A type name that beats the filters when both match.

searchRange ​

readonly searchRange: number

Defined in: goals/movement.ts:1650

How far the goal looks for whom to follow, in blocks.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/movement.ts:1648

startDistance ​

readonly startDistance: number

Defined in: goals/movement.ts:1654

How far away the entity has to be before it starts following, in blocks.

stopDistance ​

readonly stopDistance: number

Defined in: goals/movement.ts:1652

How close the entity gets before it stops, in blocks.


GiveItemsParams ​

Defined in: goals/social.ts:1224

What the give-items goals declare.

Properties ​

onItemThrow ​

readonly onItemThrow: readonly GoalEvent[]

Defined in: goals/social.ts:1227

runSpeed ​

readonly runSpeed: number

Defined in: goals/social.ts:1225

throwSound ​

readonly throwSound: string | undefined

Defined in: goals/social.ts:1226


GoalBlock ​

Defined in: world.ts:96

One block a block search found.

Properties ​

identifier ​

readonly identifier: string

Defined in: world.ts:99

The block identifier, such as minecraft:farmland.

position ​

readonly position: EntityPosition

Defined in: world.ts:97


GoalCoverage ​

Defined in: inventory.ts:66

How far a set of implemented goal names gets against the vanilla pack.

Properties ​

entities ​

readonly entities: number

Defined in: inventory.ts:70

How many entities have every goal they declare in the set.

entitiesWithGoals ​

readonly entitiesWithGoals: number

Defined in: inventory.ts:72

How many of those entities declare at least one goal.

goals ​

readonly goals: number

Defined in: inventory.ts:68

How many of the inventory's goals the set covers.

missing ​

readonly missing: readonly string[]

Defined in: inventory.ts:74

The goal names the set leaves out, in descending use order.


GoalDamage ​

Defined in: world.ts:115

What one entity did to this one, as the hurt and revenge goals read it.

Properties ​

cause ​

readonly cause: string

Defined in: world.ts:119

The damage cause, such as entity_attack.

mob ​

readonly mob: GoalMob | undefined

Defined in: world.ts:117

Who dealt it, or undefined when the source was not an entity.

total ​

readonly total: number

Defined in: world.ts:121

How much damage this source has dealt in total.


GoalDefinition ​

Defined in: goal.ts:21

One goal implementation, with the parameters its component body parses into.

Type Parameters ​

P ​

P

Properties ​

controlFlags ​

readonly controlFlags: readonly ("move" | "look" | "jump")[]

Defined in: goal.ts:25

The control flags the goal holds when the definition names none.

name ​

readonly name: string

Defined in: goal.ts:23

The component name, such as minecraft:behavior.random_stroll.

schema ​

readonly schema: ComponentSchema<P>

Defined in: goal.ts:27

Parses the goal's own parameters; priority and control_flags are handled by the wrapper.

Methods ​

create() ​

create(params, support): Goal

Defined in: goal.ts:29

Builds the goal for one entity, each time its component initializes.

Parameters ​
params ​

P

support ​

GoalSupport

Returns ​

Goal


GoalEvent ​

Defined in: params.ts:98

An event a goal fires at one of its moments, such as on_attack or on_tempt_end.

Properties ​

event ​

readonly event: string

Defined in: params.ts:100

The event name to fire.

filters? ​

readonly optional filters?: Filter

Defined in: params.ts:104

The filters that gate it, when the body carries any.

target ​

readonly target: string

Defined in: params.ts:102

Who to fire it on; self unless the body says otherwise.


GoalHarnessOptions ​

Defined in: harness.ts:142

Options for a GoalHarness.

Properties ​

at? ​

readonly optional at?: EntityPosition

Defined in: harness.ts:154

Where the entity starts.

components? ​

readonly optional components?: Readonly<Record<string, unknown>>

Defined in: harness.ts:146

Any other components, such as minecraft:navigation.walk or minecraft:collision_box.

flags? ​

readonly optional flags?: Partial<Record<"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", boolean>>

Defined in: harness.ts:156

The entity's own boolean facts, such as in_water.

goals ​

readonly goals: Readonly<Record<string, unknown>>

Defined in: harness.ts:144

The minecraft:behavior.* components to put on the entity, with their bodies.

headEquipped? ​

readonly optional headEquipped?: boolean

Defined in: harness.ts:158

Whether the entity has a test helmet in its head slot.

identifier? ​

readonly optional identifier?: string

Defined in: harness.ts:161

random? ​

readonly optional random?: () => number

Defined in: harness.ts:150

Draws the goals' random numbers; defaults to a seeded generator, so a run repeats.

Returns ​

number

randomInt? ​

readonly optional randomInt?: (bound) => number

Defined in: harness.ts:152

Draws Java bounded integers directly, so tests can check their exact order and count.

Parameters ​
bound ​

number

Returns ​

number

world? ​

readonly optional world?: GoalWorld

Defined in: harness.ts:148

The world seam; every member the test leaves out answers nothing.

worldFacts? ​

readonly optional worldFacts?: FilterWorldView

Defined in: harness.ts:160

The world facts the time and weather tests read.


GoalInventory ​

Defined in: inventory.ts:39

What utils/build-inventory.ts measures from one vanilla behavior pack.

Properties ​

entities ​

readonly entities: readonly string[]

Defined in: inventory.ts:45

Every entity identifier in the pack, sorted, including the ones with no goals.

entityCount ​

readonly entityCount: number

Defined in: inventory.ts:42

goalCount ​

readonly goalCount: number

Defined in: inventory.ts:43

goals ​

readonly goals: readonly GoalUse[]

Defined in: inventory.ts:47

Every goal, most used first, ties broken by name.

source ​

readonly source: string

Defined in: inventory.ts:41

The pack the measurement came from, such as Bedrock Dedicated Server 1.26.51.1.


GoalItem ​

Defined in: world.ts:54

One item stack lying in the world, as the pickup goals read it.

Properties ​

filterView? ​

readonly optional filterView?: FilterItemView

Defined in: world.ts:62

Item tags, auxiliary data, and components for shareable item rules.

id ​

readonly id: string | number

Defined in: world.ts:55

Methods ​

count() ​

count(): number

Defined in: world.ts:60

How many items the stack holds.

Returns ​

number

identifier() ​

identifier(): string

Defined in: world.ts:58

The item identifier, such as minecraft:wheat.

Returns ​

string

position() ​

position(): EntityPosition

Defined in: world.ts:56

Returns ​

EntityPosition


GoalItemCraft ​

Defined in: world.ts:80

One recipe-backed conversion prepared for an entity to share.

Properties ​

craftedCount ​

readonly craftedCount: number

Defined in: world.ts:90

The total number of output items the recipe produces.

inputCount ​

readonly inputCount: number

Defined in: world.ts:86

The number of input items this transfer consumes.

inputIdentifier ​

readonly inputIdentifier: string

Defined in: world.ts:84

The item identifier consumed by the recipe.

outputCount ​

readonly outputCount: number

Defined in: world.ts:92

The number of output items this transfer gives away.

outputIdentifier ​

readonly outputIdentifier: string

Defined in: world.ts:88

The item identifier the recipe produces.

recipeId ​

readonly recipeId: string

Defined in: world.ts:82

The recipe that produces the shared item.


GoalMob ​

Defined in: world.ts:26

One other entity a goal can see, compare a filter against, or act on.

Properties ​

id ​

readonly id: string | number

Defined in: world.ts:28

A stable identity, so a goal can tell two candidates apart between ticks.

Methods ​

health()? ​

optional health(): number | undefined

Defined in: world.ts:46

Its current health, for the attack goals that stop at a threshold.

Returns ​

number | undefined

heldItem()? ​

optional heldItem(): string | undefined

Defined in: world.ts:38

What it holds in its main hand, for tempt, beg, barter and the item goals.

Returns ​

string | undefined

identifier()? ​

optional identifier(): string | undefined

Defined in: world.ts:36

Its entity type, such as minecraft:villager_v2.

Returns ​

string | undefined

inventory()? ​

optional inventory(): readonly string[]

Defined in: world.ts:40

Its inventory, when the world can read it, for data-driven item sharing.

Returns ​

readonly string[]

lastDamager()? ​

optional lastDamager(): GoalMob | undefined

Defined in: world.ts:50

Who last damaged it, which is what owner_hurt_by_target reads.

Returns ​

GoalMob | undefined

lookPosition()? ​

optional lookPosition(): EntityPosition

Defined in: world.ts:32

Where its eyes are, when the world can provide that detail.

Returns ​

EntityPosition

position() ​

position(): EntityPosition

Defined in: world.ts:30

Where it is now.

Returns ​

EntityPosition

shareables()? ​

optional shareables(): ShareablesParams | undefined

Defined in: world.ts:44

Its active item-sharing rules, when it has minecraft:shareables.

Returns ​

ShareablesParams | undefined

shareInventory()? ​

optional shareInventory(): readonly string[]

Defined in: world.ts:42

Its inventory slots and flat items together, for minecraft:behavior.share_items.

Returns ​

readonly string[]

target()? ​

optional target(): GoalMob | undefined

Defined in: world.ts:48

What it is attacking, which is what the owner-revenge goals read.

Returns ​

GoalMob | undefined

view() ​

view(): FilterEntityView

Defined in: world.ts:34

Its filter view, which is what an entity_types filter evaluates against as other.

Returns ​

FilterEntityView


GoalParameterUse ​

Defined in: inventory.ts:13

One parameter key vanilla writes under a goal, with how often and as what.

Properties ​

instances ​

readonly instances: number

Defined in: inventory.ts:17

How many component instances set the key.

key ​

readonly key: string

Defined in: inventory.ts:15

The key as the entity files spell it, such as speed_multiplier.

types ​

readonly types: readonly string[]

Defined in: inventory.ts:19

The JSON types observed, where a whole number is reported as integer.


GoalPickupOptions ​

Defined in: world.ts:66

Item behavior selected from minecraft:shareables during pickup.

Properties ​

admire ​

readonly admire: boolean

Defined in: world.ts:70

Whether a piglin should admire the item after taking it.

barter ​

readonly barter: boolean

Defined in: world.ts:72

Whether a piglin should barter for the item after taking it.

canPickupToHandOrEquipment ​

readonly canPickupToHandOrEquipment: boolean

Defined in: world.ts:68

Whether the item may go to an empty hand or armor slot.

consumeItem ​

readonly consumeItem: boolean

Defined in: world.ts:74

Whether the item should become the carried item for eat_carried_item.

storedInInventory ​

readonly storedInInventory: boolean

Defined in: world.ts:76

Whether an item that cannot be equipped should go in minecraft:inventory.


GoalUse ​

Defined in: inventory.ts:23

One minecraft:behavior.* name as vanilla uses it.

Properties ​

entities ​

readonly entities: number

Defined in: inventory.ts:27

How many of the 129 entity files declare it anywhere.

inBaseComponents ​

readonly inBaseComponents: number

Defined in: inventory.ts:30

inComponentGroups ​

readonly inComponentGroups: number

Defined in: inventory.ts:31

instances ​

readonly instances: number

Defined in: inventory.ts:29

How many times it appears, counting each component group separately.

name ​

readonly name: string

Defined in: inventory.ts:25

The component name, such as minecraft:behavior.random_stroll.

parameters ​

readonly parameters: readonly GoalParameterUse[]

Defined in: inventory.ts:33

The union of parameter keys observed, most used first.

usedBy ​

readonly usedBy: readonly string[]

Defined in: inventory.ts:35

The identifiers of the entities that declare it, sorted.


GoalWorld ​

Defined in: world.ts:130

The world seam the goals act through.

A server supplies one of these per entity through VanillaGoalOptions.world.

Methods ​

attack()? ​

optional attack(mob): void

Defined in: world.ts:176

Deals the entity's melee damage to the mob.

Parameters ​
mob ​

GoalMob

Returns ​

void

blocks()? ​

optional blocks(query): readonly GoalBlock[]

Defined in: world.ts:147

Blocks matching the query, nearest first, up to its optional limit.

Parameters ​
query ​

BlockQuery

Returns ​

readonly GoalBlock[]

breakBlock()? ​

optional breakBlock(position): void

Defined in: world.ts:221

Breaks a block, for the eat, harvest and dig goals.

Parameters ​
position ​

EntityPosition

Returns ​

void

breedWith()? ​

optional breedWith(mob): void

Defined in: world.ts:245

Produces the offspring of a successful breeding.

Parameters ​
mob ​

GoalMob

Returns ​

void

canBreedWith()? ​

optional canBreedWith(mob): boolean

Defined in: world.ts:241

Whether the entity can breed with the mob now.

Parameters ​
mob ​

GoalMob

Returns ​

boolean

canSee()? ​

optional canSee(mob): boolean

Defined in: world.ts:149

Whether the entity has line of sight to the mob, for must_see.

Parameters ​
mob ​

GoalMob

Returns ​

boolean

carriedItem()? ​

optional carriedItem(): string | undefined

Defined in: world.ts:209

What the entity holds in its main hand.

Returns ​

string | undefined

craftInto()? ​

optional craftInto(inputIdentifier, outputIdentifier, availableInput, wantedOutput): GoalItemCraft | undefined

Defined in: world.ts:200

Finds a loaded crafting recipe that converts one item into another.

Parameters ​
inputIdentifier ​

string

outputIdentifier ​

string

availableInput ​

number

wantedOutput ​

number

Returns ​

GoalItemCraft | undefined

damagers()? ​

optional damagers(): readonly GoalDamage[]

Defined in: world.ts:157

Who has damaged the entity, oldest first, with the running total each has dealt.

Returns ​

readonly GoalDamage[]

dismount()? ​

optional dismount(): void

Defined in: world.ts:190

Takes the entity off whatever it rides.

Returns ​

void

dropItem()? ​

optional dropItem(identifier, position): void

Defined in: world.ts:194

Drops an item at a position, or at the entity when none is given.

Parameters ​
identifier ​

string

position ​

EntityPosition | undefined

Returns ​

void

dropLoot()? ​

optional dropLoot(table, position): void

Defined in: world.ts:235

Rolls a loot table at a position, for the goals that drop a table's contents.

Parameters ​
table ​

string

position ​

EntityPosition

Returns ​

void

explode()? ​

optional explode(): void

Defined in: world.ts:237

Detonates the entity, for minecraft:behavior.swell.

Returns ​

void

giveCraftedItem()? ​

optional giveCraftedItem(mob, craft): void

Defined in: world.ts:207

Consumes a prepared recipe's inputs and gives its output to another entity.

Parameters ​
mob ​

GoalMob

craft ​

GoalItemCraft

Returns ​

void

giveItem()? ​

optional giveItem(mob, identifier, count?): void

Defined in: world.ts:196

Hands items to another entity, for the sharing and gift goals.

Parameters ​
mob ​

GoalMob

identifier ​

string

count? ​

number

Returns ​

void

home()? ​

optional home(): EntityPosition | undefined

Defined in: world.ts:167

The entity's home position, from minecraft:home or a set_home_position event.

Returns ​

EntityPosition | undefined

inventory()? ​

optional inventory(): readonly string[]

Defined in: world.ts:215

The entity's inventory contents, for the item and trade goals.

Returns ​

readonly string[]

isAttackable()? ​

optional isAttackable(mob): boolean

Defined in: world.ts:151

Whether Java's combat target rules allow this mob to be selected or retained.

Parameters ​
mob ​

GoalMob

Returns ​

boolean

isBrightOutside()? ​

optional isBrightOutside(): boolean

Defined in: world.ts:134

Whether Java's level considers it bright outside.

Returns ​

boolean

isReadyToBreed()? ​

optional isReadyToBreed(): boolean

Defined in: world.ts:243

Whether this entity's active breeding data lets it look for a mate now.

Returns ​

boolean

itemCount()? ​

optional itemCount(identifier): number

Defined in: world.ts:211

How many items of one identifier it keeps across inventory and equipment.

Parameters ​
identifier ​

string

Returns ​

number

itemHasTag()? ​

optional itemHasTag(identifier, tag): boolean

Defined in: world.ts:198

Whether an item type carries one of the active Bedrock item tags.

Parameters ​
identifier ​

string

tag ​

string

Returns ​

boolean

items()? ​

optional items(radius): readonly GoalItem[]

Defined in: world.ts:145

Every item stack lying within the radius, nearest first.

Parameters ​
radius ​

number

Returns ​

readonly GoalItem[]

knockback()? ​

optional knockback(mob, horizontal, vertical): void

Defined in: world.ts:180

Knocks the mob away from the entity.

Parameters ​
mob ​

GoalMob

horizontal ​

number

vertical ​

number

Returns ​

void

lastPusher()? ​

optional lastPusher(): GoalMob | undefined

Defined in: world.ts:159

Who last pushed the entity, for minecraft:behavior.target_when_pushed.

Returns ​

GoalMob | undefined

mobs()? ​

optional mobs(radius, families?): readonly GoalMob[]

Defined in: world.ts:141

Every matching entity within the radius, nearest first.

When supplied, families is a candidate hint: return entities in any listed family, and include every entity that could match those families.

Parameters ​
radius ​

number

families? ​

readonly string[]

Returns ​

readonly GoalMob[]

mount()? ​

optional mount(mob): void

Defined in: world.ts:188

Puts the entity on the mob as a rider.

Parameters ​
mob ​

GoalMob

Returns ​

void

optional navigation(): NavigationView | undefined

Defined in: world.ts:132

The blocks around the entity, which is what the path finder reads.

Returns ​

NavigationView | undefined

openTrade()? ​

optional openTrade(player): void

Defined in: world.ts:227

Opens the trade screen with a player.

Parameters ​
player ​

GoalMob

Returns ​

void

owner()? ​

optional owner(): GoalMob | undefined

Defined in: world.ts:161

The entity's owner, for the tamed-pet goals.

Returns ​

GoalMob | undefined

pickUp()? ​

optional pickUp(item, count?, options?): void

Defined in: world.ts:192

Takes up to count items from the stack into the entity's inventory or hand.

Parameters ​
item ​

GoalItem

count? ​

number

options? ​

GoalPickupOptions

Returns ​

void

players()? ​

optional players(radius): readonly GoalMob[]

Defined in: world.ts:143

Every player within the radius, nearest first.

Parameters ​
radius ​

number

Returns ​

readonly GoalMob[]

playSound()? ​

optional playSound(name): void

Defined in: world.ts:225

Plays one of the entity's sound events.

Parameters ​
name ​

string

Returns ​

void

poi()? ​

optional poi(type, radius): EntityPosition | undefined

Defined in: world.ts:174

The nearest point of interest of a type, such as village, bed, work, bell or the poi_type a goal names.

Parameters ​
type ​

string

radius ​

number

Returns ​

EntityPosition | undefined

push()? ​

optional push(velocity): void

Defined in: world.ts:182

Adds to the entity's own velocity, for the leap, charge and ram goals.

Parameters ​
velocity ​

EntityPosition

Returns ​

void

removeSelf()? ​

optional removeSelf(): void

Defined in: world.ts:186

Removes the entity, for the timed end of the dragon death animation.

Returns ​

void

report()? ​

optional report(message): void

Defined in: world.ts:247

Records what the goal met and could not carry out.

Parameters ​
message ​

string

Returns ​

void

riders()? ​

optional riders(): readonly GoalMob[]

Defined in: world.ts:165

Who rides the entity.

Returns ​

readonly GoalMob[]

setBlock()? ​

optional setBlock(position, identifier): void

Defined in: world.ts:219

Replaces a block, for the place, plant, compost and egg goals.

Parameters ​
position ​

EntityPosition

identifier ​

string

Returns ​

void

setCarriedItem()? ​

optional setCarriedItem(identifier): void

Defined in: world.ts:213

Puts an item in the entity's main hand, or empties it.

Parameters ​
identifier ​

string | undefined

Returns ​

void

setHome()? ​

optional setHome(position): void

Defined in: world.ts:169

Records a home position.

Parameters ​
position ​

EntityPosition | undefined

Returns ​

void

setSitting()? ​

optional setSitting(sitting): void

Defined in: world.ts:231

Sets the sitting flag, which the sit goals hold while they run.

Parameters ​
sitting ​

boolean

Returns ​

void

setSleeping()? ​

optional setSleeping(sleeping): void

Defined in: world.ts:233

Sets the sleeping flag, which the sleep and nap goals hold while they run.

Parameters ​
sleeping ​

boolean

Returns ​

void

setTarget()? ​

optional setTarget(mob): void

Defined in: world.ts:155

Sets or clears the attack target, which is what the targeting goals exist to do.

Parameters ​
mob ​

GoalMob | undefined

Returns ​

void

shareInventory()? ​

optional shareInventory(): readonly string[]

Defined in: world.ts:217

The entity's inventory slots and flat items, for minecraft:behavior.share_items.

Returns ​

readonly string[]

shoot()? ​

optional shoot(mob, projectile): void

Defined in: world.ts:178

Fires the entity's projectile at the mob.

Parameters ​
mob ​

GoalMob

projectile ​

string | undefined

Returns ​

void

spawn()? ​

optional spawn(identifier, position, event): void

Defined in: world.ts:223

Creates another entity, for the summon and lay goals.

Parameters ​
identifier ​

string

position ​

EntityPosition

event ​

string | undefined

Returns ​

void

target()? ​

optional target(): GoalMob | undefined

Defined in: world.ts:153

The entity's current attack target.

Returns ​

GoalMob | undefined

teleportTo()? ​

optional teleportTo(position): void

Defined in: world.ts:184

Moves the entity at once, for the teleport goals.

Parameters ​
position ​

EntityPosition

Returns ​

void

tradingPlayer()? ​

optional tradingPlayer(): GoalMob | undefined

Defined in: world.ts:229

Whether a player is trading with the entity now.

Returns ​

GoalMob | undefined

trigger()? ​

optional trigger(event, target): void

Defined in: world.ts:239

Fires an entity event on another entity, which trigger with a target does.

Parameters ​
event ​

string

target ​

string

Returns ​

void

vehicle()? ​

optional vehicle(): GoalMob | undefined

Defined in: world.ts:163

The entity the entity rides.

Returns ​

GoalMob | undefined


HideParams ​

Defined in: goals/environment.ts:216

What minecraft:behavior.hide declares.

Properties ​

duration ​

readonly duration: number

Defined in: goals/environment.ts:219

How long the entity stays hidden, in ticks.

poiType ​

readonly poiType: string | undefined

Defined in: goals/environment.ts:221

The point of interest type that counts as cover.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/environment.ts:217


HoldGroundParams ​

Defined in: goals/attacking.ts:811

What minecraft:behavior.hold_ground declares.

Properties ​

broadcast ​

readonly broadcast: boolean

Defined in: goals/attacking.ts:813

Whether nearby friends are told to hold too.

broadcastRange ​

readonly broadcastRange: number

Defined in: goals/attacking.ts:815

How far the broadcast reaches, in blocks.

minRadius ​

readonly minRadius: number

Defined in: goals/attacking.ts:817

How close the target has to be before the entity gives up holding, in blocks.

withinRadiusEvent ​

readonly withinRadiusEvent: GoalEvent | undefined

Defined in: goals/attacking.ts:819

The event fired on friends inside the radius.


HurtByTargetParams ​

Defined in: goals/targeting.ts:214

What minecraft:behavior.hurt_by_target declares.

Properties ​

alertSameType ​

readonly alertSameType: number

Defined in: goals/targeting.ts:220

How far the goal tells nearby friends of the same type, in blocks.

entityTypes ​

readonly entityTypes: readonly TargetEntityType[]

Defined in: goals/targeting.ts:216

Which damagers the goal retaliates against; an empty table accepts every one.

hurtOwner ​

readonly hurtOwner: boolean

Defined in: goals/targeting.ts:218

Whether the entity turns on its own owner when the owner hurts it.


InspectBookshelfParams ​

Defined in: goals/work.ts:496

What minecraft:behavior.inspect_bookshelf declares.

Properties ​

goalRadius ​

readonly goalRadius: number

Defined in: goals/work.ts:501

searchCount ​

readonly searchCount: number

Defined in: goals/work.ts:500

searchHeight ​

readonly searchHeight: number

Defined in: goals/work.ts:499

searchRange ​

readonly searchRange: number

Defined in: goals/work.ts:498

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/work.ts:497


JumpAroundTargetParams ​

Defined in: goals/attacking.ts:571

What minecraft:behavior.jump_around_target declares.

Properties ​

cooldown ​

readonly cooldown: number

Defined in: goals/attacking.ts:573

How long between jumps, in ticks.

hurtCooldown ​

readonly hurtCooldown: number

Defined in: goals/attacking.ts:575

How long between jumps after being hurt, in ticks.

landingDistance ​

readonly landingDistance: Range

Defined in: goals/attacking.ts:581

How far from the target the entity lands, in blocks.

maxJumpVelocity ​

readonly maxJumpVelocity: number

Defined in: goals/attacking.ts:579

How fast the jump throws the entity.

prepareDuration ​

readonly prepareDuration: number

Defined in: goals/attacking.ts:577

How long the entity crouches before the jump, in ticks.

validDistance ​

readonly validDistance: Range

Defined in: goals/attacking.ts:583

How far the target may be for the goal to run, in blocks.


JumpToBlockParams ​

Defined in: goals/movement.ts:1438

What minecraft:behavior.jump_to_block declares.

Properties ​

cooldown ​

readonly cooldown: Range

Defined in: goals/movement.ts:1440

How long between jumps, in ticks.

forbiddenBlocks ​

readonly forbiddenBlocks: readonly string[]

Defined in: goals/movement.ts:1452

Blocks the entity refuses to land on.

maxVelocity ​

readonly maxVelocity: number

Defined in: goals/movement.ts:1450

minimumDistance ​

readonly minimumDistance: number

Defined in: goals/movement.ts:1442

How far the destination has to be, in blocks.

minimumPathLength ​

readonly minimumPathLength: number

Defined in: goals/movement.ts:1444

How long a walking path would have to be before jumping is worth it.

preferredBlocks ​

readonly preferredBlocks: readonly string[]

Defined in: goals/movement.ts:1454

Blocks the entity prefers to land on.

preferredBlocksChance ​

readonly preferredBlocksChance: number

Defined in: goals/movement.ts:1456

The chance of taking a preferred block over any other, in [0, 1].

scaleFactor ​

readonly scaleFactor: number

Defined in: goals/movement.ts:1449

How the jump velocity scales with the distance.

searchHeight ​

readonly searchHeight: number

Defined in: goals/movement.ts:1447

searchWidth ​

readonly searchWidth: number

Defined in: goals/movement.ts:1446

How far the goal looks, in blocks.


KnockbackRoarParams ​

Defined in: goals/attacking.ts:898

What minecraft:behavior.knockback_roar declares.

Properties ​

attackTime ​

readonly attackTime: number

Defined in: goals/attacking.ts:902

How far into the roar the knockback lands, in ticks.

cooldown ​

readonly cooldown: number

Defined in: goals/attacking.ts:904

How long before the roar can run again, in ticks.

damage ​

readonly damage: number

Defined in: goals/attacking.ts:908

How much damage the roar deals.

duration ​

readonly duration: number

Defined in: goals/attacking.ts:900

How long the whole roar lasts, in ticks.

horizontalStrength ​

readonly horizontalStrength: number

Defined in: goals/attacking.ts:909

onRoarEnd ​

readonly onRoarEnd: GoalEvent | undefined

Defined in: goals/attacking.ts:911

range ​

readonly range: number

Defined in: goals/attacking.ts:906

How far the knockback reaches, in blocks.

verticalStrength ​

readonly verticalStrength: number

Defined in: goals/attacking.ts:910


LayDownParams ​

Defined in: goals/environment.ts:264

What minecraft:behavior.lay_down declares.

Properties ​

interval ​

readonly interval: number

Defined in: goals/environment.ts:266

One tick in this many lies down.

randomStopInterval ​

readonly randomStopInterval: number

Defined in: goals/environment.ts:268

One tick in this many gets up again.


LayEggParams ​

Defined in: goals/work.ts:752

What minecraft:behavior.lay_egg declares.

Properties ​

allowLayingFromBelow ​

readonly allowLayingFromBelow: boolean

Defined in: goals/work.ts:767

Whether the entity may lay while standing under the nest.

eggType ​

readonly eggType: string | undefined

Defined in: goals/work.ts:764

The egg block or entity to leave behind.

goalRadius ​

readonly goalRadius: number

Defined in: goals/work.ts:760

laySeconds ​

readonly laySeconds: number

Defined in: goals/work.ts:762

How long the laying takes, in ticks.

laySound ​

readonly laySound: string | undefined

Defined in: goals/work.ts:765

onLay ​

readonly onLay: GoalEvent | undefined

Defined in: goals/work.ts:769

searchHeight ​

readonly searchHeight: number

Defined in: goals/work.ts:759

searchRange ​

readonly searchRange: number

Defined in: goals/work.ts:758

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/work.ts:753

targetBlocks ​

readonly targetBlocks: readonly string[]

Defined in: goals/work.ts:755

The blocks the entity lays on.

targetMaterialsAboveBlock ​

readonly targetMaterialsAboveBlock: readonly string[]

Defined in: goals/work.ts:757

The blocks that may sit above the nest.

useDefaultAnimation ​

readonly useDefaultAnimation: boolean

Defined in: goals/work.ts:768


LeapAtTargetParams ​

Defined in: goals/attacking.ts:514

What minecraft:behavior.leap_at_target declares.

Properties ​

mustBeOnGround ​

readonly mustBeOnGround: boolean

Defined in: goals/attacking.ts:519

targetDistance ​

readonly targetDistance: number

Defined in: goals/attacking.ts:518

How close the target may be for the leap to start, in blocks.

yd ​

readonly yd: number

Defined in: goals/attacking.ts:516

How much upward velocity the leap adds.


LookAtEntityParams ​

Defined in: goals/looking.ts:105

What minecraft:behavior.look_at_entity declares.

Extends ​

Properties ​

angleOfViewHorizontal ​

readonly angleOfViewHorizontal: number

Defined in: goals/looking.ts:72

How wide the entity's horizontal field of view is, in degrees.

Inherited from ​

LookAtParams.angleOfViewHorizontal

angleOfViewVertical ​

readonly angleOfViewVertical: number

Defined in: goals/looking.ts:74

How wide its vertical field of view is, in degrees.

Inherited from ​

LookAtParams.angleOfViewVertical

filters ​

readonly filters: Filter | undefined

Defined in: goals/looking.ts:107

Which entities are worth looking at.

lookDistance ​

readonly lookDistance: number

Defined in: goals/looking.ts:66

How far the entity notices something to look at, in blocks.

Inherited from ​

LookAtParams.lookDistance

lookTime ​

readonly lookTime: Range

Defined in: goals/looking.ts:70

How long one look lasts, in ticks.

Inherited from ​

LookAtParams.lookTime

probability ​

readonly probability: number

Defined in: goals/looking.ts:68

The chance per tick of starting a look, in [0, 1].

Inherited from ​

LookAtParams.probability


LookAtParams ​

Defined in: goals/looking.ts:64

What the look goals declare.

Extended by ​

Properties ​

angleOfViewHorizontal ​

readonly angleOfViewHorizontal: number

Defined in: goals/looking.ts:72

How wide the entity's horizontal field of view is, in degrees.

angleOfViewVertical ​

readonly angleOfViewVertical: number

Defined in: goals/looking.ts:74

How wide its vertical field of view is, in degrees.

lookDistance ​

readonly lookDistance: number

Defined in: goals/looking.ts:66

How far the entity notices something to look at, in blocks.

lookTime ​

readonly lookTime: Range

Defined in: goals/looking.ts:70

How long one look lasts, in ticks.

probability ​

readonly probability: number

Defined in: goals/looking.ts:68

The chance per tick of starting a look, in [0, 1].


MeleeAttackParams ​

Defined in: goals/attacking.ts:137

What the melee goals declare.

Extended by ​

Properties ​

attackOnce ​

readonly attackOnce: boolean

Defined in: goals/attacking.ts:140

canSpreadOnFire ​

readonly canSpreadOnFire: boolean

Defined in: goals/attacking.ts:149

cooldownTime ​

readonly cooldownTime: number

Defined in: goals/attacking.ts:144

How long between swings, in ticks.

meleeFov ​

readonly meleeFov: number

Defined in: goals/attacking.ts:148

How wide the swing arc is, in degrees.

onAttack ​

readonly onAttack: GoalEvent | undefined

Defined in: goals/attacking.ts:150

onKill ​

readonly onKill: GoalEvent | undefined

Defined in: goals/attacking.ts:151

randomStopInterval ​

readonly randomStopInterval: number

Defined in: goals/attacking.ts:142

reachMultiplier ​

readonly reachMultiplier: number

Defined in: goals/attacking.ts:146

How far a swing reaches, as a multiple of the entity's width.

requireCompletePath ​

readonly requireCompletePath: boolean

Defined in: goals/attacking.ts:141

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/attacking.ts:138

trackTarget ​

readonly trackTarget: boolean

Defined in: goals/attacking.ts:139


MingleParams ​

Defined in: goals/social.ts:659

What minecraft:behavior.mingle declares.

Properties ​

cooldown ​

readonly cooldown: number

Defined in: goals/social.ts:664

How long before the entity mingles again, in ticks.

duration ​

readonly duration: number

Defined in: goals/social.ts:662

How long one conversation lasts, in ticks.

mingleDistance ​

readonly mingleDistance: number

Defined in: goals/social.ts:666

How close two entities stand while mingling, in blocks.

partnerType ​

readonly partnerType: string | undefined

Defined in: goals/social.ts:668

Which entity type counts as someone to mingle with.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/social.ts:660


MoveAroundTargetParams ​

Defined in: goals/attacking.ts:651

What minecraft:behavior.move_around_target declares.

Properties ​

destinationRange ​

readonly destinationRange: Range

Defined in: goals/attacking.ts:653

How far from the target the entity repositions, in blocks.

heightDifferenceLimit ​

readonly heightDifferenceLimit: number

Defined in: goals/attacking.ts:657

The most height difference a destination may have, in blocks.

movementSpeed ​

readonly movementSpeed: number

Defined in: goals/attacking.ts:658

spreadDegrees ​

readonly spreadDegrees: number

Defined in: goals/attacking.ts:655

How wide the arc of candidate positions is, in degrees.


MoveToBlockParams ​

Defined in: goals/movement.ts:816

What a block-seeking goal declares.

Properties ​

goalRadius ​

readonly goalRadius: number

Defined in: goals/movement.ts:827

How close counts as arriving, in blocks.

onReach ​

readonly onReach: readonly GoalEvent[]

Defined in: goals/movement.ts:836

onStayCompleted ​

readonly onStayCompleted: readonly GoalEvent[]

Defined in: goals/movement.ts:837

searchCount ​

readonly searchCount: number

Defined in: goals/movement.ts:825

How many candidates it considers.

searchHeight ​

readonly searchHeight: number

Defined in: goals/movement.ts:823

How far it looks vertically, in blocks.

searchRange ​

readonly searchRange: number

Defined in: goals/movement.ts:821

How far it looks horizontally, in blocks.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/movement.ts:817

startChance ​

readonly startChance: number

Defined in: goals/movement.ts:831

The chance per attempt that the goal runs at all, in [0, 1].

stayDuration ​

readonly stayDuration: number

Defined in: goals/movement.ts:833

How long the entity waits at the block, in ticks.

targetBlocks ​

readonly targetBlocks: readonly string[]

Defined in: goals/movement.ts:819

The blocks the goal walks to.

targetOffset ​

readonly targetOffset: EntityPosition

Defined in: goals/movement.ts:835

How far from the found block the entity actually stands.

tickInterval ​

readonly tickInterval: number

Defined in: goals/movement.ts:829

How many ticks between searches.


MoveTowardsTargetParams ​

Defined in: goals/attacking.ts:711

What minecraft:behavior.move_towards_target declares.

Properties ​

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/attacking.ts:712

withinRadius ​

readonly withinRadius: number

Defined in: goals/attacking.ts:714

How far the target may be for the goal to run, in blocks.


NapParams ​

Defined in: goals/environment.ts:151

What minecraft:behavior.nap declares.

Properties ​

canNapFilters ​

readonly canNapFilters: Filter | undefined

Defined in: goals/environment.ts:159

What has to be true for the entity to nap at all.

cooldown ​

readonly cooldown: Range

Defined in: goals/environment.ts:153

How long before the entity naps again, in ticks.

mobDetectDistance ​

readonly mobDetectDistance: number

Defined in: goals/environment.ts:155

How far a mob has to be for the entity to feel safe, in blocks.

mobDetectHeight ​

readonly mobDetectHeight: number

Defined in: goals/environment.ts:157

How far above and below it looks, in blocks.

wakeMobExceptions ​

readonly wakeMobExceptions: Filter | undefined

Defined in: goals/environment.ts:161

Mobs whose presence does not wake the entity.


Defined in: navigation/profile.ts:21

How an entity is allowed to move, and what it refuses to path through.

Properties ​

avoidDamageBlocks ​

readonly avoidDamageBlocks: boolean

Defined in: navigation/profile.ts:51

avoidPortals ​

readonly avoidPortals: boolean

Defined in: navigation/profile.ts:50

avoidSun ​

readonly avoidSun: boolean

Defined in: navigation/profile.ts:49

avoidWater ​

readonly avoidWater: boolean

Defined in: navigation/profile.ts:48

blocksToAvoid ​

readonly blocksToAvoid: readonly string[]

Defined in: navigation/profile.ts:56

Block identifiers the path refuses to enter, from blocks_to_avoid.

canBreach ​

readonly canBreach: boolean

Defined in: navigation/profile.ts:42

canBreakDoors ​

readonly canBreakDoors: boolean

Defined in: navigation/profile.ts:47

canClimbLadders? ​

readonly optional canClimbLadders?: boolean

Defined in: navigation/profile.ts:38

Whether minecraft:can_climb lets the entity climb ladder blocks.

canFloat ​

readonly canFloat: boolean

Defined in: navigation/profile.ts:32

canFly ​

readonly canFly: boolean

Defined in: navigation/profile.ts:41

canJump ​

readonly canJump: boolean

Defined in: navigation/profile.ts:43

canOpenDoors ​

readonly canOpenDoors: boolean

Defined in: navigation/profile.ts:44

canOpenIronDoors ​

readonly canOpenIronDoors: boolean

Defined in: navigation/profile.ts:45

canPassDoors ​

readonly canPassDoors: boolean

Defined in: navigation/profile.ts:46

canPathFromAir ​

readonly canPathFromAir: boolean

Defined in: navigation/profile.ts:31

canPathOverLava ​

readonly canPathOverLava: boolean

Defined in: navigation/profile.ts:30

canPathOverWater ​

readonly canPathOverWater: boolean

Defined in: navigation/profile.ts:29

canSink ​

readonly canSink: boolean

Defined in: navigation/profile.ts:33

canStandOnPowderSnow? ​

readonly optional canStandOnPowderSnow?: boolean

Defined in: navigation/profile.ts:40

Whether minecraft:can_stand_on_powder_snow lets the entity use powder snow as support.

canSwim ​

readonly canSwim: boolean

Defined in: navigation/profile.ts:34

canWalk ​

readonly canWalk: boolean

Defined in: navigation/profile.ts:35

canWalkInLava ​

readonly canWalkInLava: boolean

Defined in: navigation/profile.ts:36

height ​

readonly height: number

Defined in: navigation/profile.ts:24

How many whole blocks of headroom the entity needs, at least 1.

isAmphibious ​

readonly isAmphibious: boolean

Defined in: navigation/profile.ts:52

kind ​

readonly kind: "float" | "swim" | "fly" | "hover" | "walk" | "generic" | "climb"

Defined in: navigation/profile.ts:22

maxFallDistance ​

readonly maxFallDistance: number

Defined in: navigation/profile.ts:28

How far the entity drops in one step, in blocks.

pathfindingMalus? ​

readonly optional pathfindingMalus?: Readonly<Record<string, number>>

Defined in: navigation/profile.ts:54

Java's path-type costs, keyed by PathType; negative values are blocked.

stepHeight ​

readonly stepHeight: number

Defined in: navigation/profile.ts:26

How high the entity climbs without jumping, in blocks.


Defined in: navigation/view.ts:28

The world as the path finder reads it, one block at a time.

Methods ​

blockAt() ​

blockAt(position): string | undefined

Defined in: navigation/view.ts:30

The block identifier, such as minecraft:stone, or undefined outside the loaded world.

Parameters ​
position ​

EntityPosition

Returns ​

string | undefined

canSeeSky()? ​

optional canSeeSky(position): boolean

Defined in: navigation/view.ts:46

Whether Java's level says the block column can see the sky.

Parameters ​
position ​

EntityPosition

Returns ​

boolean

doorAt()? ​

optional doorAt(position): DoorState | undefined

Defined in: navigation/view.ts:40

The door at the block, or undefined when it is not a door.

Parameters ​
position ​

EntityPosition

Returns ​

DoorState | undefined

isClimbable()? ​

optional isClimbable(position): boolean

Defined in: navigation/view.ts:52

Whether an entity climbs the block, such as a ladder or a vine.

Parameters ​
position ​

EntityPosition

Returns ​

boolean

isDamaging()? ​

optional isDamaging(position): boolean

Defined in: navigation/view.ts:42

Whether standing in the block hurts, for avoid_damage_blocks.

Parameters ​
position ​

EntityPosition

Returns ​

boolean

isLadder()? ​

optional isLadder(position): boolean

Defined in: navigation/view.ts:54

Whether the block is a ladder, which minecraft:can_climb lets entities climb.

Parameters ​
position ​

EntityPosition

Returns ​

boolean

isLava() ​

isLava(position): boolean

Defined in: navigation/view.ts:38

Whether the block is lava.

Parameters ​
position ​

EntityPosition

Returns ​

boolean

isPassable() ​

isPassable(position): boolean

Defined in: navigation/view.ts:32

Whether an entity fits in the block, which liquids and plants allow and full blocks do not.

Parameters ​
position ​

EntityPosition

Returns ​

boolean

isPortal()? ​

optional isPortal(position): boolean

Defined in: navigation/view.ts:50

Whether the block is a portal, for avoid_portals.

Parameters ​
position ​

EntityPosition

Returns ​

boolean

isSolid() ​

isSolid(position): boolean

Defined in: navigation/view.ts:34

Whether the block holds an entity standing on top of it.

Parameters ​
position ​

EntityPosition

Returns ​

boolean

isSunlit()? ​

optional isSunlit(position): boolean

Defined in: navigation/view.ts:44

Whether the sky reaches the block, for avoid_sun.

Parameters ​
position ​

EntityPosition

Returns ​

boolean

isWater() ​

isWater(position): boolean

Defined in: navigation/view.ts:36

Whether the block is water or waterlogged.

Parameters ​
position ​

EntityPosition

Returns ​

boolean

walkTargetValue()? ​

optional walkTargetValue(position): number

Defined in: navigation/view.ts:48

The entity's Java walk-target value at the block, for hide-position searches.

Parameters ​
position ​

EntityPosition

Returns ​

number


Defined in: navigator.ts:81

What one entity's movement needs from the rest of the package.

Properties ​

actuator ​

readonly actuator: EntityActuator | undefined

Defined in: navigator.ts:83

Moves, looks and jumps; undefined when the caller supplied no actuator.

Methods ​

navigation(): NavigationView | undefined

Defined in: navigator.ts:85

Reads the blocks; undefined when the caller supplied no view.

Returns ​

NavigationView | undefined

profile() ​

profile(): NavigationProfile

Defined in: navigator.ts:87

The rules the path finder follows for this entity.

Returns ​

NavigationProfile


NearestAttackableTargetParams ​

Defined in: goals/targeting.ts:107

What minecraft:behavior.nearest_attackable_target declares.

Properties ​

acquisitionProbability ​

readonly acquisitionProbability: number

Defined in: goals/targeting.ts:122

The chance a scan takes the candidate it found, in [0, 1].

attackInterval ​

readonly attackInterval: readonly [number, number]

Defined in: goals/targeting.ts:126

How long between attack attempts, in ticks.

entityTypes ​

readonly entityTypes: readonly TargetEntityType[]

Defined in: goals/targeting.ts:108

mustReach ​

readonly mustReach: boolean

Defined in: goals/targeting.ts:114

mustSee ​

readonly mustSee: boolean

Defined in: goals/targeting.ts:113

mustSeeForgetDuration ​

readonly mustSeeForgetDuration: number

Defined in: goals/targeting.ts:118

How long a target survives out of sight, in ticks.

persistTime ​

readonly persistTime: number

Defined in: goals/targeting.ts:120

How long the target is held at most, in ticks; 0 means until it is invalid.

reselectTargets ​

readonly reselectTargets: boolean

Defined in: goals/targeting.ts:116

Whether the goal replaces a target it already has.

scanInterval ​

readonly scanInterval: number

Defined in: goals/targeting.ts:124

How many ticks between scans.

targetSearchHeight ​

readonly targetSearchHeight: number

Defined in: goals/targeting.ts:112

How far above and below the goal looks, in blocks.

withinRadius ​

readonly withinRadius: number

Defined in: goals/targeting.ts:110

How far the goal looks, in blocks.


OcelotAttackParams ​

Defined in: goals/attacking.ts:1208

What minecraft:behavior.ocelotattack declares.

Properties ​

cooldown ​

readonly cooldown: number

Defined in: goals/attacking.ts:1210

How long between pounces, in ticks.

maxDistance ​

readonly maxDistance: number

Defined in: goals/attacking.ts:1212

How far the goal reaches at all, in blocks.

maxSneakRange ​

readonly maxSneakRange: number

Defined in: goals/attacking.ts:1214

Inside this distance the entity sneaks, in blocks.

maxSprintRange ​

readonly maxSprintRange: number

Defined in: goals/attacking.ts:1216

Inside this distance the entity sprints, in blocks.

reachMultiplier ​

readonly reachMultiplier: number

Defined in: goals/attacking.ts:1218

How far a swing reaches, as a multiple of the entity's width.

sneakSpeedMultiplier ​

readonly sneakSpeedMultiplier: number

Defined in: goals/attacking.ts:1219

sprintSpeedMultiplier ​

readonly sprintSpeedMultiplier: number

Defined in: goals/attacking.ts:1220

walkSpeedMultiplier ​

readonly walkSpeedMultiplier: number

Defined in: goals/attacking.ts:1221


PanicParams ​

Defined in: goals/movement.ts:459

What minecraft:behavior.panic declares.

Properties ​

damageSources ​

readonly damageSources: readonly string[]

Defined in: goals/movement.ts:464

Which damage causes start a panic; an empty list accepts every one.

force ​

readonly force: boolean

Defined in: goals/movement.ts:466

Whether the panic runs even when nothing hurt the entity.

ignoreMobDamage ​

readonly ignoreMobDamage: boolean

Defined in: goals/movement.ts:462

Whether damage from another mob counts as a reason to panic.

panicSound ​

readonly panicSound: string | undefined

Defined in: goals/movement.ts:469

preferWater ​

readonly preferWater: boolean

Defined in: goals/movement.ts:468

Whether the entity runs for water rather than away.

soundInterval ​

readonly soundInterval: Range

Defined in: goals/movement.ts:471

How long between panic sounds, in ticks.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/movement.ts:460


Path ​

Defined in: navigation/pathfinder.ts:49

A route through the world, as block positions.

Properties ​

nodes ​

readonly nodes: readonly EntityPosition[]

Defined in: navigation/pathfinder.ts:51

The blocks to walk, the first step first and the start left out.

reachedGoal ​

readonly reachedGoal: boolean

Defined in: navigation/pathfinder.ts:53

Whether the last node is within the request's goal radius.


PathRequest ​

Defined in: navigation/pathfinder.ts:35

What to path toward, and how hard to look.

Properties ​

allowPartial? ​

readonly optional allowPartial?: boolean

Defined in: navigation/pathfinder.ts:45

Whether to return the closest node reached when the goal is out of reach.

from ​

readonly from: EntityPosition

Defined in: navigation/pathfinder.ts:37

Where the entity is now; the search floors it to a block.

goalRadius? ​

readonly optional goalRadius?: number

Defined in: navigation/pathfinder.ts:41

How close to to counts as arriving, in blocks. Defaults to the exact block.

maxNodes? ​

readonly optional maxNodes?: number

Defined in: navigation/pathfinder.ts:43

The most nodes to expand before giving up. Defaults to 512.

to ​

readonly to: EntityPosition

Defined in: navigation/pathfinder.ts:39

Where the entity wants to be.


PickupItemsParams ​

Defined in: goals/work.ts:106

What minecraft:behavior.pickup_items declares.

Properties ​

canPickupAnyItem ​

readonly canPickupAnyItem: boolean

Defined in: goals/work.ts:115

Whether the entity picks up anything or only what it wants.

canPickupToHandOrEquipment ​

readonly canPickupToHandOrEquipment: boolean

Defined in: goals/work.ts:119

Whether a picked-up item may go to the hand or the armor slots.

cooldownAfterBeingAttacked ​

readonly cooldownAfterBeingAttacked: number

Defined in: goals/work.ts:127

How long after being hurt before the entity picks things up again, in ticks.

excludedItems ​

readonly excludedItems: readonly string[]

Defined in: goals/work.ts:125

Items the entity never takes.

goalRadius ​

readonly goalRadius: number

Defined in: goals/work.ts:113

How close it has to be to take the item, in blocks.

maxDistance ​

readonly maxDistance: number

Defined in: goals/work.ts:109

How far the entity looks for an item, in blocks.

onPickupItemEnd ​

readonly onPickupItemEnd: GoalEvent | undefined

Defined in: goals/work.ts:129

onPickupItemStart ​

readonly onPickupItemStart: GoalEvent | undefined

Defined in: goals/work.ts:128

pickupBasedOnChance ​

readonly pickupBasedOnChance: boolean

Defined in: goals/work.ts:117

Whether the pickup is gated on the entity's own chance.

pickupSameItemsAsInHand ​

readonly pickupSameItemsAsInHand: boolean

Defined in: goals/work.ts:121

Whether the entity only takes items matching what it already holds.

searchHeight ​

readonly searchHeight: number

Defined in: goals/work.ts:111

How far it looks up and down, in blocks.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/work.ts:107

stopIfHoldingItem ​

readonly stopIfHoldingItem: boolean

Defined in: goals/work.ts:123

Whether a full hand stops the goal.


PlaceBlockParams ​

Defined in: goals/work.ts:834

What minecraft:behavior.place_block declares.

Properties ​

affectedByGriefingRule ​

readonly affectedByGriefingRule: boolean

Defined in: goals/work.ts:843

Whether the mobGriefing game rule gates the placement.

canPlace ​

readonly canPlace: Filter | undefined

Defined in: goals/work.ts:845

What has to be true of the position for the placement to happen.

chance ​

readonly chance: number

Defined in: goals/work.ts:836

The chance per tick of placing, in [0, 1].

onPlace ​

readonly onPlace: GoalEvent | undefined

Defined in: goals/work.ts:846

placeableBlocks ​

readonly placeableBlocks: readonly string[]

Defined in: goals/work.ts:841

The blocks the entity may place.

xzRange ​

readonly xzRange: Range

Defined in: goals/work.ts:838

How far from the entity the block may land, in blocks.

yRange ​

readonly yRange: Range

Defined in: goals/work.ts:839


PlayDeadParams ​

Defined in: goals/environment.ts:695

What minecraft:behavior.play_dead declares.

Properties ​

applyRegeneration ​

readonly applyRegeneration: boolean

Defined in: goals/environment.ts:703

Whether it regenerates while down.

damageSources ​

readonly damageSources: readonly string[]

Defined in: goals/environment.ts:705

The damage causes that start it.

duration ​

readonly duration: number

Defined in: goals/environment.ts:697

How long the entity stays down, in ticks.

filters ​

readonly filters: Filter | undefined

Defined in: goals/environment.ts:708

forceBelowHealth ​

readonly forceBelowHealth: number

Defined in: goals/environment.ts:701

The health below which it plays dead.

randomDamageRange ​

readonly randomDamageRange: Range

Defined in: goals/environment.ts:707

The damage it still takes while down.

randomStartChance ​

readonly randomStartChance: number

Defined in: goals/environment.ts:699

The chance per damage event of playing dead, in [0, 1].


PlayParams ​

Defined in: goals/social.ts:618

What minecraft:behavior.play declares.

Properties ​

friendTypes ​

readonly friendTypes: readonly TargetEntityType[]

Defined in: goals/social.ts:621

Which entities the entity plays with.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/social.ts:619


PotionChoice ​

Defined in: goals/attacking.ts:1543

One entry of minecraft:behavior.drink_potion's potions list.

Properties ​

chance ​

readonly chance: number

Defined in: goals/attacking.ts:1547

The chance of picking it, in [0, 1].

id ​

readonly id: number

Defined in: goals/attacking.ts:1545

The potion id the entity drinks.


RaidGardenParams ​

Defined in: goals/work.ts:427

What minecraft:behavior.raid_garden declares.

Properties ​

blocks ​

readonly blocks: readonly string[]

Defined in: goals/work.ts:430

The crops the entity eats.

goalRadius ​

readonly goalRadius: number

Defined in: goals/work.ts:435

How close counts as arriving, in blocks.

initialEatDelay ​

readonly initialEatDelay: number

Defined in: goals/work.ts:437

How long it waits before the first bite, in ticks.

maxToEat ​

readonly maxToEat: number

Defined in: goals/work.ts:439

How many crops it eats before it stops.

searchHeight ​

readonly searchHeight: number

Defined in: goals/work.ts:433

searchRange ​

readonly searchRange: number

Defined in: goals/work.ts:432

How far it looks, in blocks.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/work.ts:428


RamAttackParams ​

Defined in: goals/attacking.ts:1040

What minecraft:behavior.ram_attack declares.

Properties ​

cooldown ​

readonly cooldown: Range

Defined in: goals/attacking.ts:1042

How long between rams, in ticks.

impactSound ​

readonly impactSound: string | undefined

Defined in: goals/attacking.ts:1052

knockbackForce ​

readonly knockbackForce: number

Defined in: goals/attacking.ts:1049

knockbackHeight ​

readonly knockbackHeight: number

Defined in: goals/attacking.ts:1050

minRamDistance ​

readonly minRamDistance: number

Defined in: goals/attacking.ts:1046

How close the target has to be before the entity backs up, in blocks.

onStart ​

readonly onStart: readonly GoalEvent[]

Defined in: goals/attacking.ts:1053

preRamSound ​

readonly preRamSound: string | undefined

Defined in: goals/attacking.ts:1051

ramDistance ​

readonly ramDistance: number

Defined in: goals/attacking.ts:1044

How far the ram starts from, in blocks.

ramSpeed ​

readonly ramSpeed: number

Defined in: goals/attacking.ts:1047

runSpeed ​

readonly runSpeed: number

Defined in: goals/attacking.ts:1048


RandomBreachParams ​

Defined in: goals/environment.ts:802

What minecraft:behavior.random_breach declares.

Properties ​

cooldown ​

readonly cooldown: number

Defined in: goals/environment.ts:806

How long before the entity breaches again, in ticks.

interval ​

readonly interval: number

Defined in: goals/environment.ts:804

One tick in this many breaches.

xzDistance ​

readonly xzDistance: number

Defined in: goals/environment.ts:808

How far from the entity the breach aims, in blocks.


RandomLookAroundAndSitParams ​

Defined in: goals/looking.ts:210

What minecraft:behavior.random_look_around_and_sit declares.

Properties ​

angleOfView ​

readonly angleOfView: Range

Defined in: goals/looking.ts:216

How wide the glances spread, in degrees.

continueIfLeashed ​

readonly continueIfLeashed: boolean

Defined in: goals/looking.ts:221

continueSittingOnReload ​

readonly continueSittingOnReload: boolean

Defined in: goals/looking.ts:222

cooldown ​

readonly cooldown: number

Defined in: goals/looking.ts:220

How long before the goal may run again, in ticks.

lookCount ​

readonly lookCount: Range

Defined in: goals/looking.ts:212

How many glances one sitting takes.

lookTime ​

readonly lookTime: Range

Defined in: goals/looking.ts:214

How long each glance lasts, in ticks.

probability ​

readonly probability: number

Defined in: goals/looking.ts:218

The chance per tick of sitting down, in [0, 1].


RandomLookAroundParams ​

Defined in: goals/looking.ts:160

What minecraft:behavior.random_look_around declares.

Properties ​

lookDistance ​

readonly lookDistance: number

Defined in: goals/looking.ts:162

How far the entity looks, in blocks.

lookTime ​

readonly lookTime: Range

Defined in: goals/looking.ts:164

How long one glance lasts, in ticks.


RandomSearchAndDigParams ​

Defined in: goals/work.ts:644

What minecraft:behavior.random_search_and_dig declares.

Properties ​

cooldown ​

readonly cooldown: Range

Defined in: goals/work.ts:657

How long before the entity digs again, in ticks.

diggingDuration ​

readonly diggingDuration: Range

Defined in: goals/work.ts:655

How long one dig takes, in ticks.

findValidPositionRetries ​

readonly findValidPositionRetries: number

Defined in: goals/work.ts:659

How many positions it tries before giving up.

goalRadius ​

readonly goalRadius: number

Defined in: goals/work.ts:653

How close counts as arriving, in blocks.

itemTable ​

readonly itemTable: string | undefined

Defined in: goals/work.ts:661

The table the find is rolled from.

onDiggingStart ​

readonly onDiggingStart: GoalEvent | undefined

Defined in: goals/work.ts:667

onFailDuringDigging ​

readonly onFailDuringDigging: GoalEvent | undefined

Defined in: goals/work.ts:671

onFailDuringSearching ​

readonly onFailDuringSearching: GoalEvent | undefined

Defined in: goals/work.ts:670

onItemFound ​

readonly onItemFound: GoalEvent | undefined

Defined in: goals/work.ts:668

onSearchingStart ​

readonly onSearchingStart: GoalEvent | undefined

Defined in: goals/work.ts:666

onSuccess ​

readonly onSuccess: GoalEvent | undefined

Defined in: goals/work.ts:669

searchRangeXz ​

readonly searchRangeXz: number

Defined in: goals/work.ts:649

How far it looks horizontally, in blocks.

searchRangeY ​

readonly searchRangeY: number

Defined in: goals/work.ts:651

How far it looks vertically, in blocks.

spawnItemAfter ​

readonly spawnItemAfter: number

Defined in: goals/work.ts:663

How long after the dig the item appears, in ticks.

spawnItemPosOffset ​

readonly spawnItemPosOffset: number

Defined in: goals/work.ts:665

How far in front of the entity the item appears, in blocks.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/work.ts:645

targetBlocks ​

readonly targetBlocks: readonly string[]

Defined in: goals/work.ts:647

The blocks the entity will dig in.


RandomSittingParams ​

Defined in: goals/environment.ts:297

What minecraft:behavior.random_sitting declares.

Properties ​

cooldown ​

readonly cooldown: number

Defined in: goals/environment.ts:299

How long before the entity may sit again, in ticks.

minSitTime ​

readonly minSitTime: number

Defined in: goals/environment.ts:301

The least time one sitting lasts, in ticks.

startChance ​

readonly startChance: number

Defined in: goals/environment.ts:303

The chance per tick of sitting down, in [0, 1].

stopChance ​

readonly stopChance: number

Defined in: goals/environment.ts:305

The chance per tick of standing up again, in [0, 1].


RangedAttackParams ​

Defined in: goals/attacking.ts:238

What minecraft:behavior.ranged_attack declares.

Properties ​

attackInterval ​

readonly attackInterval: Range

Defined in: goals/attacking.ts:245

How long between shots, in ticks, as a [min, max] pair.

attackRadius ​

readonly attackRadius: number

Defined in: goals/attacking.ts:241

How far the entity shoots from, in blocks.

attackRadiusMin ​

readonly attackRadiusMin: number

Defined in: goals/attacking.ts:243

How close it refuses to shoot from, in blocks.

attackRange ​

readonly attackRange: Range

Defined in: goals/attacking.ts:247

How far the target may be for the goal to run at all, in blocks.

burstInterval ​

readonly burstInterval: number

Defined in: goals/attacking.ts:253

How long between the shots of one volley, in ticks.

burstShots ​

readonly burstShots: number

Defined in: goals/attacking.ts:251

How many shots one volley fires.

chargeChargedTrigger ​

readonly chargeChargedTrigger: number

Defined in: goals/attacking.ts:257

When a charged weapon counts as charged, in ticks.

chargeShootTrigger ​

readonly chargeShootTrigger: number

Defined in: goals/attacking.ts:255

When the entity starts the charge animation, in ticks before the shot.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/attacking.ts:239

swing ​

readonly swing: boolean

Defined in: goals/attacking.ts:258

targetInSightTime ​

readonly targetInSightTime: number

Defined in: goals/attacking.ts:249

How long the target has to stay in sight before the first shot, in ticks.


RegisterableGoal ​

Defined in: goal.ts:36

One goal with its parameter type hidden, so a list can hold goals of different shapes without erasing the type each goal parses into.

Properties ​

controlFlags ​

readonly controlFlags: readonly ("move" | "look" | "jump")[]

Defined in: goal.ts:40

The control flags the goal holds when the definition names none.

name ​

readonly name: string

Defined in: goal.ts:38

The component name the goal registers under.

Methods ​

register() ​

register(registry, source): void

Defined in: goal.ts:42

Registers the goal, building its support from the source.

Parameters ​
registry ​

EntityComponentRegistry

source ​

SupportSource

Returns ​

void


RestrictionParams ​

Defined in: goals/movement.ts:1018

What the home and dwelling restriction goals declare.

Properties ​

goalRadius ​

readonly goalRadius: number

Defined in: goals/movement.ts:1021

How close to home counts as arriving, in blocks.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/movement.ts:1019


RoarParams ​

Defined in: goals/attacking.ts:863

What the roar-style goals declare.

Properties ​

duration ​

readonly duration: number

Defined in: goals/attacking.ts:865

How long the roar lasts, in ticks.


RollParams ​

Defined in: goals/environment.ts:672

What minecraft:behavior.roll declares.

Properties ​

probability ​

readonly probability: number

Defined in: goals/environment.ts:674

The chance per tick of rolling, in [0, 1].


SendEventChoice ​

Defined in: goals/attacking.ts:1747

One entry of event_choices.

Properties ​

castDuration ​

readonly castDuration: number

Defined in: goals/attacking.ts:1750

How long the cast takes, in ticks.

cooldownTime ​

readonly cooldownTime: number

Defined in: goals/attacking.ts:1752

How long before the choice may run again, in ticks.

id ​

readonly id: number

Defined in: goals/attacking.ts:1748

maxActivationRange ​

readonly maxActivationRange: number

Defined in: goals/attacking.ts:1754

minActivationRange ​

readonly minActivationRange: number

Defined in: goals/attacking.ts:1753

sequence ​

readonly sequence: readonly object[]

Defined in: goals/attacking.ts:1757

The events fired over the cast, each with its own delay in ticks.

startSound ​

readonly startSound: string | undefined

Defined in: goals/attacking.ts:1755


SendEventParams ​

Defined in: goals/attacking.ts:1741

What minecraft:behavior.send_event declares.

Properties ​

choices ​

readonly choices: readonly SendEventChoice[]

Defined in: goals/attacking.ts:1743

The event sequences the goal may run, each with its own cast and cooldown.


ShareItemsParams ​

Defined in: goals/social.ts:723

What minecraft:behavior.share_items declares.

Properties ​

entityTypes ​

readonly entityTypes: readonly TargetEntityType[]

Defined in: goals/social.ts:724

goalRadius ​

readonly goalRadius: number

Defined in: goals/social.ts:729

How close it has to be to hand the item over, in blocks.

maxDistance ​

readonly maxDistance: number

Defined in: goals/social.ts:727

How far the entity looks for someone to give to, in blocks.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/social.ts:725


ShelterParams ​

Defined in: goals/movement.ts:1209

What minecraft:behavior.move_indoors and move_outdoors declare.

Properties ​

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/movement.ts:1210

timeoutCooldown ​

readonly timeoutCooldown: number

Defined in: goals/movement.ts:1212

How long before the goal may run again after it fails, in ticks.


SkeletonHorseTrapParams ​

Defined in: goals/specials.ts:345

What minecraft:behavior.skeleton_horse_trap declares.

Properties ​

duration ​

readonly duration: number

Defined in: goals/specials.ts:347

How long the trap stays armed, in ticks.

withinRadius ​

readonly withinRadius: number

Defined in: goals/specials.ts:349

How close a player has to come, in blocks.


SleepParams ​

Defined in: goals/environment.ts:87

What minecraft:behavior.sleep declares.

Properties ​

colliderHeight ​

readonly colliderHeight: number

Defined in: goals/environment.ts:92

How tall the entity's collision box is while it sleeps, in blocks.

colliderWidth ​

readonly colliderWidth: number

Defined in: goals/environment.ts:94

How wide it is, in blocks.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/environment.ts:88

timeoutCooldown ​

readonly timeoutCooldown: number

Defined in: goals/environment.ts:90

How long before the goal may run again after it fails, in ticks.

yOffset ​

readonly yOffset: number

Defined in: goals/environment.ts:96

How far below the bed the entity sits while asleep, in blocks.


SlimeRandomDirectionParams ​

Defined in: goals/specials.ts:242

What minecraft:behavior.slime_random_direction declares.

Properties ​

addRandomTimeRange ​

readonly addRandomTimeRange: number

Defined in: goals/specials.ts:246

How much longer it may keep it, in ticks.

minChangeDirectionTime ​

readonly minChangeDirectionTime: number

Defined in: goals/specials.ts:244

The least time the slime keeps one heading, in ticks.

turnRange ​

readonly turnRange: number

Defined in: goals/specials.ts:248

How far the heading may turn, in degrees.


SnackingParams ​

Defined in: goals/environment.ts:530

What minecraft:behavior.snacking declares.

Properties ​

cooldown ​

readonly cooldown: Range

Defined in: goals/environment.ts:534

How long before it snacks again, in ticks.

items ​

readonly items: readonly string[]

Defined in: goals/environment.ts:532

The items the entity snacks on.

stopChance ​

readonly stopChance: number

Defined in: goals/environment.ts:536

The chance per tick of stopping, in [0, 1].


SneezeParams ​

Defined in: goals/environment.ts:745

What minecraft:behavior.sneeze declares.

Properties ​

cooldown ​

readonly cooldown: number

Defined in: goals/environment.ts:749

How long before the next sneeze, in ticks.

dropItemChance ​

readonly dropItemChance: number

Defined in: goals/environment.ts:757

The chance of dropping an item, in [0, 1].

entityTypes ​

readonly entityTypes: readonly TargetEntityType[]

Defined in: goals/environment.ts:747

The entities the sneeze scares.

lootTable ​

readonly lootTable: string | undefined

Defined in: goals/environment.ts:759

The table the dropped item is rolled from.

prepareSound ​

readonly prepareSound: string | undefined

Defined in: goals/environment.ts:760

prepareTime ​

readonly prepareTime: number

Defined in: goals/environment.ts:751

How long the wind-up lasts, in ticks.

probability ​

readonly probability: number

Defined in: goals/environment.ts:753

The chance per tick of sneezing, in [0, 1].

sound ​

readonly sound: string | undefined

Defined in: goals/environment.ts:761

withinRadius ​

readonly withinRadius: number

Defined in: goals/environment.ts:755

How far the sneeze startles others, in blocks.


SniffParams ​

Defined in: goals/environment.ts:599

What minecraft:behavior.sniff declares.

Properties ​

cooldown ​

readonly cooldown: Range

Defined in: goals/environment.ts:603

How long between sniffs, in ticks.

duration ​

readonly duration: number

Defined in: goals/environment.ts:601

How long one sniff lasts, in ticks.

sniffingRadius ​

readonly sniffingRadius: number

Defined in: goals/environment.ts:605

How far the sniff reaches, in blocks.

suspicionRadiusHorizontal ​

readonly suspicionRadiusHorizontal: number

Defined in: goals/environment.ts:607

How far the entity remembers what it smelled, in blocks.

suspicionRadiusVertical ​

readonly suspicionRadiusVertical: number

Defined in: goals/environment.ts:608


SonicBoomParams ​

Defined in: goals/attacking.ts:967

What minecraft:behavior.sonic_boom declares.

Properties ​

attackSound ​

readonly attackSound: string | undefined

Defined in: goals/attacking.ts:977

chargeSound ​

readonly chargeSound: string | undefined

Defined in: goals/attacking.ts:976

cooldown ​

readonly cooldown: number

Defined in: goals/attacking.ts:971

How long before the beam can fire again, in ticks.

damage ​

readonly damage: number

Defined in: goals/attacking.ts:972

duration ​

readonly duration: number

Defined in: goals/attacking.ts:969

How long the charge and beam take together, in ticks.

heightCap ​

readonly heightCap: number

Defined in: goals/attacking.ts:975

horizontalStrength ​

readonly horizontalStrength: number

Defined in: goals/attacking.ts:973

verticalStrength ​

readonly verticalStrength: number

Defined in: goals/attacking.ts:974


StalkAndPounceParams ​

Defined in: goals/attacking.ts:1283

What minecraft:behavior.stalk_and_pounce_on_target declares.

Properties ​

interestTime ​

readonly interestTime: number

Defined in: goals/attacking.ts:1285

How long the entity watches before it pounces, in ticks.

leapDistance ​

readonly leapDistance: number

Defined in: goals/attacking.ts:1287

How far the pounce carries, in blocks.

leapHeight ​

readonly leapHeight: number

Defined in: goals/attacking.ts:1288

maxStalkDistance ​

readonly maxStalkDistance: number

Defined in: goals/attacking.ts:1290

How far the entity stalks from, in blocks.

pounceMaxDistance ​

readonly pounceMaxDistance: number

Defined in: goals/attacking.ts:1292

The furthest the pounce starts from, in blocks.

stalkSpeed ​

readonly stalkSpeed: number

Defined in: goals/attacking.ts:1295

strikeDistance ​

readonly strikeDistance: number

Defined in: goals/attacking.ts:1294

How close the pounce has to land to hurt, in blocks.

stuckTime ​

readonly stuckTime: number

Defined in: goals/attacking.ts:1297

How long the entity stays stuck before giving up, in ticks.


StompAttackParams ​

Defined in: goals/attacking.ts:1118

What minecraft:behavior.stomp_attack declares.

Extends ​

Properties ​

attackOnce ​

readonly attackOnce: boolean

Defined in: goals/attacking.ts:140

Inherited from ​

MeleeAttackParams.attackOnce

canSpreadOnFire ​

readonly canSpreadOnFire: boolean

Defined in: goals/attacking.ts:149

Inherited from ​

MeleeAttackParams.canSpreadOnFire

cooldownTime ​

readonly cooldownTime: number

Defined in: goals/attacking.ts:144

How long between swings, in ticks.

Inherited from ​

MeleeAttackParams.cooldownTime

meleeFov ​

readonly meleeFov: number

Defined in: goals/attacking.ts:148

How wide the swing arc is, in degrees.

Inherited from ​

MeleeAttackParams.meleeFov

noDamageRangeMultiplier ​

readonly noDamageRangeMultiplier: number

Defined in: goals/attacking.ts:1122

How far from the stomp the damage stops, as a multiple of the width.

onAttack ​

readonly onAttack: GoalEvent | undefined

Defined in: goals/attacking.ts:150

Inherited from ​

MeleeAttackParams.onAttack

onKill ​

readonly onKill: GoalEvent | undefined

Defined in: goals/attacking.ts:151

Inherited from ​

MeleeAttackParams.onKill

randomStopInterval ​

readonly randomStopInterval: number

Defined in: goals/attacking.ts:142

Inherited from ​

MeleeAttackParams.randomStopInterval

reachMultiplier ​

readonly reachMultiplier: number

Defined in: goals/attacking.ts:146

How far a swing reaches, as a multiple of the entity's width.

Inherited from ​

MeleeAttackParams.reachMultiplier

requireCompletePath ​

readonly requireCompletePath: boolean

Defined in: goals/attacking.ts:141

Inherited from ​

MeleeAttackParams.requireCompletePath

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/attacking.ts:138

Inherited from ​

MeleeAttackParams.speedMultiplier

stompRangeMultiplier ​

readonly stompRangeMultiplier: number

Defined in: goals/attacking.ts:1120

How far the stomp reaches, as a multiple of the entity's width.

trackTarget ​

readonly trackTarget: boolean

Defined in: goals/attacking.ts:139

Inherited from ​

MeleeAttackParams.trackTarget


StompTurtleEggParams ​

Defined in: goals/work.ts:929

What minecraft:behavior.stomp_turtle_egg declares.

Properties ​

goalRadius ​

readonly goalRadius: number

Defined in: goals/work.ts:935

How close counts as arriving, in blocks.

interval ​

readonly interval: number

Defined in: goals/work.ts:937

One tick in this many starts a search.

searchHeight ​

readonly searchHeight: number

Defined in: goals/work.ts:933

searchRange ​

readonly searchRange: number

Defined in: goals/work.ts:932

How far the entity looks for eggs, in blocks.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/work.ts:930


SummonChoice ​

Defined in: goals/attacking.ts:1637

One entry of summon_choices.

Properties ​

castDuration ​

readonly castDuration: number

Defined in: goals/attacking.ts:1640

How long the cast takes, in ticks.

cooldownTime ​

readonly cooldownTime: number

Defined in: goals/attacking.ts:1642

How long before the choice may run again, in ticks.

id ​

readonly id: number

Defined in: goals/attacking.ts:1638

maxActivationRange ​

readonly maxActivationRange: number

Defined in: goals/attacking.ts:1645

minActivationRange ​

readonly minActivationRange: number

Defined in: goals/attacking.ts:1644

How far the target may be, in blocks.

sequence ​

readonly sequence: readonly SummonStep[]

Defined in: goals/attacking.ts:1648

What the cast does, as the spell's own sequence of steps.

startSound ​

readonly startSound: string | undefined

Defined in: goals/attacking.ts:1646


SummonEntityParams ​

Defined in: goals/attacking.ts:1631

What minecraft:behavior.summon_entity declares.

Properties ​

choices ​

readonly choices: readonly SummonChoice[]

Defined in: goals/attacking.ts:1633

The summons, each with the spell it casts and how often it may run.


SummonStep ​

Defined in: goals/attacking.ts:1652

One step of a summon_choices sequence.

Properties ​

baseDelay ​

readonly baseDelay: number

Defined in: goals/attacking.ts:1661

entityType ​

readonly entityType: string | undefined

Defined in: goals/attacking.ts:1654

The entity type to create.

numberOfSummons ​

readonly numberOfSummons: number

Defined in: goals/attacking.ts:1656

How many to create.

spawnEvent ​

readonly spawnEvent: string | undefined

Defined in: goals/attacking.ts:1658

The event to run on each.

summonCap ​

readonly summonCap: number

Defined in: goals/attacking.ts:1660

How far from the caster they appear, in blocks.


SwellParams ​

Defined in: goals/attacking.ts:760

What minecraft:behavior.swell declares.

Properties ​

startDistance ​

readonly startDistance: number

Defined in: goals/attacking.ts:762

How close the target has to be to start swelling, in blocks.

stopDistance ​

readonly stopDistance: number

Defined in: goals/attacking.ts:764

How far the target has to get to stop it, in blocks.


SwimIdleParams ​

Defined in: goals/movement.ts:354

What minecraft:behavior.swim_idle declares.

Properties ​

idleTime ​

readonly idleTime: number

Defined in: goals/movement.ts:356

How long the entity hangs still, in ticks.

successRate ​

readonly successRate: number

Defined in: goals/movement.ts:358

The chance per tick of going idle, in [0, 1].


SwimWanderParams ​

Defined in: goals/movement.ts:299

What minecraft:behavior.swim_wander declares.

Properties ​

interval ​

readonly interval: number

Defined in: goals/movement.ts:302

One tick in this many starts a drift.

lookAhead ​

readonly lookAhead: number

Defined in: goals/movement.ts:304

How far ahead the entity aims, in blocks.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/movement.ts:300

wanderTime ​

readonly wanderTime: number

Defined in: goals/movement.ts:306

How long one drift lasts, in ticks.


SwimWithEntityParams ​

Defined in: goals/movement.ts:1569

What minecraft:behavior.swim_with_entity declares.

Properties ​

catchUpMultiplier ​

readonly catchUpMultiplier: number

Defined in: goals/movement.ts:1577

How much faster the entity swims when it falls behind.

catchUpThreshold ​

readonly catchUpThreshold: number

Defined in: goals/movement.ts:1579

How far behind counts as falling behind, in blocks.

chanceToStop ​

readonly chanceToStop: number

Defined in: goals/movement.ts:1581

The chance per check of letting the companion go, in [0, 1].

entityTypes ​

readonly entityTypes: readonly TargetEntityType[]

Defined in: goals/movement.ts:1570

matchDirectionThreshold ​

readonly matchDirectionThreshold: number

Defined in: goals/movement.ts:1587

How closely the entity matches the companion's heading, in blocks.

searchRange ​

readonly searchRange: number

Defined in: goals/movement.ts:1573

How far the goal looks for a companion, in blocks.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/movement.ts:1571

stateCheckInterval ​

readonly stateCheckInterval: number

Defined in: goals/movement.ts:1585

How many ticks between checks.

stopDistance ​

readonly stopDistance: number

Defined in: goals/movement.ts:1575

How close the entity swims, in blocks.

successRate ​

readonly successRate: number

Defined in: goals/movement.ts:1583

The chance per check of starting, in [0, 1].


TakeBlockParams ​

Defined in: goals/work.ts:890

What minecraft:behavior.take_block declares.

Properties ​

blocks ​

readonly blocks: readonly string[]

Defined in: goals/work.ts:896

The blocks the entity may pick up.

chance ​

readonly chance: number

Defined in: goals/work.ts:892

The chance per tick of taking a block, in [0, 1].

xzRange ​

readonly xzRange: Range

Defined in: goals/work.ts:893

yRange ​

readonly yRange: Range

Defined in: goals/work.ts:894


TargetEntityType ​

Defined in: params.ts:146

One entry of the entity_types nested table the targeting goals share.

The table is documented at Definitions/NestedTables/entity_types.md, and nearest_attackable_target, hurt_by_target, avoid_mob_type, share_items, defend_village_target and seven more all take it.

Properties ​

cooldown ​

readonly cooldown: number

Defined in: params.ts:158

How long the entry waits between attempts, in ticks.

filters ​

readonly filters: Filter | undefined

Defined in: params.ts:148

Which entities the entry matches, evaluated with the candidate as other.

maxDistance ​

readonly maxDistance: number

Defined in: params.ts:150

How far the entry reaches, in blocks.

mustSee ​

readonly mustSee: boolean

Defined in: params.ts:152

Whether the entity has to see the candidate.

mustSeeForgetDuration ​

readonly mustSeeForgetDuration: number

Defined in: params.ts:154

How long a seen candidate stays valid out of sight, in ticks.

sprintSpeedMultiplier ​

readonly sprintSpeedMultiplier: number

Defined in: params.ts:156

walkSpeedMultiplier ​

readonly walkSpeedMultiplier: number

Defined in: params.ts:155


TargetWhenPushedParams ​

Defined in: goals/targeting.ts:420

What minecraft:behavior.target_when_pushed declares.

Properties ​

entityTypes ​

readonly entityTypes: readonly TargetEntityType[]

Defined in: goals/targeting.ts:421

percentChance ​

readonly percentChance: number

Defined in: goals/targeting.ts:423

The chance of retaliating against a push, as a percentage.


TemptParams ​

Defined in: goals/social.ts:239

What minecraft:behavior.tempt declares.

Properties ​

canGetScared ​

readonly canGetScared: boolean

Defined in: goals/social.ts:246

Whether a sudden move or turn scares the entity off.

canTemptVertically ​

readonly canTemptVertically: boolean

Defined in: goals/social.ts:248

Whether the entity follows an item held above or below it.

canTemptWhileRidden ​

readonly canTemptWhileRidden: boolean

Defined in: goals/social.ts:250

Whether a ridden entity still follows the item.

items ​

readonly items: readonly string[]

Defined in: goals/social.ts:242

The items that tempt the entity.

onTemptEnd ​

readonly onTemptEnd: GoalEvent | undefined

Defined in: goals/social.ts:256

onTemptStart ​

readonly onTemptStart: GoalEvent | undefined

Defined in: goals/social.ts:255

soundInterval ​

readonly soundInterval: Range

Defined in: goals/social.ts:254

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/social.ts:240

stopDistance ​

readonly stopDistance: number

Defined in: goals/social.ts:252

How close the entity comes before it stops, in blocks.

temptSound ​

readonly temptSound: string | undefined

Defined in: goals/social.ts:253

withinRadius ​

readonly withinRadius: number

Defined in: goals/social.ts:244

How far the entity notices a held item, in blocks.


TestMobOptions ​

Defined in: harness.ts:115

Options for testMob.

Properties ​

families? ​

readonly optional families?: readonly string[]

Defined in: harness.ts:119

flags? ​

readonly optional flags?: Partial<Record<"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", boolean>>

Defined in: harness.ts:120

health? ​

readonly optional health?: number

Defined in: harness.ts:118

heldItem? ​

readonly optional heldItem?: string

Defined in: harness.ts:117

identifier? ​

readonly optional identifier?: string

Defined in: harness.ts:116

lastDamager? ​

readonly optional lastDamager?: GoalMob

Defined in: harness.ts:122

target? ​

readonly optional target?: GoalMob

Defined in: harness.ts:121


TimerFlagParams ​

Defined in: goals/specials.ts:516

What the three timer flag goals declare.

Properties ​

cooldown ​

readonly cooldown: Range

Defined in: goals/specials.ts:520

How long it stays down, in ticks.

duration ​

readonly duration: Range

Defined in: goals/specials.ts:518

How long the flag stays up, in ticks.

onEnd ​

readonly onEnd: GoalEvent | undefined

Defined in: goals/specials.ts:522

onStart ​

readonly onStart: GoalEvent | undefined

Defined in: goals/specials.ts:521


TradeInterestParams ​

Defined in: goals/social.ts:1004

What minecraft:behavior.trade_interest declares.

Properties ​

carriedItemSwitchTime ​

readonly carriedItemSwitchTime: number

Defined in: goals/social.ts:1006

How long the entity shows one item, in ticks.

cooldown ​

readonly cooldown: number

Defined in: goals/social.ts:1012

How long before the goal may run again, in ticks.

interestTime ​

readonly interestTime: number

Defined in: goals/social.ts:1008

How long before the entity loses interest, in ticks.

removeItemTime ​

readonly removeItemTime: number

Defined in: goals/social.ts:1010

How long it holds the last item out, in ticks.

withinRadius ​

readonly withinRadius: number

Defined in: goals/social.ts:1014

How far the player may be, in blocks.


TransportItemsParams ​

Defined in: goals/work.ts:556

What minecraft:behavior.transport_items declares.

Properties ​

destinationContainerTypes ​

readonly destinationContainerTypes: readonly string[]

Defined in: goals/work.ts:560

The containers it puts them into.

idleCooldown ​

readonly idleCooldown: number

Defined in: goals/work.ts:566

How long it waits between runs, in ticks.

initialCooldown ​

readonly initialCooldown: number

Defined in: goals/work.ts:568

How long it waits before the first run, in ticks.

maxStackSize ​

readonly maxStackSize: number

Defined in: goals/work.ts:562

How many items it moves at a time.

maxVisitedContainers ​

readonly maxVisitedContainers: number

Defined in: goals/work.ts:564

How many containers it visits before it gives up.

placeStrategy ​

readonly placeStrategy: string | undefined

Defined in: goals/work.ts:574

How it decides where an item goes.

searchDistance ​

readonly searchDistance: number

Defined in: goals/work.ts:570

How far it looks for a container, in blocks.

searchStrategy ​

readonly searchStrategy: string | undefined

Defined in: goals/work.ts:572

How it picks a container, which vanilla writes as a strategy name.

sourceContainerTypes ​

readonly sourceContainerTypes: readonly string[]

Defined in: goals/work.ts:558

The containers the entity takes items from.


UseKineticWeaponParams ​

Defined in: goals/attacking.ts:1365

What minecraft:behavior.use_kinetic_weapon declares.

Properties ​

approachDistance ​

readonly approachDistance: number

Defined in: goals/attacking.ts:1367

How close the entity rides in before it strikes, in blocks.

cooldownDistance ​

readonly cooldownDistance: Range

Defined in: goals/attacking.ts:1371

How long it waits between strikes, in ticks.

cooldownSpeedMultiplier ​

readonly cooldownSpeedMultiplier: number

Defined in: goals/attacking.ts:1381

hijackMountNavigation ​

readonly hijackMountNavigation: boolean

Defined in: goals/attacking.ts:1377

Whether the goal steers the mount rather than the rider.

repositionDistance ​

readonly repositionDistance: Range

Defined in: goals/attacking.ts:1369

How far it backs off after a strike, in blocks.

repositionSpeedMultiplier ​

readonly repositionSpeedMultiplier: number

Defined in: goals/attacking.ts:1380

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/attacking.ts:1379

trackTarget ​

readonly trackTarget: boolean

Defined in: goals/attacking.ts:1378

weaponMinSpeedMultiplier ​

readonly weaponMinSpeedMultiplier: number

Defined in: goals/attacking.ts:1375

The least speed the weapon needs to hurt, as a multiple of the mount's speed.

weaponReachMultiplier ​

readonly weaponReachMultiplier: number

Defined in: goals/attacking.ts:1373

How far the weapon reaches, as a multiple of its own reach.


VanillaGoalOptions ​

Defined in: register.ts:41

How the goals reach the world.

Properties ​

support? ​

optional support?: SupportSource

Defined in: register.ts:52

Replaces how the support object is built, for a caller that wants to wrap or record what the goals do.

Methods ​

world()? ​

optional world(entity): GoalWorld | undefined

Defined in: register.ts:47

Builds the world seam for one entity. A goal whose world cannot answer what it needs refuses to start, so leaving this out registers every goal and runs none of them.

Parameters ​
entity ​

EntityInstance

Returns ​

GoalWorld | undefined


VillageMoveParams ​

Defined in: goals/movement.ts:1105

What the village movement goals declare.

Properties ​

cooldown ​

readonly cooldown: number

Defined in: goals/movement.ts:1114

How long before the goal may run again, in ticks.

goalRadius ​

readonly goalRadius: number

Defined in: goals/movement.ts:1108

How close counts as arriving, in blocks.

searchRange ​

readonly searchRange: number

Defined in: goals/movement.ts:1110

How far the entity looks for the village, in blocks.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/movement.ts:1106

startChance ​

readonly startChance: number

Defined in: goals/movement.ts:1112

The chance per attempt of setting out, in [0, 1].


VoxelKind ​

Defined in: navigation/voxelGrid.ts:14

What one character of a voxelGrid layer stands for.

Properties ​

climbable? ​

readonly optional climbable?: boolean

Defined in: navigation/voxelGrid.ts:25

damaging? ​

readonly optional damaging?: boolean

Defined in: navigation/voxelGrid.ts:21

door? ​

readonly optional door?: DoorState

Defined in: navigation/voxelGrid.ts:20

identifier ​

readonly identifier: string

Defined in: navigation/voxelGrid.ts:15

lava? ​

readonly optional lava?: boolean

Defined in: navigation/voxelGrid.ts:19

passable ​

readonly passable: boolean

Defined in: navigation/voxelGrid.ts:16

portal? ​

readonly optional portal?: boolean

Defined in: navigation/voxelGrid.ts:24

skyVisible? ​

readonly optional skyVisible?: boolean

Defined in: navigation/voxelGrid.ts:23

solid ​

readonly solid: boolean

Defined in: navigation/voxelGrid.ts:17

sunlit? ​

readonly optional sunlit?: boolean

Defined in: navigation/voxelGrid.ts:22

water? ​

readonly optional water?: boolean

Defined in: navigation/voxelGrid.ts:18


WanderParams ​

Defined in: goals/movement.ts:106

What the wandering goals declare.

Extended by ​

Properties ​

interval ​

readonly interval: number

Defined in: goals/movement.ts:113

One tick in this many starts a walk.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/movement.ts:107

xzDistance ​

readonly xzDistance: number

Defined in: goals/movement.ts:109

How far the destination may be horizontally, in blocks.

yDistance ​

readonly yDistance: number

Defined in: goals/movement.ts:111

How far it may be vertically, in blocks.


WorkParams ​

Defined in: goals/work.ts:263

What the villager work goals declare.

Properties ​

activeTime ​

readonly activeTime: number

Defined in: goals/work.ts:266

How long one shift lasts, in ticks.

canWorkInRain ​

readonly canWorkInRain: boolean

Defined in: goals/work.ts:270

Whether the entity works in the rain.

goalCooldown ​

readonly goalCooldown: number

Defined in: goals/work.ts:268

How long before the entity may work again, in ticks.

onArrival ​

readonly onArrival: GoalEvent | undefined

Defined in: goals/work.ts:275

soundDelay ​

readonly soundDelay: Range

Defined in: goals/work.ts:274

How long between work sounds, in ticks.

speedMultiplier ​

readonly speedMultiplier: number

Defined in: goals/work.ts:264

workInRainTolerance ​

readonly workInRainTolerance: number

Defined in: goals/work.ts:272

How long a shower may last before it stops the work, in ticks.

Type Aliases ​

GoalBody ​

GoalBody = Record<string, unknown>

Defined in: params.ts:17

A JSON object, which is what every goal body is.


GoalWorldSource ​

GoalWorldSource = (entity) => GoalWorld | undefined

Defined in: world.ts:254

Resolves the world seam for one entity.

Parameters ​

entity ​

EntityInstance

Returns ​

GoalWorld | undefined


NavigationKind = typeof NAVIGATION_KINDS[number]

Defined in: navigation/profile.ts:18

One of NAVIGATION_KINDS.


Range ​

Range = readonly [number, number]

Defined in: params.ts:46

A [minimum, maximum] pair, which is how vanilla writes most of the ranges.


SupportSource ​

SupportSource = (entity) => GoalSupport

Defined in: goal.ts:18

Builds the support object a goal runs against.

Parameters ​

entity ​

EntityInstance

Returns ​

GoalSupport

Variables ​

const NAVIGATION_KINDS: readonly ["walk", "generic", "float", "hover", "climb", "fly", "swim"]

Defined in: navigation/profile.ts:15

The seven minecraft:navigation.* flavors vanilla declares.


SLIME_HOP_REACH ​

const SLIME_HOP_REACH: 4 = 4

Defined in: goals/slimeHeading.ts:67

How far one hop carries a slime, in blocks.


VOXEL_KINDS ​

const VOXEL_KINDS: Readonly<Record<string, VoxelKind>>

Defined in: navigation/voxelGrid.ts:35

The characters voxelGrid reads.

. air, # stone, ~ water, ! lava, D a closed door, d an open door, I a closed iron door, * fire, L a ladder, o a nether portal, s air the sky reaches.


admireItem ​

const admireItem: RegisterableGoal

Defined in: goals/social.ts:1105

minecraft:behavior.admire_item, which the piglin carries. The admiration timer itself lives in minecraft:admire_item; the goal holds the entity still while it runs.


aquaticChargeAttack ​

const aquaticChargeAttack: RegisterableGoal

Defined in: goals/attacking.ts:495

minecraft:behavior.aquatic_charge_attack, which the guardian line carries. It is the same charge with the swim speed and knockback the aquatic bodies set.


attackingGoals ​

const attackingGoals: readonly RegisterableGoal[]

Defined in: goals/attacking.ts:1861

Every goal in the attacking family.


avoidBlock ​

const avoidBlock: RegisterableGoal

Defined in: goals/movement.ts:663

minecraft:behavior.avoid_block, which the strider and the hoglin carry. The entity walks away from a block type rather than from a mob.


avoidMobType ​

const avoidMobType: RegisterableGoal

Defined in: goals/movement.ts:565

minecraft:behavior.avoid_mob_type, which 28 vanilla entities carry.

Java's AvoidEntityGoal draws a position 16 blocks out and 7 up away from the threat and refuses it when it is no further from the threat than the entity already is, which is the condition here.


barter ​

const barter: RegisterableGoal

Defined in: goals/social.ts:1079

minecraft:behavior.barter, which the piglin carries. The piglin throws back an item from its barter table once it has finished admiring the gold.


beg ​

const beg: RegisterableGoal

Defined in: goals/social.ts:848

minecraft:behavior.beg, which the wolf carries.

Java's BegGoal holds the beg for 40 to 80 ticks while the player keeps holding an interesting item, which is what look_time spells here.


breed ​

const breed: RegisterableGoal

Defined in: goals/social.ts:76

minecraft:behavior.breed, which 26 vanilla entities carry.

The partner search, the 60-tick courtship and the 3-block distance come from Java's BreedGoal. Whether two entities may breed at all is the server's to answer through GoalWorld.canBreedWith, because the rule lives in minecraft:breedable rather than in the goal.


celebrate ​

const celebrate: RegisterableGoal

Defined in: goals/specials.ts:426

minecraft:behavior.celebrate, which the five raid entities carry. The entity jumps and shouts after a raid is won.


celebrateSurvive ​

const celebrateSurvive: RegisterableGoal

Defined in: goals/specials.ts:482

minecraft:behavior.celebrate_survive, which the villager and the iron golem carry. Surviving a raid is celebrated with fireworks rather than jumping.


chargeAttack ​

const chargeAttack: RegisterableGoal

Defined in: goals/attacking.ts:483

minecraft:behavior.charge_attack, which the vex carries. It rushes the target in a straight line and goes on cooldown after the hit.


chargeHeldItem ​

const chargeHeldItem: RegisterableGoal

Defined in: goals/attacking.ts:1602

minecraft:behavior.charge_held_item, which the skeleton line and the piglin carry. It draws the bow or crossbow the entity holds before the ranged attack fires it.


circleAroundAnchor ​

const circleAroundAnchor: RegisterableGoal

Defined in: goals/movement.ts:1397

minecraft:behavior.circle_around_anchor, which the phantom carries. The anchor is the position the phantom spawned above, and the goal keeps it orbiting there between dives.


controlledByPlayer ​

const controlledByPlayer: RegisterableGoal

Defined in: goals/social.ts:604

minecraft:behavior.controlled_by_player, which the pig and the strider carry. It is player_ride_tamed for an entity steered with an item rather than taming.


croak ​

const croak: RegisterableGoal

Defined in: goals/environment.ts:581

minecraft:behavior.croak, which the frog carries. It is the idle animation, and the filters keep it on land.


defaultNavigationProfile ​

const defaultNavigationProfile: NavigationProfile

Defined in: navigation/profile.ts:63

The profile of an entity with no minecraft:navigation.* component: a one-block walker that opens nothing and avoids nothing.


defendTrustedTarget ​

const defendTrustedTarget: RegisterableGoal

Defined in: goals/targeting.ts:338

minecraft:behavior.defend_trusted_target, which the fox carries.

It attacks whatever hurt an entity this one trusts, which is the trusts fact on the filter view.


defendVillageTarget ​

const defendVillageTarget: RegisterableGoal

Defined in: goals/targeting.ts:398

minecraft:behavior.defend_village_target, which the iron golem carries.

Java's DefendVillageTargetGoal scans the golem's own bounding box inflated by its follow range rather than a fixed radius, and prefers a hurt villager's attacker over a raider. This takes the nearest candidate the entity_types table accepts within 64 blocks, because the package has no village model to ask who belongs to it.


delayedAttack ​

const delayedAttack: RegisterableGoal

Defined in: goals/attacking.ts:225

minecraft:behavior.delayed_attack, which the ravager carries.

It is the melee loop with the damage landing part way into the swing rather than at its start, which is what hit_delay_pct of attack_duration measures.


dig ​

const dig: RegisterableGoal

Defined in: goals/environment.ts:651

minecraft:behavior.dig, which the warden carries. It is how the warden leaves when nothing has disturbed it for long enough.


dragonChargePlayer ​

const dragonChargePlayer: RegisterableGoal

Defined in: goals/specials.ts:70

minecraft:behavior.dragonchargeplayer, the dragon's dive at a player.


dragonDeath ​

const dragonDeath: RegisterableGoal

Defined in: goals/specials.ts:85

minecraft:behavior.dragondeath, which holds the dragon still until its death animation ends.


dragonFlaming ​

const dragonFlaming: RegisterableGoal

Defined in: goals/specials.ts:79

minecraft:behavior.dragonflaming, the dragon's breath attack from the portal.


dragonHoldingPattern ​

const dragonHoldingPattern: RegisterableGoal

Defined in: goals/specials.ts:61

minecraft:behavior.dragonholdingpattern, the dragon's default circling of the end crystals.


dragonLanding ​

const dragonLanding: RegisterableGoal

Defined in: goals/specials.ts:73

minecraft:behavior.dragonlanding, the dragon's descent to the portal.


dragonScanning ​

const dragonScanning: RegisterableGoal

Defined in: goals/specials.ts:64

minecraft:behavior.dragonscanning, the dragon's pause on the portal while it chooses a target.


dragonStrafePlayer ​

const dragonStrafePlayer: RegisterableGoal

Defined in: goals/specials.ts:67

minecraft:behavior.dragonstrafeplayer, the dragon's strafing fireball run.


dragonTakeoff ​

const dragonTakeoff: RegisterableGoal

Defined in: goals/specials.ts:76

minecraft:behavior.dragontakeoff, the dragon's climb back off the portal.


drinkMilk ​

const drinkMilk: RegisterableGoal

Defined in: goals/environment.ts:504

minecraft:behavior.drink_milk, which the baby zombie villager carries. It is the cure, and the filters decide when it may run.


drinkPotion ​

const drinkPotion: RegisterableGoal

Defined in: goals/attacking.ts:1560

minecraft:behavior.drink_potion, which the witch and the pillager carry. The entity picks the first potion whose chance comes up and drinks it.


dropItemFor ​

const dropItemFor: RegisterableGoal

Defined in: goals/social.ts:1162

minecraft:behavior.drop_item_for, which the cat carries. It is the gift a tamed cat leaves on its owner's bed in the morning.


eatBlock ​

const eatBlock: RegisterableGoal

Defined in: goals/environment.ts:418

minecraft:behavior.eat_block, which the sheep carries.

Java's EatBlockGoal runs a 40-tick animation and starts on a 1-in-1000 chance per tick for an adult, 1 in 50 for a lamb, which is what the success_chance expression spells in Bedrock.


eatCarriedItem ​

const eatCarriedItem: RegisterableGoal

Defined in: goals/environment.ts:477

minecraft:behavior.eat_carried_item, which the fox carries. The entity eats whatever food it picked up after the delay runs out.


eatMob ​

const eatMob: RegisterableGoal

Defined in: goals/attacking.ts:1486

minecraft:behavior.eat_mob, which the frog carries. It pulls the prey in with its tongue and swallows it whole, which is why it has a loot table rather than an attack.


emerge ​

const emerge: RegisterableGoal

Defined in: goals/specials.ts:394

minecraft:behavior.emerge, which the warden carries. The warden is immobile while it rises out of the ground, so the goal takes every control flag.


emptyBody ​

const emptyBody: ComponentSchema<GoalBody>

Defined in: params.ts:177

Accepts any object body, for a goal whose behavior takes no parameters.


emptyGoalWorld ​

const emptyGoalWorld: GoalWorld = {}

Defined in: world.ts:251

A world that answers nothing, which is what a goal gets when the server supplies none.


environmentGoals ​

const environmentGoals: readonly RegisterableGoal[]

Defined in: goals/environment.ts:860

Every goal in the environment family.


equipItem ​

const equipItem: RegisterableGoal

Defined in: goals/work.ts:249

minecraft:behavior.equip_item, which 17 vanilla entities carry. It puts what minecraft:behavior.pickup_items collected into the right slot, which is why vanilla gives both to the same entities at neighboring priorities.


exploreOutskirts ​

const exploreOutskirts: RegisterableGoal

Defined in: goals/movement.ts:1300

minecraft:behavior.explore_outskirts, which the wandering trader carries. It walks past the edge of the village and waits there before coming back.


fertilizeFarmBlock ​

const fertilizeFarmBlock: RegisterableGoal

Defined in: goals/work.ts:392

minecraft:behavior.fertilize_farm_block, which the farmer villager carries. It is harvest_farm_block with bone meal instead of a break.


findCover ​

const findCover: RegisterableGoal

Defined in: goals/movement.ts:768

minecraft:behavior.find_cover, which the fox carries. It is flee_sun with a cooldown, and it runs in daylight and in rain.


findMount ​

const findMount: RegisterableGoal

Defined in: goals/social.ts:530

minecraft:behavior.find_mount, which the eight jockey entities carry. It is what puts a baby zombie on a chicken.


findUnderwaterTreasure ​

const findUnderwaterTreasure: RegisterableGoal

Defined in: goals/movement.ts:1361

minecraft:behavior.find_underwater_treasure, which the dolphin carries. It swims toward the nearest buried treasure and stops short of it, which is what leads a player there.


fireAtTarget ​

const fireAtTarget: RegisterableGoal

Defined in: goals/attacking.ts:371

minecraft:behavior.fire_at_target, which the breeze carries.

Unlike ranged_attack it never closes the distance: it aims, waits out pre_shoot_delay, creates the projectile_def entity and waits out post_shoot_delay.


fleeSun ​

const fleeSun: RegisterableGoal

Defined in: goals/movement.ts:730

minecraft:behavior.flee_sun, which the seven sunlight-sensitive entities carry.

Java's FleeSunGoal checks its five preconditions before drawing, then tries ten positions in a 20 by 6 by 20 box and keeps the first hidden, negatively valued position. It does not pathfind each candidate.


float ​

const float: RegisterableGoal

Defined in: goals/movement.ts:399

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.

Java's FloatGoal jumps on a 0.8 chance per tick while the entity is in a fluid deeper than its jump threshold, which is where the default comes from.


floatTempt ​

const floatTempt: RegisterableGoal

Defined in: goals/social.ts:340

minecraft:behavior.float_tempt, which the happy ghast carries. It is tempt for an entity that floats, so the item tempts it vertically as well.


floatWander ​

const floatWander: RegisterableGoal

Defined in: goals/movement.ts:252

minecraft:behavior.float_wander, which the ghast, the blaze and the vex carry. The entity drifts to a point in the air for a drawn time rather than walking a path to it.


followCaravan ​

const followCaravan: RegisterableGoal

Defined in: goals/movement.ts:1737

minecraft:behavior.follow_caravan, which the llama and the trader llama carry. A caravan is a chain, so the entity follows whichever llama is not already followed.


followMob ​

const followMob: RegisterableGoal

Defined in: goals/movement.ts:1709

minecraft:behavior.follow_mob, which the zombie villager and the wandering trader's llama carry. The filters pick whom to follow.

Java's FollowMobGoal re-paths every 10 ticks and stops at stop_distance, which is the shape here.


followOwner ​

const followOwner: RegisterableGoal

Defined in: goals/social.ts:372

minecraft:behavior.follow_owner, which the five tamable entities carry.

Java's FollowOwnerGoal sets off past start_distance, stops inside stop_distance and teleports when the path is blocked, which is what can_teleport selects.


followParent ​

const followParent: RegisterableGoal

Defined in: goals/social.ts:192

minecraft:behavior.follow_parent, which 24 vanilla entities carry.

Java's FollowParentGoal scans 8 blocks out and 4 up, ignores a parent closer than 3 blocks, gives up past 16 and re-paths every 10 ticks.


followTargetCaptain ​

const followTargetCaptain: RegisterableGoal

Defined in: goals/movement.ts:1760

minecraft:behavior.follow_target_captain, which the pillager and the ravager carry. The captain is the raid leader, which the minecraft:is_illager_captain component marks.


goAndGiveItemsToNoteblock ​

const goAndGiveItemsToNoteblock: RegisterableGoal

Defined in: goals/social.ts:1278

minecraft:behavior.go_and_give_items_to_noteblock, which the allay carries. It is the same delivery with the note block it heard as the destination.


goAndGiveItemsToOwner ​

const goAndGiveItemsToOwner: RegisterableGoal

Defined in: goals/social.ts:1240

minecraft:behavior.go_and_give_items_to_owner, which the allay carries. It carries whatever it picked up back to the player who gave it an item.


goHome ​

const goHome: RegisterableGoal

Defined in: goals/movement.ts:1070

minecraft:behavior.go_home, which the bee, the turtle and the dolphin carry. It differs from the restriction goals in that it fires events when the entity arrives or gives up.


goalInventory ​

const goalInventory: GoalInventory = data

Defined in: inventory.ts:51

The measured inventory of the vanilla pack this package was written against.


goalNames ​

const goalNames: readonly string[]

Defined in: inventory.ts:54

Every vanilla goal name, in descending use order.


guardianAttack ​

const guardianAttack: RegisterableGoal

Defined in: goals/attacking.ts:1173

minecraft:behavior.guardian_attack, which the guardian and the elder guardian carry. The beam takes time to lock on, which is why the goal holds the entity still rather than closing in.


harvestFarmBlock ​

const harvestFarmBlock: RegisterableGoal

Defined in: goals/work.ts:359

minecraft:behavior.harvest_farm_block, which the farmer villager and the villager_v2 carry. It walks to a grown crop and breaks it.


hide ​

const hide: RegisterableGoal

Defined in: goals/environment.ts:228

minecraft:behavior.hide, which the villager carries. A raid bell sends villagers to the nearest house, which is the point of interest named here.


holdGround ​

const holdGround: RegisterableGoal

Defined in: goals/attacking.ts:826

minecraft:behavior.hold_ground, which the piglin brute carries. It stands and faces its target instead of charging, and can call friends in.


hurtByTarget ​

const hurtByTarget: RegisterableGoal

Defined in: goals/targeting.ts:231

minecraft:behavior.hurt_by_target, which 42 vanilla entities carry, 31 of them at priority 1.

It takes the last entity that damaged this one. Java's HurtByTargetGoal remembers an unseen revenge target for 300 ticks rather than the 60 every other target goal uses, and alerts friends within 10 blocks vertically.


inspectBookshelf ​

const inspectBookshelf: RegisterableGoal

Defined in: goals/work.ts:508

minecraft:behavior.inspect_bookshelf, which the librarian villager carries. It walks to a bookshelf and stands reading it.


investigateSuspiciousLocation ​

const investigateSuspiciousLocation: RegisterableGoal

Defined in: goals/movement.ts:1343

minecraft:behavior.investigate_suspicious_location, which the sniffer and the warden carry. It walks to the position the suspicion tracking component recorded.


jumpAroundTarget ​

const jumpAroundTarget: RegisterableGoal

Defined in: goals/attacking.ts:590

minecraft:behavior.jump_around_target, which the breeze carries. It hops to a new position around the target instead of closing in.


jumpToBlock ​

const jumpToBlock: RegisterableGoal

Defined in: goals/movement.ts:1463

minecraft:behavior.jump_to_block, which the goat and the cat carry. The entity leaps across a gap rather than walking around it.


knockbackRoar ​

const knockbackRoar: RegisterableGoal

Defined in: goals/attacking.ts:918

minecraft:behavior.knockback_roar, which the ravager carries. It throws everything in range away part way into the roar.


layDown ​

const layDown: RegisterableGoal

Defined in: goals/environment.ts:276

minecraft:behavior.lay_down, which the panda carries. It is a lie-down with no timer: the entity gets up on a random roll rather than after a set time.


layEgg ​

const layEgg: RegisterableGoal

Defined in: goals/work.ts:776

minecraft:behavior.lay_egg, which the turtle and the frog carry. The entity walks to sand or a spawn-friendly block and leaves an egg there.


leapAtTarget ​

const leapAtTarget: RegisterableGoal

Defined in: goals/attacking.ts:530

minecraft:behavior.leap_at_target, which five vanilla entities carry.

The conditions are Java's LeapAtTargetGoal: the target has to be between 2 and 4 blocks away, the entity has to be on the ground, and one tick in five starts the leap. The leap itself adds 0.4 of the direction to the target plus 0.2 of the current velocity, with yd upward.


lookAtEntity ​

const lookAtEntity: RegisterableGoal

Defined in: goals/looking.ts:114

minecraft:behavior.look_at_entity, which four vanilla entities carry. It is look_at_player with a filter instead of a fixed subject type.


lookAtPlayer ​

const lookAtPlayer: RegisterableGoal

Defined in: goals/looking.ts:92

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.


lookAtTarget ​

const lookAtTarget: RegisterableGoal

Defined in: goals/looking.ts:130

minecraft:behavior.look_at_target, which the warden carries. It watches whatever the targeting goals chose rather than looking for a subject.


lookAtTradingPlayer ​

const lookAtTradingPlayer: RegisterableGoal

Defined in: goals/looking.ts:147

minecraft:behavior.look_at_trading_player, which the three trader entities carry. It holds the head on whoever has the trade screen open, so it never ends on its own.


lookingGoals ​

const lookingGoals: readonly RegisterableGoal[]

Defined in: goals/looking.ts:284

Every goal in the looking family.


makeLove ​

const makeLove: RegisterableGoal

Defined in: goals/social.ts:120

minecraft:behavior.make_love, which the villager carries. It is the villager's breeding goal, and the child is a new villager rather than a baby of the same type.


meleeAttack ​

const meleeAttack: RegisterableGoal

Defined in: goals/attacking.ts:203

minecraft:behavior.melee_attack, which the hoglin carries.

Java's MeleeAttackGoal is the same goal and is where the 20-tick swing cadence and the 10-tick re-path interval come from.


meleeBoxAttack ​

const meleeBoxAttack: RegisterableGoal

Defined in: goals/attacking.ts:190

minecraft:behavior.melee_box_attack, the attack 32 vanilla entities carry.

Bedrock splits melee in two: this one tests the entity's collision box against the target's, and melee_attack tests the distance. The difference does not survive into a server with no collision boxes in the goal seam, so both run the same loop and reach_multiplier is the only thing that varies.


mingle ​

const mingle: RegisterableGoal

Defined in: goals/social.ts:675

minecraft:behavior.mingle, which the villager carries. It is the gathering at the village bell, which the villager schedule drives.


mountPathing ​

const mountPathing: RegisterableGoal

Defined in: goals/movement.ts:1792

minecraft:behavior.mount_pathing, which 26 vanilla entities carry. It is how a mounted entity goes after a target while it is riding something.

Only while it is riding something, which is the gate this goal turns on. The adult zombie carries it at priority 2 and minecraft:behavior. melee_box_attack at priority 4, and both claim the move and look flags, so a version that started on nothing more than having a target took those flags off the attack at every priority below it and left the zombie standing still in front of the player it had chosen. Mojang's own wording is "while mounted", and the vanilla priorities only make sense that way.


moveAroundTarget ​

const moveAroundTarget: RegisterableGoal

Defined in: goals/attacking.ts:665

minecraft:behavior.move_around_target, which the breeze carries. It keeps the entity circling its target at a distance rather than closing in.


moveIndoors ​

const moveIndoors: RegisterableGoal

Defined in: goals/movement.ts:1225

minecraft:behavior.move_indoors, which the villager and the cat carry. It sends the entity to the nearest indoor point of interest at night and in rain.


moveOutdoors ​

const moveOutdoors: RegisterableGoal

Defined in: goals/movement.ts:1257

minecraft:behavior.move_outdoors, which the villager carries. It is move_indoors in reverse, and it runs in the morning.


moveThroughVillage ​

const moveThroughVillage: RegisterableGoal

Defined in: goals/movement.ts:1184

minecraft:behavior.move_through_village, which the villager carries.

The docs state the restriction outright: "Can only be used by Villagers." Java's MoveThroughVillageGoal walks the village's door positions at night, which only_at_night selects here.


moveToBlock ​

const moveToBlock: RegisterableGoal

Defined in: goals/movement.ts:922

minecraft:behavior.move_to_block, which the villager carries for its bed and bell. The target_blocks list and target_offset decide where the entity ends up standing.

Java's MoveToBlockGoal searches again every 200 to 400 ticks and gives up after 1200. Bedrock documents no default for tick_interval, so this uses 20 ticks, which is one second and matches what the vanilla bodies that set the key write.


moveToLand ​

const moveToLand: RegisterableGoal

Defined in: goals/movement.ts:945

minecraft:behavior.move_to_land, which the turtle and the axolotl carry. The destination is a solid block the entity can stand on rather than a named block type, so the search runs over the navigation view.


moveToLiquid ​

const moveToLiquid: RegisterableGoal

Defined in: goals/movement.ts:977

minecraft:behavior.move_to_liquid, which the strider carries. The material_type names which liquid, so lava and water share one goal.


moveToRandomBlock ​

const moveToRandomBlock: RegisterableGoal

Defined in: goals/movement.ts:995

minecraft:behavior.move_to_random_block, which the ravager and the piglin carry. It walks to a block inside its radius without caring which block it is, which is how a raid mob mills about a village.


moveToVillage ​

const moveToVillage: RegisterableGoal

Defined in: goals/movement.ts:1129

minecraft:behavior.move_to_village, which the five raid entities carry. It walks the entity to the nearest village.


moveToWater ​

const moveToWater: RegisterableGoal

Defined in: goals/movement.ts:933

minecraft:behavior.move_to_water, which the four amphibious entities carry. It is the block search pinned to water.


moveTowardsDwellingRestriction ​

const moveTowardsDwellingRestriction: RegisterableGoal

Defined in: goals/movement.ts:1052

minecraft:behavior.move_towards_dwelling_restriction, which the villager and the iron golem carry. The dwelling is the village the minecraft:dweller component binds the entity to.


moveTowardsHomeRestriction ​

const moveTowardsHomeRestriction: RegisterableGoal

Defined in: goals/movement.ts:1034

minecraft:behavior.move_towards_home_restriction, which four vanilla entities carry. It pulls the entity back inside the radius of its minecraft:home component.


moveTowardsTarget ​

const moveTowardsTarget: RegisterableGoal

Defined in: goals/attacking.ts:723

minecraft:behavior.move_towards_target, which the iron golem carries.

Java's MoveTowardsTargetGoal runs while the target stays inside the radius and stops when the navigation finishes, which is the shape here.


movementGoals ​

const movementGoals: readonly RegisterableGoal[]

Defined in: goals/movement.ts:1983

Every goal in the movement family.


nap ​

const nap: RegisterableGoal

Defined in: goals/environment.ts:168

minecraft:behavior.nap, which the fox carries. The entity sleeps where it stands in daylight and wakes when something comes near.


nearestAttackableTarget ​

const nearestAttackableTarget: RegisterableGoal

Defined in: goals/targeting.ts:156

minecraft:behavior.nearest_attackable_target, the second most used targeting goal: 49 vanilla entities carry it, usually at priority 2 with must_see set.

It takes the nearest candidate any entity_types entry accepts. Java's NearestAttackableTargetGoal is the same goal and contributes the scan interval of one tick in ten.


nearestPrioritizedAttackableTarget ​

const nearestPrioritizedAttackableTarget: RegisterableGoal

Defined in: goals/targeting.ts:184

minecraft:behavior.nearest_prioritized_attackable_target, which three entities carry.

It differs from nearest_attackable_target in that the order of the entity_types entries is a priority order rather than a list to match against, so the first entry that has any candidate wins even when a later entry's candidate is nearer.


ocelotAttack ​

const ocelotAttack: RegisterableGoal

Defined in: goals/attacking.ts:1228

minecraft:behavior.ocelotattack, which the ocelot and the cat carry. It sneaks up, sprints the last stretch and swings.


ocelotSitOnBlock ​

const ocelotSitOnBlock: RegisterableGoal

Defined in: goals/environment.ts:355

minecraft:behavior.ocelot_sit_on_block, which the cat and the ocelot carry. The entity finds a chest, a furnace or a bed and sits on top of it.


offerFlower ​

const offerFlower: RegisterableGoal

Defined in: goals/social.ts:896

minecraft:behavior.offer_flower, which the iron golem carries.

Java's OfferFlowerGoal offers a poppy to a villager within 6 blocks on a 1-in-8000 chance per tick and holds it out for 400 ticks.


openDoor ​

const openDoor: RegisterableGoal

Defined in: goals/movement.ts:1888

minecraft:behavior.open_door, which the villager carries.

Java's OpenDoorGoal closes the door 20 ticks after passing through when close_door_after is set, which is the forgetTime of its parent DoorInteractGoal.


ownerHurtByTarget ​

const ownerHurtByTarget: RegisterableGoal

Defined in: goals/targeting.ts:266

minecraft:behavior.owner_hurt_by_target, which the wolf carries.

It takes whatever hurt the entity's owner. Java's OwnerHurtByTargetGoal is the same goal.


ownerHurtTarget ​

const ownerHurtTarget: RegisterableGoal

Defined in: goals/targeting.ts:297

minecraft:behavior.owner_hurt_target, which the wolf carries.

It takes whatever the entity's owner is attacking, which is what makes a tamed wolf join its owner's fight. Java's OwnerHurtTargetGoal is the same goal.


panic ​

const panic: RegisterableGoal

Defined in: goals/movement.ts:482

minecraft:behavior.panic, which 37 vanilla entities carry, 32 of them at priority 1.

Java's PanicGoal looks for water within 5 blocks when the entity is on fire and otherwise draws a position 5 blocks out and 4 up, which is the shape here.


petSleepWithOwner ​

const petSleepWithOwner: RegisterableGoal

Defined in: goals/social.ts:447

minecraft:behavior.pet_sleep_with_owner, which the cat carries. The cat finds the bed its owner is in and curls up on it.


pickupItems ​

const pickupItems: RegisterableGoal

Defined in: goals/work.ts:136

minecraft:behavior.pickup_items, which 20 vanilla entities carry. It is what makes a zombie pick up armor and a fox carry a berry.


placeBlock ​

const placeBlock: RegisterableGoal

Defined in: goals/work.ts:854

minecraft:behavior.place_block, which the enderman and the snow golem carry. The docs describe the pair outright: "like Endermen placing their carried block or snow golems leaving snow trails".


play ​

const play: RegisterableGoal

Defined in: goals/social.ts:628

minecraft:behavior.play, which the baby villager carries. It chases another young villager around the village.


playDead ​

const playDead: RegisterableGoal

Defined in: goals/environment.ts:715

minecraft:behavior.play_dead, which the axolotl carries. A hurt axolotl drops to the bottom, regenerates and is ignored while it is down.


playerRideTamed ​

const playerRideTamed: RegisterableGoal

Defined in: goals/social.ts:586

minecraft:behavior.player_ride_tamed, which the ten rideable tamed entities carry. It hands movement to the rider, so the goal holds the move flag and does nothing with it.


raidGarden ​

const raidGarden: RegisterableGoal

Defined in: goals/work.ts:446

minecraft:behavior.raid_garden, which the rabbit and the fox carry. The entity eats its way along a row of crops and leaves when it has had enough.


ramAttack ​

const ramAttack: RegisterableGoal

Defined in: goals/attacking.ts:1060

minecraft:behavior.ram_attack, which the goat carries. It backs off to ram_distance, charges in a straight line and knocks the target away.


randomBreach ​

const randomBreach: RegisterableGoal

Defined in: goals/environment.ts:815

minecraft:behavior.random_breach, which the dolphin carries. The entity jumps clear of the water, which is why it aims above the surface.


randomFly ​

const randomFly: RegisterableGoal

Defined in: goals/movement.ts:180

minecraft:behavior.random_fly, which the parrot carries. The destination is drawn in three dimensions, so the entity needs a flying navigation component for the path finder to reach it.


randomHover ​

const randomHover: RegisterableGoal

Defined in: goals/movement.ts:207

minecraft:behavior.random_hover, which the bee and the allay carry. It is the flying wander with the destination's height pinned to a band above the ground.


randomLookAround ​

const randomLookAround: RegisterableGoal

Defined in: goals/looking.ts:173

minecraft:behavior.random_look_around, which 55 vanilla entities carry.

Java's RandomLookAroundGoal picks a direction on the unit circle, looks there for 20 to 40 ticks and starts on a 0.02 chance per tick.


randomLookAroundAndSit ​

const randomLookAroundAndSit: RegisterableGoal

Defined in: goals/looking.ts:229

minecraft:behavior.random_look_around_and_sit, which the panda, the fox and the goat carry. The entity sits, takes a few glances and stands up.


randomSearchAndDig ​

const randomSearchAndDig: RegisterableGoal

Defined in: goals/work.ts:679

minecraft:behavior.random_search_and_dig, which the sniffer carries. The entity walks to a diggable block, digs for a drawn time and leaves a seed behind.


randomSitting ​

const randomSitting: RegisterableGoal

Defined in: goals/environment.ts:313

minecraft:behavior.random_sitting, which the panda carries. It is lay_down with a minimum time, so the entity cannot stand up the tick after it sat.


randomStroll ​

const randomStroll: RegisterableGoal

Defined in: goals/movement.ts:130

minecraft:behavior.random_stroll, the wander 64 vanilla entities carry.

Java's RandomStrollGoal draws a reachable position within 10 blocks horizontally and 7 vertically and tries one tick in 120, which is the DEFAULT_INTERVAL constant.


randomSwim ​

const randomSwim: RegisterableGoal

Defined in: goals/movement.ts:150

minecraft:behavior.random_swim, the wander the 12 water mobs carry. It is random_stroll with a wider default box and an avoid_surface flag that keeps the destination under water.


rangedAttack ​

const rangedAttack: RegisterableGoal

Defined in: goals/attacking.ts:270

minecraft:behavior.ranged_attack, which 14 vanilla entities carry.

attack_interval is the key with two spellings in vanilla: eight files write {"range_min": a, "range_max": b} in seconds and five write the pair as attack_interval_min and attack_interval_max, so both are read. Java's RangedAttackGoal keeps a sight timer before the first shot, which target_in_sight_time is the Bedrock spelling of.


receiveLove ​

const receiveLove: RegisterableGoal

Defined in: goals/social.ts:161

minecraft:behavior.receive_love, which the villager carries. It is the other half of make_love: the partner stands still and waits.


restrictOpenDoor ​

const restrictOpenDoor: RegisterableGoal

Defined in: goals/movement.ts:1944

minecraft:behavior.restrict_open_door, which the villager carries. It keeps the entity from opening doors at night, which is what sends villagers indoors rather than out.


riseToLiquidLevel ​

const riseToLiquidLevel: RegisterableGoal

Defined in: goals/movement.ts:438

minecraft:behavior.rise_to_liquid_level, which the strider carries. It keeps the entity floating at a fixed offset from the lava surface.


roar ​

const roar: RegisterableGoal

Defined in: goals/attacking.ts:872

minecraft:behavior.roar, which the warden carries. It holds the entity still for the roar animation.


roll ​

const roll: RegisterableGoal

Defined in: goals/environment.ts:681

minecraft:behavior.roll, which the armadillo carries. The entity rolls into a ball, which is a short animation rather than a move.


runAroundLikeCrazy ​

const runAroundLikeCrazy: RegisterableGoal

Defined in: goals/movement.ts:1838

minecraft:behavior.run_around_like_crazy, which the six horse types carry.

Java's RunAroundLikeCrazyGoal bucks the rider off on a 1-in-50 chance per tick while the horse is untamed, and the temper roll decides whether the horse tames instead.


scared ​

const scared: RegisterableGoal

Defined in: goals/movement.ts:1868

minecraft:behavior.scared, which the panda carries. The entity freezes during a thunderstorm instead of going about its business.


sendEvent ​

const sendEvent: RegisterableGoal

Defined in: goals/attacking.ts:1765

minecraft:behavior.send_event, which the evoker carries. It is summon_entity with events instead of entities, which is how the fangs attack is written.


shareItems ​

const shareItems: RegisterableGoal

Defined in: goals/social.ts:736

minecraft:behavior.share_items, which the villager carries. It is how a farmer hands bread to the villagers who have none.


silverfishMergeWithStone ​

const silverfishMergeWithStone: RegisterableGoal

Defined in: goals/specials.ts:292

minecraft:behavior.silverfish_merge_with_stone, which the silverfish carries. It hides inside a stone block, which is how an infested block is made.


silverfishWakeUpFriends ​

const silverfishWakeUpFriends: RegisterableGoal

Defined in: goals/specials.ts:319

minecraft:behavior.silverfish_wake_up_friends, which the silverfish carries. A hurt silverfish calls every infested block around it.


skeletonHorseTrap ​

const skeletonHorseTrap: RegisterableGoal

Defined in: goals/specials.ts:356

minecraft:behavior.skeleton_horse_trap, which the skeleton horse carries. A player who comes within the radius springs the lightning trap.


sleep ​

const sleep: RegisterableGoal

Defined in: goals/environment.ts:103

minecraft:behavior.sleep, which the villager carries. The entity walks to its bed at night and stays there until morning.


slimeAttack ​

const slimeAttack: RegisterableGoal

Defined in: goals/attacking.ts:1152

minecraft:behavior.slime_attack, which the slime line carries. A slime hurts whatever it lands on, so the goal aims the heading at the target and lets slime_keep_on_jumping do the moving.

It takes look at a better priority than slime_random_direction, which is how a slime that has a target stops wandering and starts closing in.


slimeFloat ​

const slimeFloat: RegisterableGoal

Defined in: goals/movement.ts:419

minecraft:behavior.slime_float, which the slime line carries. A slime steers while it bobs, so the goal takes move as well as jump.


slimeKeepOnJumping ​

const slimeKeepOnJumping: RegisterableGoal

Defined in: goals/specials.ts:219

minecraft:behavior.slime_keep_on_jumping, which the slime line carries. A slime moves only by jumping, so this is its walk.

Each landing is one hop: the goal jumps and sends the slime SLIME_HOP_REACH blocks along the heading import('./slimeHeading').slimeHeadingOf holds. Jumping alone leaves the slime where it stands, which is what it used to do, and a host whose actuator has no vertical impulse made that a slime that never moved at all.


slimeRandomDirection ​

const slimeRandomDirection: RegisterableGoal

Defined in: goals/specials.ts:256

minecraft:behavior.slime_random_direction, which the slime line carries. It picks the heading that slime_keep_on_jumping then jumps along, and holds it for the drawn time so the slime travels rather than jittering.


snacking ​

const snacking: RegisterableGoal

Defined in: goals/environment.ts:543

minecraft:behavior.snacking, which the panda carries. The panda sits down with the bamboo it holds and chews until it loses interest.


sneeze ​

const sneeze: RegisterableGoal

Defined in: goals/environment.ts:768

minecraft:behavior.sneeze, which the baby panda carries. The sneeze scatters the mobs around it and sometimes drops slime.


sniff ​

const sniff: RegisterableGoal

Defined in: goals/environment.ts:615

minecraft:behavior.sniff, which the warden carries. The sniff is what turns a vibration into a suspicion the warden then investigates.


socialGoals ​

const socialGoals: readonly RegisterableGoal[]

Defined in: goals/social.ts:1310

Every goal in the social family.


sonicBoom ​

const sonicBoom: RegisterableGoal

Defined in: goals/attacking.ts:984

minecraft:behavior.sonic_boom, which the warden carries. It charges, then hits the target through walls and throws it back.


specialGoals ​

const specialGoals: readonly RegisterableGoal[]

Defined in: goals/specials.ts:582

Every goal in the single-entity family.


squidDive ​

const squidDive: RegisterableGoal

Defined in: goals/specials.ts:160

minecraft:behavior.squid_dive, the squid's push toward deeper water.


squidFlee ​

const squidFlee: RegisterableGoal

Defined in: goals/specials.ts:163

minecraft:behavior.squid_flee, the squid's burst away from a threat.


squidIdle ​

const squidIdle: RegisterableGoal

Defined in: goals/specials.ts:157

minecraft:behavior.squid_idle, the squid's default slow drift.


squidMoveAwayFromGround ​

const squidMoveAwayFromGround: RegisterableGoal

Defined in: goals/specials.ts:169

minecraft:behavior.squid_move_away_from_ground, which pushes a squid off the sea floor so it does not get stuck there.


squidOutOfWater ​

const squidOutOfWater: RegisterableGoal

Defined in: goals/specials.ts:193

minecraft:behavior.squid_out_of_water, which flops a beached squid. It holds the move flag so nothing tries to path it while it is stranded.


stalkAndPounceOnTarget ​

const stalkAndPounceOnTarget: RegisterableGoal

Defined in: goals/attacking.ts:1304

minecraft:behavior.stalk_and_pounce_on_target, which the fox carries. It creeps into range, waits out interest_time and leaps.


stayNearNoteblock ​

const stayNearNoteblock: RegisterableGoal

Defined in: goals/movement.ts:1957

minecraft:behavior.stay_near_noteblock, which the allay carries. The note block it heard last is its anchor until it hears another.


stayWhileSitting ​

const stayWhileSitting: RegisterableGoal

Defined in: goals/social.ts:497

minecraft:behavior.stay_while_sitting, which four vanilla entities carry. It holds the entity in place for as long as the sit flag is set, and it is the reason a sitting wolf ignores everything else.


stompAttack ​

const stompAttack: RegisterableGoal

Defined in: goals/attacking.ts:1129

minecraft:behavior.stomp_attack, which the ravager carries. It is the melee loop with an area hit rather than a single swing.


stompTurtleEgg ​

const stompTurtleEgg: RegisterableGoal

Defined in: goals/work.ts:945

minecraft:behavior.stomp_turtle_egg, which the six zombie types carry. The entity walks to a turtle egg and breaks it, which is what makes turtles hard to raise near a beach.


strollTowardsVillage ​

const strollTowardsVillage: RegisterableGoal

Defined in: goals/movement.ts:1147

minecraft:behavior.stroll_towards_village, which the cat carries. It is move_to_village with a start chance and a cooldown, so the entity drifts toward the village rather than making straight for it.


summonEntity ​

const summonEntity: RegisterableGoal

Defined in: goals/attacking.ts:1668

minecraft:behavior.summon_entity, which the evoker carries. One choice is one spell, and a spell is a sequence of summon steps.


swell ​

const swell: RegisterableGoal

Defined in: goals/attacking.ts:776

minecraft:behavior.swell, which the creeper carries.

Java's SwellGoal starts inside 3 blocks and reverses outside 7 or when it loses line of sight, which is exactly what the creeper's start_distance of 2.5 and stop_distance of 6 do. The explosion itself belongs to minecraft:explode, so the goal only holds the entity still and tells the world to prime it.


swimIdle ​

const swimIdle: RegisterableGoal

Defined in: goals/movement.ts:366

minecraft:behavior.swim_idle, which the six fish carry. It is the pause between drifts, and it only runs out of water for the fish that beached themselves.


swimUpForBreath ​

const swimUpForBreath: RegisterableGoal

Defined in: goals/movement.ts:1538

minecraft:behavior.swim_up_for_breath, which the dolphin carries. It drives the entity to the surface when its air runs low.


swimWander ​

const swimWander: RegisterableGoal

Defined in: goals/movement.ts:313

minecraft:behavior.swim_wander, which the six fish carry. A fish has no path to follow, so the goal aims it a short way ahead and lets it drift.


swimWithEntity ​

const swimWithEntity: RegisterableGoal

Defined in: goals/movement.ts:1594

minecraft:behavior.swim_with_entity, which the dolphin carries. It is what makes a dolphin escort a swimming player.


swoopAttack ​

const swoopAttack: RegisterableGoal

Defined in: goals/attacking.ts:506

minecraft:behavior.swoop_attack, which the phantom carries. It is a charge that dives from above, so it keeps the look flag while it falls.


takeBlock ​

const takeBlock: RegisterableGoal

Defined in: goals/work.ts:903

minecraft:behavior.take_block, which the enderman carries. It is the other half of place_block, and the docs name the same pair.


takeFlower ​

const takeFlower: RegisterableGoal

Defined in: goals/social.ts:936

minecraft:behavior.take_flower, which the villager carries. It is the other half of offer_flower: the villager walks over and takes it.


targetWhenPushed ​

const targetWhenPushed: RegisterableGoal

Defined in: goals/targeting.ts:432

minecraft:behavior.target_when_pushed, which the polar bear carries.

A push is not damage, so the candidate comes from GoalWorld.lastPusher rather than the damage list.


targetingGoals ​

const targetingGoals: readonly RegisterableGoal[]

Defined in: goals/targeting.ts:496

Every goal in the targeting family.


teleportToOwner ​

const teleportToOwner: RegisterableGoal

Defined in: goals/social.ts:426

minecraft:behavior.teleport_to_owner, which the wolf and the cat carry. It is the teleport on its own, for the cases where following would take too long.


tempt ​

const tempt: RegisterableGoal

Defined in: goals/social.ts:329

minecraft:behavior.tempt, which 31 vanilla entities carry.

Java's TemptGoal stops 2.5 blocks short, and when can_get_scared is set it drops the player who moves more than 0.1 blocks or turns more than 5 degrees inside 6 blocks. The movement and rotation test needs a player view the goal seam does not carry, so can_get_scared is parsed and the scare itself is left to the server.


timerFlag1 ​

const timerFlag1: RegisterableGoal

Defined in: goals/specials.ts:573

minecraft:behavior.timer_flag_1, which four vanilla entities carry.


timerFlag2 ​

const timerFlag2: RegisterableGoal

Defined in: goals/specials.ts:576

minecraft:behavior.timer_flag_2, which the villager carries.


timerFlag3 ​

const timerFlag3: RegisterableGoal

Defined in: goals/specials.ts:579

minecraft:behavior.timer_flag_3, which the villager carries.


tradeInterest ​

const tradeInterest: RegisterableGoal

Defined in: goals/social.ts:1022

minecraft:behavior.trade_interest, which the villager and the wandering trader carry. The entity holds up what it would trade when a player comes close carrying something it wants.


tradeWithPlayer ​

const tradeWithPlayer: RegisterableGoal

Defined in: goals/social.ts:980

minecraft:behavior.trade_with_player, which the three trader entities carry.

Java's TradeWithPlayerGoal holds the entity still while the trade screen is open and drops it when the player gets further than 4 blocks away.


transportItems ​

const transportItems: RegisterableGoal

Defined in: goals/work.ts:581

minecraft:behavior.transport_items, which the copper golem carries. It carries items between the containers it can reach.


useKineticWeapon ​

const useKineticWeapon: RegisterableGoal

Defined in: goals/attacking.ts:1398

minecraft:behavior.use_kinetic_weapon, which the five mounted-lance entities carry. The weapon only hurts while its wielder is moving, so the goal rides in, strikes and backs off to build speed again.

Only while the wielder is riding something, which is what the lance is for and what hijack_mount_navigation is about. The zombie, husk, piglin, zombie pigman and zombie villager all carry it on foot as well as mounted, through minecraft:not_on_zombie_horse, and it claims the move and look flags at a priority above minecraft:behavior.melee_box_attack's. A version that started on nothing more than having a target therefore took those flags off the attack and left every zombie that had chosen a player standing still in front of them.


vanillaGoalNames ​

const vanillaGoalNames: readonly string[]

Defined in: register.ts:38

Every goal name this package registers, sorted.


vanillaGoals ​

const vanillaGoals: readonly RegisterableGoal[]

Defined in: register.ts:26

Every goal this package implements, in family order.


witherRandomAttackPos ​

const witherRandomAttackPos: RegisterableGoal

Defined in: goals/attacking.ts:1826

minecraft:behavior.wither_random_attack_pos_goal, which the wither carries. It keeps the wither drifting around its target instead of standing over it, which is what makes the heads fire from different angles.


witherTargetHighestDamage ​

const witherTargetHighestDamage: RegisterableGoal

Defined in: goals/targeting.ts:465

minecraft:behavior.wither_target_highest_damage, which the wither carries.

It takes whoever has dealt the entity the most damage so far, which is what GoalWorld.damagers totals.


work ​

const work: RegisterableGoal

Defined in: goals/work.ts:331

minecraft:behavior.work, which the villager carries. The site is the job block the villager's profession bound it to, and on_arrival is what restocks its trades.


workComposter ​

const workComposter: RegisterableGoal

Defined in: goals/work.ts:343

minecraft:behavior.work_composter, which the farmer villager carries. It is work with the composter's own site type, because a farmer composts surplus crops rather than trading them.


workGoals ​

const workGoals: readonly RegisterableGoal[]

Defined in: goals/work.ts:987

Every goal in the work and item family.

Functions ​

blockOf() ​

blockOf(position): EntityPosition

Defined in: navigation/view.ts:58

Rounds a position down to the block that contains it.

Parameters ​

position ​

EntityPosition

Returns ​

EntityPosition


bodySchema() ​

bodySchema<P>(read): ComponentSchema<P>

Defined in: params.ts:25

Builds a goal schema from a reader over the body, rejecting anything that is not an object.

Type Parameters ​

P ​

P

Parameters ​

read ​

(body) => P

Returns ​

ComponentSchema<P>


booleanAt() ​

booleanAt(body, key, fallback): boolean

Defined in: params.ts:34

Reads a boolean, falling back when the key is absent.

Parameters ​

body ​

GoalBody

key ​

string

fallback ​

boolean

Returns ​

boolean


canOccupy() ​

canOccupy(view, profile, at): boolean

Defined in: navigation/pathfinder.ts:477

Whether the profile can stand in one cell.

Uses the same entry and support rules as findPath's destination check, without searching for a route to the cell.

Parameters ​

view ​

NavigationView

profile ​

NavigationProfile

at ​

EntityPosition

Returns ​

boolean


centerOf() ​

centerOf(block): EntityPosition

Defined in: navigation/view.ts:65

The center of the block's top face, which is where a path node puts an entity.

Parameters ​

block ​

EntityPosition

Returns ​

EntityPosition


createGoalEntityRegistry() ​

createGoalEntityRegistry(options?): EntityComponentRegistry

Defined in: register.ts:98

Builds the registry an entity runtime needs: these 170 goals first, then every non-goal component @jsprismarine/entities implements.

The order is what makes this package's float, random_stroll and look_at_player win over the reference implementations in the entity runtime, which skip a name that is already registered.

Parameters ​

options? ​

VanillaGoalOptions = {}

Returns ​

EntityComponentRegistry


distanceBetween() ​

distanceBetween(a, b): number

Defined in: navigation/view.ts:72

The straight-line distance between two positions.

Parameters ​

a ​

EntityPosition

b ​

EntityPosition

Returns ​

number


entityTypesAt() ​

entityTypesAt(body, key?): readonly TargetEntityType[]

Defined in: params.ts:173

Reads the entity_types table, which vanilla writes as one entry or as a list.

Parameters ​

body ​

GoalBody

key? ​

string = 'entity_types'

Returns ​

readonly TargetEntityType[]


eventAt() ​

eventAt(body, key): GoalEvent | undefined

Defined in: params.ts:117

Reads an event hook under a key, which is what on_attack and its siblings are.

Parameters ​

body ​

GoalBody

key ​

string

Returns ​

GoalEvent | undefined


eventOf() ​

eventOf(value): GoalEvent | undefined

Defined in: params.ts:108

Reads one {event, target, filters} value, which vanilla also writes as a bare event name.

Parameters ​

value ​

unknown

Returns ​

GoalEvent | undefined


eventsAt() ​

eventsAt(body, key): readonly GoalEvent[]

Defined in: params.ts:120

Reads a list of event hooks, which on_item_throw and on_reach write as arrays.

Parameters ​

body ​

GoalBody

key ​

string

Returns ​

readonly GoalEvent[]


filterAt() ​

filterAt(body, key): Filter | undefined

Defined in: params.ts:137

Reads a filter under a key.

Parameters ​

body ​

GoalBody

key ​

string

Returns ​

Filter | undefined


filterOf() ​

filterOf(value): Filter | undefined

Defined in: params.ts:127

Parses a filter value, or returns undefined when the key is absent or the grammar rejects it.

Parameters ​

value ​

unknown

Returns ​

Filter | undefined


findPath() ​

findPath(view, profile, request): Path | undefined

Defined in: navigation/pathfinder.ts:517

Finds a route from one position to another.

Parameters ​

view ​

NavigationView

profile ​

NavigationProfile

request ​

PathRequest

Returns ​

Path | undefined

The path, or undefined when the goal is out of reach and the request did not ask for a partial one. A request whose start already satisfies the goal radius returns an empty path.


goal() ​

goal<P>(definition): RegisterableGoal

Defined in: goal.ts:46

Wraps a goal implementation so a registry can take it.

Type Parameters ​

P ​

P

Parameters ​

definition ​

GoalDefinition<P>

Returns ​

RegisterableGoal


goalUse() ​

goalUse(name): GoalUse | undefined

Defined in: inventory.ts:59

What the inventory records for one goal name, or undefined when vanilla does not use it.

Parameters ​

name ​

string

Returns ​

GoalUse | undefined


goalsOf() ​

goalsOf(identifier): readonly string[]

Defined in: inventory.ts:62

The goals one vanilla entity declares, in descending use order.

Parameters ​

identifier ​

string

Returns ​

readonly string[]


horizontalDistance() ​

horizontalDistance(a, b): number

Defined in: navigation/view.ts:76

The horizontal distance between two positions, ignoring height.

Parameters ​

a ​

EntityPosition

b ​

EntityPosition

Returns ​

number


isRecord() ​

isRecord(value): value is GoalBody

Defined in: params.ts:20

Whether a value is a plain JSON object.

Parameters ​

value ​

unknown

Returns ​

value is GoalBody


measureCoverage() ​

measureCoverage(implemented): GoalCoverage

Defined in: inventory.ts:83

Measures a set of implemented goal names against the inventory.

An entity that declares no goal counts as covered, which is how the research note counts the 37 vanilla entities with no AI.

Parameters ​

implemented ​

ReadonlySet<string>

Returns ​

GoalCoverage


navigationProfile(entity): NavigationProfile

Defined in: navigation/profile.ts:150

Builds the path finder's rules from the entity's active navigation component.

Parameters ​

entity ​

EntityInstance

Returns ​

NavigationProfile

The profile of the first minecraft:navigation.* the entity has active, or defaultNavigationProfile when it has none.


navigationProfileOf(overrides?): NavigationProfile

Defined in: navigation/profile.ts:230

Builds a profile for a test or a caller that has no entity, over the defaults.

Parameters ​

overrides? ​

Partial<NavigationProfile> = {}

Returns ​

NavigationProfile


numberAt() ​

numberAt(body, key, fallback): number

Defined in: params.ts:30

Reads a number, falling back when the key is absent or not a number.

Parameters ​

body ​

GoalBody

key ​

string

fallback ​

number

Returns ​

number


rangeAt() ​

rangeAt(body, key, fallback): Range

Defined in: params.ts:56

Reads a range.

Vanilla writes one three ways: a bare number standing for both ends, a two-member array, and an object with min and max or range_min and range_max. All three appear among the goal bodies, sometimes under the same key in different files.

Parameters ​

body ​

GoalBody

key ​

string

fallback ​

Range

Returns ​

Range


recordsAt() ​

recordsAt(body, key): readonly GoalBody[]

Defined in: params.ts:91

Reads the members of a list, dropping anything that is not an object.

Parameters ​

body ​

GoalBody

key ​

string

Returns ​

readonly GoalBody[]


registerVanillaGoals() ​

registerVanillaGoals(registry, options?): readonly string[]

Defined in: register.ts:74

Registers all 170 vanilla minecraft:behavior.* goals with an entity component registry.

A name the registry already carries is left alone, which follows what registerEntityComponents does in @jsprismarine/entities. That matters for three names: minecraft:behavior.float, random_stroll and look_at_player ship there as reference implementations, so register these goals before the components to get this package's versions, or use createGoalEntityRegistry, which does it in that order.

Parameters ​

registry ​

EntityComponentRegistry

The registry the entity types resolve against.

options? ​

VanillaGoalOptions = {}

Returns ​

readonly string[]

The names that were already registered and were left alone.

Example ​

typescript
const types = new EntityTypes({ components: createGoalEntityRegistry({ world }) });

seededRandom() ​

seededRandom(seed?): () => number

Defined in: harness.ts:104

A small seeded generator, so a test that needs varied draws still repeats.

It is the 32-bit mulberry32 mixer, which is enough for picking wander targets and rolling chances.

Parameters ​

seed? ​

number = 1

Returns ​

() => number


slimeHeadingOf() ​

slimeHeadingOf(entity): SlimeHeading

Defined in: goals/slimeHeading.ts:57

The heading one slime's goals share, created on the first goal that asks.

Parameters ​

entity ​

EntityInstance

The slime, which is the key the goals of one mob meet on.

Returns ​

SlimeHeading


stringAt() ​

stringAt(body, key): string | undefined

Defined in: params.ts:38

Reads a string, or undefined when the key is absent.

Parameters ​

body ​

GoalBody

key ​

string

Returns ​

string | undefined


stringsAt() ​

stringsAt(body, key): readonly string[]

Defined in: params.ts:77

Reads a list of strings from a key vanilla writes as one name or as a list of names.

Parameters ​

body ​

GoalBody

key ​

string

Returns ​

readonly string[]


supportSource() ​

supportSource(world): SupportSource

Defined in: goal.ts:62

Builds support straight from an entity and a world, which is the default wiring.

Parameters ​

world ​

(entity) => GoalWorld | undefined

Returns ​

SupportSource


targetFamilies() ​

targetFamilies(entries): Set<string> | undefined

Defined in: support.ts:63

Candidate families accepted by at least one target entry, when all are bounded.

Parameters ​

entries ​

readonly TargetEntityType[]

The target entries whose filters define candidate families.

Returns ​

Set<string> | undefined

The family superset, or undefined when a filter cannot be safely narrowed.


testMob() ​

testMob(id, at, options?): GoalMob

Defined in: harness.ts:126

Builds one GoalMob for a test, with only the facts the test needs.

Parameters ​

id ​

string

at ​

EntityPosition

options? ​

TestMobOptions = {}

Returns ​

GoalMob


tickRangeAt() ​

tickRangeAt(body, key, fallbackSeconds): Range

Defined in: params.ts:71

Reads a range written in seconds and returns both ends in server ticks.

Parameters ​

body ​

GoalBody

key ​

string

fallbackSeconds ​

Range

Returns ​

Range


ticksAt() ​

ticksAt(body, key, fallbackSeconds): number

Defined in: params.ts:42

Reads a duration written in seconds and returns it in server ticks.

Parameters ​

body ​

GoalBody

key ​

string

fallbackSeconds ​

number

Returns ​

number


voxelGrid() ​

voxelGrid(layers): NavigationView

Defined in: navigation/voxelGrid.ts:65

Builds a view from layers of text.

Parameters ​

layers ​

readonly (readonly string[])[]

One entry per y from 0 upward; within a layer one string per z from 0 upward, and one character per x from 0 upward.

Returns ​

NavigationView

A view that answers every member, with unwritten positions treated as impassable so a scenario does not need walls around it.

Example ​

typescript
const view = voxelGrid([['###', '###'], ['...', '...']]);