API reference / @jsprismarine/entity-goals
@jsprismarine/entity-goals
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.
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 flagcreateGoalEntityRegistry 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:
| Measure | Result |
|---|---|
| Entity definitions | 129 |
Distinct minecraft:behavior.* names | 170 |
| Names with a registered factory | 170 |
| Entities whose every goal is implemented | 129 of 129 |
| Entities that declare at least one goal | 92 |
| Entities with no goals at all | 37 |
| Most goals on one entity | 27 (minecraft:villager_v2) |
| Goals exactly one entity uses | 91 |
| Goals at most two entities use | 123 |
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.
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 needscan_pass_doors. A closed one needscan_open_doors, and an iron one needscan_open_iron_doorsas well, orcan_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_sunis 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
| File | Goals | What they share |
|---|---|---|
goals/targeting.ts | 9 | Find, hold and release the attack target; no control flags |
goals/attacking.ts | 30 | Read the target and hurt it; move and look |
goals/looking.ts | 6 | Turn the head; look only |
goals/movement.ts | 44 | Wander, swim, fly, flee, follow and walk to a found position |
goals/social.ts | 26 | Breeding, tempting, owners, mounting, trading and gifts |
goals/work.ts | 14 | Jobs, farming, item pickup and placing blocks |
goals/environment.ts | 17 | Sleeping, hiding, sitting and eating a block |
goals/specials.ts | 24 | The 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.
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.swellholds the creeper still and theminecraft:explodecomponent 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.poiand the server decides what counts. - Whether two entities may breed.
minecraft:breedableowns that rule, sobreedandmake_loveaskGoalWorld.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
readonlyadmireSound:string|undefined
Defined in: goals/social.ts:1094
onStart
readonlyonStart:GoalEvent|undefined
Defined in: goals/social.ts:1096
onStop
readonlyonStop:GoalEvent|undefined
Defined in: goals/social.ts:1097
soundInterval
readonlysoundInterval:Range
Defined in: goals/social.ts:1095
AvoidBlockParams
Defined in: goals/movement.ts:641
What minecraft:behavior.avoid_block declares.
Properties
avoidBlockSound
readonlyavoidBlockSound:string|undefined
Defined in: goals/movement.ts:654
onEscape
readonlyonEscape: readonlyGoalEvent[]
Defined in: goals/movement.ts:656
searchHeight
readonlysearchHeight:number
Defined in: goals/movement.ts:647
How far it looks vertically, in blocks.
searchRange
readonlysearchRange:number
Defined in: goals/movement.ts:645
How far it looks for them horizontally, in blocks.
selectionMethod
readonlyselectionMethod:string
Defined in: goals/movement.ts:649
How the entity picks between the blocks it found.
soundInterval
readonlysoundInterval:Range
Defined in: goals/movement.ts:655
sprintSpeedModifier
readonlysprintSpeedModifier:number
Defined in: goals/movement.ts:653
targetBlocks
readonlytargetBlocks: readonlystring[]
Defined in: goals/movement.ts:643
The blocks the entity runs from.
tickInterval
readonlytickInterval:number
Defined in: goals/movement.ts:651
How many ticks between searches.
walkSpeedModifier
readonlywalkSpeedModifier:number
Defined in: goals/movement.ts:652
AvoidMobTypeParams
Defined in: goals/movement.ts:541
What minecraft:behavior.avoid_mob_type declares.
Properties
avoidSound
readonlyavoidSound:string|undefined
Defined in: goals/movement.ts:553
entityTypes
readonlyentityTypes: readonlyTargetEntityType[]
Defined in: goals/movement.ts:542
ignoreVisibility
readonlyignoreVisibility:boolean
Defined in: goals/movement.ts:548
Whether the entity runs from something it cannot see.
maxDistance
readonlymaxDistance:number
Defined in: goals/movement.ts:544
How far the entity notices something to avoid, in blocks.
maxFlee
readonlymaxFlee:number
Defined in: goals/movement.ts:546
How far the entity runs, in blocks.
onEscapeEvent
readonlyonEscapeEvent:GoalEvent|undefined
Defined in: goals/movement.ts:555
probabilityPerStrength
readonlyprobabilityPerStrength:number
Defined in: goals/movement.ts:552
How likely the entity is to flee per point of the threat's strength.
removeTarget
readonlyremoveTarget:boolean
Defined in: goals/movement.ts:550
Whether the entity drops its attack target when it starts fleeing.
soundInterval
readonlysoundInterval: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
readonlyheight:number
Defined in: world.ts:109
How far to look vertically, in blocks.
identifiers?
readonlyoptionalidentifiers?: readonlystring[]
Defined in: world.ts:105
Identifiers to match; an empty or absent list matches every block.
limit?
readonlyoptionallimit?:number
Defined in: world.ts:111
Maximum number of nearest matches to return; omitted returns every match.
range
readonlyrange: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
readonlyspeedMultiplier:number
Defined in: goals/social.ts:65
CelebrateParams
Defined in: goals/specials.ts:411
What minecraft:behavior.celebrate declares.
Properties
celebrationSound
readonlycelebrationSound:string|undefined
Defined in: goals/specials.ts:418
duration
readonlyduration:number
Defined in: goals/specials.ts:413
How long the celebration lasts, in ticks.
jumpInterval
readonlyjumpInterval:Range
Defined in: goals/specials.ts:415
How long between jumps, in ticks.
onCelebrationEnd
readonlyonCelebrationEnd:GoalEvent|undefined
Defined in: goals/specials.ts:419
soundInterval
readonlysoundInterval: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
readonlyduration:number
Defined in: goals/specials.ts:471
How long the celebration lasts, in ticks.
fireworksInterval
readonlyfireworksInterval:Range
Defined in: goals/specials.ts:473
How long between fireworks, in ticks.
onCelebrationEnd
readonlyonCelebrationEnd:GoalEvent|undefined
Defined in: goals/specials.ts:474
ChargeAttackParams
Defined in: goals/attacking.ts:413
What a charge-style attack declares.
Properties
attackReach
readonlyattackReach:number
Defined in: goals/attacking.ts:421
How close the charge has to come to connect, in blocks.
chargeSpeed
readonlychargeSpeed:number
Defined in: goals/attacking.ts:415
How fast the entity charges, as a speed multiplier.
cooldown
readonlycooldown:Range
Defined in: goals/attacking.ts:425
How long between charges, in ticks.
knockbackForce
readonlyknockbackForce:number
Defined in: goals/attacking.ts:423
How hard the hit throws the target.
maxChargeDistance
readonlymaxChargeDistance:number
Defined in: goals/attacking.ts:417
How far the charge reaches, in blocks.
overshootDistance
readonlyovershootDistance: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
readonlyitems: readonlystring[]
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
readonlygoalRadius:number
Defined in: goals/movement.ts:1385
How close to the circle counts as on it, in blocks.
heightAboveTargetRange
readonlyheightAboveTargetRange:Range
Defined in: goals/movement.ts:1387
How high above the anchor the entity flies, in blocks.
heightOffsetRange
readonlyheightOffsetRange: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
readonlyduration:Range
Defined in: goals/environment.ts:570
How long one croak lasts, in ticks.
filters
readonlyfilters:Filter|undefined
Defined in: goals/environment.ts:574
What has to be true for the entity to croak.
interval
readonlyinterval: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
readonlyaggroSound:string|undefined
Defined in: goals/targeting.ts:327
The sound the entity plays when it takes a target.
entityTypes
readonlyentityTypes: readonlyTargetEntityType[]
Defined in: goals/targeting.ts:323
mustSee
readonlymustSee:boolean
Defined in: goals/targeting.ts:325
onDefendStart
readonlyonDefendStart:GoalEvent|undefined
Defined in: goals/targeting.ts:329
The event fired when the goal starts defending.
withinRadius
readonlywithinRadius:number
Defined in: goals/targeting.ts:324
DefendVillageTargetParams
Defined in: goals/targeting.ts:381
What minecraft:behavior.defend_village_target declares.
Properties
entityTypes
readonlyentityTypes: readonlyTargetEntityType[]
Defined in: goals/targeting.ts:382
mustReach
readonlymustReach:boolean
Defined in: goals/targeting.ts:383
DelayedAttackParams
Defined in: goals/attacking.ts:211
What minecraft:behavior.delayed_attack declares.
Extends
Properties
attackDuration
readonlyattackDuration:number
Defined in: goals/attacking.ts:213
How long one swing takes, in ticks.
attackOnce
readonlyattackOnce:boolean
Defined in: goals/attacking.ts:140
Inherited from
canSpreadOnFire
readonlycanSpreadOnFire:boolean
Defined in: goals/attacking.ts:149
Inherited from
MeleeAttackParams.canSpreadOnFire
cooldownTime
readonlycooldownTime:number
Defined in: goals/attacking.ts:144
How long between swings, in ticks.
Inherited from
MeleeAttackParams.cooldownTime
hitDelayPercent
readonlyhitDelayPercent:number
Defined in: goals/attacking.ts:215
How far into the swing the damage lands, in [0, 1].
meleeFov
readonlymeleeFov:number
Defined in: goals/attacking.ts:148
How wide the swing arc is, in degrees.
Inherited from
onAttack
readonlyonAttack:GoalEvent|undefined
Defined in: goals/attacking.ts:150
Inherited from
onKill
readonlyonKill:GoalEvent|undefined
Defined in: goals/attacking.ts:151
Inherited from
randomStopInterval
readonlyrandomStopInterval:number
Defined in: goals/attacking.ts:142
Inherited from
MeleeAttackParams.randomStopInterval
reachMultiplier
readonlyreachMultiplier: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
readonlyrequireCompletePath:boolean
Defined in: goals/attacking.ts:141
Inherited from
MeleeAttackParams.requireCompletePath
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/attacking.ts:138
Inherited from
MeleeAttackParams.speedMultiplier
trackTarget
readonlytrackTarget:boolean
Defined in: goals/attacking.ts:139
Inherited from
DigParams
Defined in: goals/environment.ts:635
What minecraft:behavior.dig declares.
Properties
duration
readonlyduration:number
Defined in: goals/environment.ts:637
How long the dig takes, in ticks.
idleTime
readonlyidleTime:number
Defined in: goals/environment.ts:639
How long the entity stands still first, in ticks.
onStart
readonlyonStart:GoalEvent|undefined
Defined in: goals/environment.ts:644
suspicionIsDisturbance
readonlysuspicionIsDisturbance:boolean
Defined in: goals/environment.ts:641
Whether a suspicion interrupts the dig.
vibrationIsDisturbance
readonlyvibrationIsDisturbance: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
readonlyiron:boolean
Defined in: navigation/view.ts:24
Whether only a mechanism can open it, which is what can_open_iron_doors covers.
open
readonlyopen: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
readonlypotions: readonlyPotionChoice[]
Defined in: goals/attacking.ts:1552
speedModifier
readonlyspeedModifier:number
Defined in: goals/attacking.ts:1553
DropItemForParams
Defined in: goals/social.ts:1137
What minecraft:behavior.drop_item_for declares.
Properties
cooldown
readonlycooldown:number
Defined in: goals/social.ts:1140
How long before the entity gives another present, in ticks.
dropChance
readonlydropChance:number
Defined in: goals/social.ts:1142
The chance of actually dropping something, in [0, 1].
entityTypes
readonlyentityTypes: readonlyTargetEntityType[]
Defined in: goals/social.ts:1138
goalRadius
readonlygoalRadius:number
Defined in: goals/social.ts:1148
How close counts as arriving, in blocks.
lootTable
readonlylootTable:string|undefined
Defined in: goals/social.ts:1144
The table the present is rolled from.
offeringDistance
readonlyofferingDistance:number
Defined in: goals/social.ts:1146
How close the entity drops the present, in blocks.
onDropAttempt
readonlyonDropAttempt:GoalEvent|undefined
Defined in: goals/social.ts:1155
searchHeight
readonlysearchHeight:number
Defined in: goals/social.ts:1150
searchRange
readonlysearchRange:number
Defined in: goals/social.ts:1149
secondsBeforePickup
readonlysecondsBeforePickup:number
Defined in: goals/social.ts:1152
How long before the recipient may pick the present up, in ticks.
timeOfDayRange
readonlytimeOfDayRange: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
readonlyeatBlock:string
Defined in: goals/environment.ts:395
The block the entity eats.
replaceBlock
readonlyreplaceBlock: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
readonlyonEat:GoalEvent|undefined
Defined in: goals/environment.ts:408
pairs
readonlypairs: readonlyEatBlockPair[]
Defined in: goals/environment.ts:403
The blocks the entity eats, each with its replacement.
successChance
readonlysuccessChance:string|undefined
Defined in: goals/environment.ts:407
The Molang expression deciding whether one attempt works.
timeUntilEat
readonlytimeUntilEat: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
readonlyeatAnimationTime:number
Defined in: goals/attacking.ts:1470
How long the swallow animation takes, in ticks.
eatSound
readonlyeatSound:string|undefined
Defined in: goals/attacking.ts:1476
lootTable
readonlylootTable:string|undefined
Defined in: goals/attacking.ts:1478
The loot the swallowed mob leaves behind.
pullInForce
readonlypullInForce:number
Defined in: goals/attacking.ts:1474
How hard the prey is pulled in.
reachMobDistance
readonlyreachMobDistance:number
Defined in: goals/attacking.ts:1472
How close the prey has to come, in blocks.
runSpeed
readonlyrunSpeed:number
Defined in: goals/attacking.ts:1475
EmergeParams
Defined in: goals/specials.ts:383
What minecraft:behavior.emerge declares.
Properties
duration
readonlyduration:number
Defined in: goals/specials.ts:385
How long the emerge animation lasts, in ticks.
onDone
readonlyonDone:GoalEvent|undefined
Defined in: goals/specials.ts:386
ExploreOutskirtsParams
Defined in: goals/movement.ts:1286
What minecraft:behavior.explore_outskirts declares.
Properties
exploreDistance
readonlyexploreDistance:number
Defined in: goals/movement.ts:1289
How far from the village edge the entity wanders, in blocks.
maxWaitTime
readonlymaxWaitTime:number
Defined in: goals/movement.ts:1291
How long it waits at the destination, in ticks.
minDistanceFromTarget
readonlyminDistanceFromTarget:number
Defined in: goals/movement.ts:1293
How far the destination has to be from the entity, in blocks.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/movement.ts:1287
FarmParams
Defined in: goals/work.ts:351
What the farm goals declare.
Properties
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/work.ts:352
FindMountParams
Defined in: goals/social.ts:511
What minecraft:behavior.find_mount declares.
Properties
avoidWater
readonlyavoidWater:boolean
Defined in: goals/social.ts:521
Whether it refuses a mount standing in water.
maxFailedAttempts
readonlymaxFailedAttempts:number
Defined in: goals/social.ts:517
How many failures it takes before it gives up.
mountDistance
readonlymountDistance:number
Defined in: goals/social.ts:519
How close it has to be to climb on, in blocks.
startDelay
readonlystartDelay:number
Defined in: goals/social.ts:515
How long it waits before the first attempt, in ticks.
targetNeeded
readonlytargetNeeded:boolean
Defined in: goals/social.ts:523
Whether it only looks for a mount while it has a target.
withinRadius
readonlywithinRadius: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
readonlyattackCooldown:number
Defined in: goals/attacking.ts:351
How long between shots, in ticks.
attackRange
readonlyattackRange:Range
Defined in: goals/attacking.ts:353
How far the target may be for the goal to fire, in blocks.
postShootDelay
readonlypostShootDelay:number
Defined in: goals/attacking.ts:359
How long the entity holds the pose after the shot, in ticks.
preShootDelay
readonlypreShootDelay:number
Defined in: goals/attacking.ts:357
How long the entity aims before the shot, in ticks.
projectile
readonlyprojectile:string|undefined
Defined in: goals/attacking.ts:355
The projectile entity to create.
rangedFov
readonlyrangedFov: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
readonlyfloatDuration:Range
Defined in: goals/movement.ts:234
How long one drift lasts, in ticks.
hasMoveControl
readonlyhasMoveControl:boolean
Defined in: goals/movement.ts:238
Whether the goal steers the entity itself rather than through the move control.
interval
readonlyinterval:number
Defined in: goals/movement.ts:113
One tick in this many starts a walk.
Inherited from
mustReach
readonlymustReach:boolean
Defined in: goals/movement.ts:240
Whether the destination has to be reachable.
randomReselect
readonlyrandomReselect:boolean
Defined in: goals/movement.ts:236
Whether a new destination is drawn before the old one is reached.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/movement.ts:107
Inherited from
useHomePositionRestriction
readonlyuseHomePositionRestriction:boolean
Defined in: goals/movement.ts:242
Whether the drift stays inside the entity's home radius.
xzDistance
readonlyxzDistance:number
Defined in: goals/movement.ts:109
How far the destination may be horizontally, in blocks.
Inherited from
yDistance
readonlyyDistance:number
Defined in: goals/movement.ts:111
How far it may be vertically, in blocks.
Inherited from
yOffset
readonlyyOffset: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
readonlycanTeleport:boolean
Defined in: goals/social.ts:358
Whether the entity teleports when it cannot walk to the owner.
ignoreVibration
readonlyignoreVibration:boolean
Defined in: goals/social.ts:362
Whether the entity follows an owner who is sneaking away.
postTeleportDistance
readonlypostTeleportDistance:number
Defined in: goals/social.ts:360
How far from the owner a teleport lands, in blocks; -1 uses the stop distance.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/social.ts:352
startDistance
readonlystartDistance:number
Defined in: goals/social.ts:354
How far away the owner has to be before the entity sets off, in blocks.
stopDistance
readonlystopDistance: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
readonlyfilters:Filter|undefined
Defined in: goals/movement.ts:1656
Which entities are worth following.
preferredActorType
readonlypreferredActorType:string|undefined
Defined in: goals/movement.ts:1658
A type name that beats the filters when both match.
searchRange
readonlysearchRange:number
Defined in: goals/movement.ts:1650
How far the goal looks for whom to follow, in blocks.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/movement.ts:1648
startDistance
readonlystartDistance:number
Defined in: goals/movement.ts:1654
How far away the entity has to be before it starts following, in blocks.
stopDistance
readonlystopDistance: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
readonlyonItemThrow: readonlyGoalEvent[]
Defined in: goals/social.ts:1227
runSpeed
readonlyrunSpeed:number
Defined in: goals/social.ts:1225
throwSound
readonlythrowSound:string|undefined
Defined in: goals/social.ts:1226
GoalBlock
Defined in: world.ts:96
One block a block search found.
Properties
identifier
readonlyidentifier:string
Defined in: world.ts:99
The block identifier, such as minecraft:farmland.
position
readonlyposition: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
readonlyentities:number
Defined in: inventory.ts:70
How many entities have every goal they declare in the set.
entitiesWithGoals
readonlyentitiesWithGoals:number
Defined in: inventory.ts:72
How many of those entities declare at least one goal.
goals
readonlygoals:number
Defined in: inventory.ts:68
How many of the inventory's goals the set covers.
missing
readonlymissing: readonlystring[]
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
readonlycause:string
Defined in: world.ts:119
The damage cause, such as entity_attack.
mob
readonlymob:GoalMob|undefined
Defined in: world.ts:117
Who dealt it, or undefined when the source was not an entity.
total
readonlytotal: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
readonlycontrolFlags: readonly ("move"|"look"|"jump")[]
Defined in: goal.ts:25
The control flags the goal holds when the definition names none.
name
readonlyname:string
Defined in: goal.ts:23
The component name, such as minecraft:behavior.random_stroll.
schema
readonlyschema: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
Returns
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
readonlyevent:string
Defined in: params.ts:100
The event name to fire.
filters?
readonlyoptionalfilters?:Filter
Defined in: params.ts:104
The filters that gate it, when the body carries any.
target
readonlytarget: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?
readonlyoptionalat?:EntityPosition
Defined in: harness.ts:154
Where the entity starts.
components?
readonlyoptionalcomponents?:Readonly<Record<string,unknown>>
Defined in: harness.ts:146
Any other components, such as minecraft:navigation.walk or minecraft:collision_box.
flags?
readonlyoptionalflags?: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
readonlygoals:Readonly<Record<string,unknown>>
Defined in: harness.ts:144
The minecraft:behavior.* components to put on the entity, with their bodies.
headEquipped?
readonlyoptionalheadEquipped?:boolean
Defined in: harness.ts:158
Whether the entity has a test helmet in its head slot.
identifier?
readonlyoptionalidentifier?:string
Defined in: harness.ts:161
random?
readonlyoptionalrandom?: () =>number
Defined in: harness.ts:150
Draws the goals' random numbers; defaults to a seeded generator, so a run repeats.
Returns
number
randomInt?
readonlyoptionalrandomInt?: (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?
readonlyoptionalworld?:GoalWorld
Defined in: harness.ts:148
The world seam; every member the test leaves out answers nothing.
worldFacts?
readonlyoptionalworldFacts?: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
readonlyentities: readonlystring[]
Defined in: inventory.ts:45
Every entity identifier in the pack, sorted, including the ones with no goals.
entityCount
readonlyentityCount:number
Defined in: inventory.ts:42
goalCount
readonlygoalCount:number
Defined in: inventory.ts:43
goals
readonlygoals: readonlyGoalUse[]
Defined in: inventory.ts:47
Every goal, most used first, ties broken by name.
source
readonlysource: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?
readonlyoptionalfilterView?:FilterItemView
Defined in: world.ts:62
Item tags, auxiliary data, and components for shareable item rules.
id
readonlyid: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
GoalItemCraft
Defined in: world.ts:80
One recipe-backed conversion prepared for an entity to share.
Properties
craftedCount
readonlycraftedCount:number
Defined in: world.ts:90
The total number of output items the recipe produces.
inputCount
readonlyinputCount:number
Defined in: world.ts:86
The number of input items this transfer consumes.
inputIdentifier
readonlyinputIdentifier:string
Defined in: world.ts:84
The item identifier consumed by the recipe.
outputCount
readonlyoutputCount:number
Defined in: world.ts:92
The number of output items this transfer gives away.
outputIdentifier
readonlyoutputIdentifier:string
Defined in: world.ts:88
The item identifier the recipe produces.
recipeId
readonlyrecipeId: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
readonlyid:string|number
Defined in: world.ts:28
A stable identity, so a goal can tell two candidates apart between ticks.
Methods
health()?
optionalhealth():number|undefined
Defined in: world.ts:46
Its current health, for the attack goals that stop at a threshold.
Returns
number | undefined
heldItem()?
optionalheldItem():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()?
optionalidentifier():string|undefined
Defined in: world.ts:36
Its entity type, such as minecraft:villager_v2.
Returns
string | undefined
inventory()?
optionalinventory(): readonlystring[]
Defined in: world.ts:40
Its inventory, when the world can read it, for data-driven item sharing.
Returns
readonly string[]
lastDamager()?
optionallastDamager():GoalMob|undefined
Defined in: world.ts:50
Who last damaged it, which is what owner_hurt_by_target reads.
Returns
GoalMob | undefined
lookPosition()?
optionallookPosition():EntityPosition
Defined in: world.ts:32
Where its eyes are, when the world can provide that detail.
Returns
position()
position():
EntityPosition
Defined in: world.ts:30
Where it is now.
Returns
shareables()?
optionalshareables():ShareablesParams|undefined
Defined in: world.ts:44
Its active item-sharing rules, when it has minecraft:shareables.
Returns
ShareablesParams | undefined
shareInventory()?
optionalshareInventory(): readonlystring[]
Defined in: world.ts:42
Its inventory slots and flat items together, for minecraft:behavior.share_items.
Returns
readonly string[]
target()?
optionaltarget():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
GoalParameterUse
Defined in: inventory.ts:13
One parameter key vanilla writes under a goal, with how often and as what.
Properties
instances
readonlyinstances:number
Defined in: inventory.ts:17
How many component instances set the key.
key
readonlykey:string
Defined in: inventory.ts:15
The key as the entity files spell it, such as speed_multiplier.
types
readonlytypes: readonlystring[]
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
readonlyadmire:boolean
Defined in: world.ts:70
Whether a piglin should admire the item after taking it.
barter
readonlybarter:boolean
Defined in: world.ts:72
Whether a piglin should barter for the item after taking it.
canPickupToHandOrEquipment
readonlycanPickupToHandOrEquipment:boolean
Defined in: world.ts:68
Whether the item may go to an empty hand or armor slot.
consumeItem
readonlyconsumeItem:boolean
Defined in: world.ts:74
Whether the item should become the carried item for eat_carried_item.
storedInInventory
readonlystoredInInventory: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
readonlyentities:number
Defined in: inventory.ts:27
How many of the 129 entity files declare it anywhere.
inBaseComponents
readonlyinBaseComponents:number
Defined in: inventory.ts:30
inComponentGroups
readonlyinComponentGroups:number
Defined in: inventory.ts:31
instances
readonlyinstances:number
Defined in: inventory.ts:29
How many times it appears, counting each component group separately.
name
readonlyname:string
Defined in: inventory.ts:25
The component name, such as minecraft:behavior.random_stroll.
parameters
readonlyparameters: readonlyGoalParameterUse[]
Defined in: inventory.ts:33
The union of parameter keys observed, most used first.
usedBy
readonlyusedBy: readonlystring[]
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()?
optionalattack(mob):void
Defined in: world.ts:176
Deals the entity's melee damage to the mob.
Parameters
mob
Returns
void
blocks()?
optionalblocks(query): readonlyGoalBlock[]
Defined in: world.ts:147
Blocks matching the query, nearest first, up to its optional limit.
Parameters
query
Returns
readonly GoalBlock[]
breakBlock()?
optionalbreakBlock(position):void
Defined in: world.ts:221
Breaks a block, for the eat, harvest and dig goals.
Parameters
position
Returns
void
breedWith()?
optionalbreedWith(mob):void
Defined in: world.ts:245
Produces the offspring of a successful breeding.
Parameters
mob
Returns
void
canBreedWith()?
optionalcanBreedWith(mob):boolean
Defined in: world.ts:241
Whether the entity can breed with the mob now.
Parameters
mob
Returns
boolean
canSee()?
optionalcanSee(mob):boolean
Defined in: world.ts:149
Whether the entity has line of sight to the mob, for must_see.
Parameters
mob
Returns
boolean
carriedItem()?
optionalcarriedItem():string|undefined
Defined in: world.ts:209
What the entity holds in its main hand.
Returns
string | undefined
craftInto()?
optionalcraftInto(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()?
optionaldamagers(): readonlyGoalDamage[]
Defined in: world.ts:157
Who has damaged the entity, oldest first, with the running total each has dealt.
Returns
readonly GoalDamage[]
dismount()?
optionaldismount():void
Defined in: world.ts:190
Takes the entity off whatever it rides.
Returns
void
dropItem()?
optionaldropItem(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()?
optionaldropLoot(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
Returns
void
explode()?
optionalexplode():void
Defined in: world.ts:237
Detonates the entity, for minecraft:behavior.swell.
Returns
void
giveCraftedItem()?
optionalgiveCraftedItem(mob,craft):void
Defined in: world.ts:207
Consumes a prepared recipe's inputs and gives its output to another entity.
Parameters
mob
craft
Returns
void
giveItem()?
optionalgiveItem(mob,identifier,count?):void
Defined in: world.ts:196
Hands items to another entity, for the sharing and gift goals.
Parameters
mob
identifier
string
count?
number
Returns
void
home()?
optionalhome():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()?
optionalinventory(): readonlystring[]
Defined in: world.ts:215
The entity's inventory contents, for the item and trade goals.
Returns
readonly string[]
isAttackable()?
optionalisAttackable(mob):boolean
Defined in: world.ts:151
Whether Java's combat target rules allow this mob to be selected or retained.
Parameters
mob
Returns
boolean
isBrightOutside()?
optionalisBrightOutside():boolean
Defined in: world.ts:134
Whether Java's level considers it bright outside.
Returns
boolean
isReadyToBreed()?
optionalisReadyToBreed():boolean
Defined in: world.ts:243
Whether this entity's active breeding data lets it look for a mate now.
Returns
boolean
itemCount()?
optionalitemCount(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()?
optionalitemHasTag(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()?
optionalitems(radius): readonlyGoalItem[]
Defined in: world.ts:145
Every item stack lying within the radius, nearest first.
Parameters
radius
number
Returns
readonly GoalItem[]
knockback()?
optionalknockback(mob,horizontal,vertical):void
Defined in: world.ts:180
Knocks the mob away from the entity.
Parameters
mob
horizontal
number
vertical
number
Returns
void
lastPusher()?
optionallastPusher():GoalMob|undefined
Defined in: world.ts:159
Who last pushed the entity, for minecraft:behavior.target_when_pushed.
Returns
GoalMob | undefined
mobs()?
optionalmobs(radius,families?): readonlyGoalMob[]
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()?
optionalmount(mob):void
Defined in: world.ts:188
Puts the entity on the mob as a rider.
Parameters
mob
Returns
void
navigation()?
optionalnavigation():NavigationView|undefined
Defined in: world.ts:132
The blocks around the entity, which is what the path finder reads.
Returns
NavigationView | undefined
openTrade()?
optionalopenTrade(player):void
Defined in: world.ts:227
Opens the trade screen with a player.
Parameters
player
Returns
void
owner()?
optionalowner():GoalMob|undefined
Defined in: world.ts:161
The entity's owner, for the tamed-pet goals.
Returns
GoalMob | undefined
pickUp()?
optionalpickUp(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
count?
number
options?
Returns
void
players()?
optionalplayers(radius): readonlyGoalMob[]
Defined in: world.ts:143
Every player within the radius, nearest first.
Parameters
radius
number
Returns
readonly GoalMob[]
playSound()?
optionalplaySound(name):void
Defined in: world.ts:225
Plays one of the entity's sound events.
Parameters
name
string
Returns
void
poi()?
optionalpoi(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()?
optionalpush(velocity):void
Defined in: world.ts:182
Adds to the entity's own velocity, for the leap, charge and ram goals.
Parameters
velocity
Returns
void
removeSelf()?
optionalremoveSelf():void
Defined in: world.ts:186
Removes the entity, for the timed end of the dragon death animation.
Returns
void
report()?
optionalreport(message):void
Defined in: world.ts:247
Records what the goal met and could not carry out.
Parameters
message
string
Returns
void
riders()?
optionalriders(): readonlyGoalMob[]
Defined in: world.ts:165
Who rides the entity.
Returns
readonly GoalMob[]
setBlock()?
optionalsetBlock(position,identifier):void
Defined in: world.ts:219
Replaces a block, for the place, plant, compost and egg goals.
Parameters
position
identifier
string
Returns
void
setCarriedItem()?
optionalsetCarriedItem(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()?
optionalsetHome(position):void
Defined in: world.ts:169
Records a home position.
Parameters
position
EntityPosition | undefined
Returns
void
setSitting()?
optionalsetSitting(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()?
optionalsetSleeping(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()?
optionalsetTarget(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()?
optionalshareInventory(): readonlystring[]
Defined in: world.ts:217
The entity's inventory slots and flat items, for minecraft:behavior.share_items.
Returns
readonly string[]
shoot()?
optionalshoot(mob,projectile):void
Defined in: world.ts:178
Fires the entity's projectile at the mob.
Parameters
mob
projectile
string | undefined
Returns
void
spawn()?
optionalspawn(identifier,position,event):void
Defined in: world.ts:223
Creates another entity, for the summon and lay goals.
Parameters
identifier
string
position
event
string | undefined
Returns
void
target()?
optionaltarget():GoalMob|undefined
Defined in: world.ts:153
The entity's current attack target.
Returns
GoalMob | undefined
teleportTo()?
optionalteleportTo(position):void
Defined in: world.ts:184
Moves the entity at once, for the teleport goals.
Parameters
position
Returns
void
tradingPlayer()?
optionaltradingPlayer():GoalMob|undefined
Defined in: world.ts:229
Whether a player is trading with the entity now.
Returns
GoalMob | undefined
trigger()?
optionaltrigger(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()?
optionalvehicle():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
readonlyduration:number
Defined in: goals/environment.ts:219
How long the entity stays hidden, in ticks.
poiType
readonlypoiType:string|undefined
Defined in: goals/environment.ts:221
The point of interest type that counts as cover.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/environment.ts:217
HoldGroundParams
Defined in: goals/attacking.ts:811
What minecraft:behavior.hold_ground declares.
Properties
broadcast
readonlybroadcast:boolean
Defined in: goals/attacking.ts:813
Whether nearby friends are told to hold too.
broadcastRange
readonlybroadcastRange:number
Defined in: goals/attacking.ts:815
How far the broadcast reaches, in blocks.
minRadius
readonlyminRadius:number
Defined in: goals/attacking.ts:817
How close the target has to be before the entity gives up holding, in blocks.
withinRadiusEvent
readonlywithinRadiusEvent: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
readonlyalertSameType:number
Defined in: goals/targeting.ts:220
How far the goal tells nearby friends of the same type, in blocks.
entityTypes
readonlyentityTypes: readonlyTargetEntityType[]
Defined in: goals/targeting.ts:216
Which damagers the goal retaliates against; an empty table accepts every one.
hurtOwner
readonlyhurtOwner: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
readonlygoalRadius:number
Defined in: goals/work.ts:501
searchCount
readonlysearchCount:number
Defined in: goals/work.ts:500
searchHeight
readonlysearchHeight:number
Defined in: goals/work.ts:499
searchRange
readonlysearchRange:number
Defined in: goals/work.ts:498
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/work.ts:497
JumpAroundTargetParams
Defined in: goals/attacking.ts:571
What minecraft:behavior.jump_around_target declares.
Properties
cooldown
readonlycooldown:number
Defined in: goals/attacking.ts:573
How long between jumps, in ticks.
hurtCooldown
readonlyhurtCooldown:number
Defined in: goals/attacking.ts:575
How long between jumps after being hurt, in ticks.
landingDistance
readonlylandingDistance:Range
Defined in: goals/attacking.ts:581
How far from the target the entity lands, in blocks.
maxJumpVelocity
readonlymaxJumpVelocity:number
Defined in: goals/attacking.ts:579
How fast the jump throws the entity.
prepareDuration
readonlyprepareDuration:number
Defined in: goals/attacking.ts:577
How long the entity crouches before the jump, in ticks.
validDistance
readonlyvalidDistance: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
readonlycooldown:Range
Defined in: goals/movement.ts:1440
How long between jumps, in ticks.
forbiddenBlocks
readonlyforbiddenBlocks: readonlystring[]
Defined in: goals/movement.ts:1452
Blocks the entity refuses to land on.
maxVelocity
readonlymaxVelocity:number
Defined in: goals/movement.ts:1450
minimumDistance
readonlyminimumDistance:number
Defined in: goals/movement.ts:1442
How far the destination has to be, in blocks.
minimumPathLength
readonlyminimumPathLength:number
Defined in: goals/movement.ts:1444
How long a walking path would have to be before jumping is worth it.
preferredBlocks
readonlypreferredBlocks: readonlystring[]
Defined in: goals/movement.ts:1454
Blocks the entity prefers to land on.
preferredBlocksChance
readonlypreferredBlocksChance:number
Defined in: goals/movement.ts:1456
The chance of taking a preferred block over any other, in [0, 1].
scaleFactor
readonlyscaleFactor:number
Defined in: goals/movement.ts:1449
How the jump velocity scales with the distance.
searchHeight
readonlysearchHeight:number
Defined in: goals/movement.ts:1447
searchWidth
readonlysearchWidth: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
readonlyattackTime:number
Defined in: goals/attacking.ts:902
How far into the roar the knockback lands, in ticks.
cooldown
readonlycooldown:number
Defined in: goals/attacking.ts:904
How long before the roar can run again, in ticks.
damage
readonlydamage:number
Defined in: goals/attacking.ts:908
How much damage the roar deals.
duration
readonlyduration:number
Defined in: goals/attacking.ts:900
How long the whole roar lasts, in ticks.
horizontalStrength
readonlyhorizontalStrength:number
Defined in: goals/attacking.ts:909
onRoarEnd
readonlyonRoarEnd:GoalEvent|undefined
Defined in: goals/attacking.ts:911
range
readonlyrange:number
Defined in: goals/attacking.ts:906
How far the knockback reaches, in blocks.
verticalStrength
readonlyverticalStrength:number
Defined in: goals/attacking.ts:910
LayDownParams
Defined in: goals/environment.ts:264
What minecraft:behavior.lay_down declares.
Properties
interval
readonlyinterval:number
Defined in: goals/environment.ts:266
One tick in this many lies down.
randomStopInterval
readonlyrandomStopInterval: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
readonlyallowLayingFromBelow:boolean
Defined in: goals/work.ts:767
Whether the entity may lay while standing under the nest.
eggType
readonlyeggType:string|undefined
Defined in: goals/work.ts:764
The egg block or entity to leave behind.
goalRadius
readonlygoalRadius:number
Defined in: goals/work.ts:760
laySeconds
readonlylaySeconds:number
Defined in: goals/work.ts:762
How long the laying takes, in ticks.
laySound
readonlylaySound:string|undefined
Defined in: goals/work.ts:765
onLay
readonlyonLay:GoalEvent|undefined
Defined in: goals/work.ts:769
searchHeight
readonlysearchHeight:number
Defined in: goals/work.ts:759
searchRange
readonlysearchRange:number
Defined in: goals/work.ts:758
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/work.ts:753
targetBlocks
readonlytargetBlocks: readonlystring[]
Defined in: goals/work.ts:755
The blocks the entity lays on.
targetMaterialsAboveBlock
readonlytargetMaterialsAboveBlock: readonlystring[]
Defined in: goals/work.ts:757
The blocks that may sit above the nest.
useDefaultAnimation
readonlyuseDefaultAnimation:boolean
Defined in: goals/work.ts:768
LeapAtTargetParams
Defined in: goals/attacking.ts:514
What minecraft:behavior.leap_at_target declares.
Properties
mustBeOnGround
readonlymustBeOnGround:boolean
Defined in: goals/attacking.ts:519
targetDistance
readonlytargetDistance:number
Defined in: goals/attacking.ts:518
How close the target may be for the leap to start, in blocks.
yd
readonlyyd: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
readonlyangleOfViewHorizontal:number
Defined in: goals/looking.ts:72
How wide the entity's horizontal field of view is, in degrees.
Inherited from
LookAtParams.angleOfViewHorizontal
angleOfViewVertical
readonlyangleOfViewVertical:number
Defined in: goals/looking.ts:74
How wide its vertical field of view is, in degrees.
Inherited from
LookAtParams.angleOfViewVertical
filters
readonlyfilters:Filter|undefined
Defined in: goals/looking.ts:107
Which entities are worth looking at.
lookDistance
readonlylookDistance:number
Defined in: goals/looking.ts:66
How far the entity notices something to look at, in blocks.
Inherited from
lookTime
readonlylookTime:Range
Defined in: goals/looking.ts:70
How long one look lasts, in ticks.
Inherited from
probability
readonlyprobability:number
Defined in: goals/looking.ts:68
The chance per tick of starting a look, in [0, 1].
Inherited from
LookAtParams
Defined in: goals/looking.ts:64
What the look goals declare.
Extended by
Properties
angleOfViewHorizontal
readonlyangleOfViewHorizontal:number
Defined in: goals/looking.ts:72
How wide the entity's horizontal field of view is, in degrees.
angleOfViewVertical
readonlyangleOfViewVertical:number
Defined in: goals/looking.ts:74
How wide its vertical field of view is, in degrees.
lookDistance
readonlylookDistance:number
Defined in: goals/looking.ts:66
How far the entity notices something to look at, in blocks.
lookTime
readonlylookTime:Range
Defined in: goals/looking.ts:70
How long one look lasts, in ticks.
probability
readonlyprobability: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
readonlyattackOnce:boolean
Defined in: goals/attacking.ts:140
canSpreadOnFire
readonlycanSpreadOnFire:boolean
Defined in: goals/attacking.ts:149
cooldownTime
readonlycooldownTime:number
Defined in: goals/attacking.ts:144
How long between swings, in ticks.
meleeFov
readonlymeleeFov:number
Defined in: goals/attacking.ts:148
How wide the swing arc is, in degrees.
onAttack
readonlyonAttack:GoalEvent|undefined
Defined in: goals/attacking.ts:150
onKill
readonlyonKill:GoalEvent|undefined
Defined in: goals/attacking.ts:151
randomStopInterval
readonlyrandomStopInterval:number
Defined in: goals/attacking.ts:142
reachMultiplier
readonlyreachMultiplier:number
Defined in: goals/attacking.ts:146
How far a swing reaches, as a multiple of the entity's width.
requireCompletePath
readonlyrequireCompletePath:boolean
Defined in: goals/attacking.ts:141
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/attacking.ts:138
trackTarget
readonlytrackTarget:boolean
Defined in: goals/attacking.ts:139
MingleParams
Defined in: goals/social.ts:659
What minecraft:behavior.mingle declares.
Properties
cooldown
readonlycooldown:number
Defined in: goals/social.ts:664
How long before the entity mingles again, in ticks.
duration
readonlyduration:number
Defined in: goals/social.ts:662
How long one conversation lasts, in ticks.
mingleDistance
readonlymingleDistance:number
Defined in: goals/social.ts:666
How close two entities stand while mingling, in blocks.
partnerType
readonlypartnerType:string|undefined
Defined in: goals/social.ts:668
Which entity type counts as someone to mingle with.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/social.ts:660
MoveAroundTargetParams
Defined in: goals/attacking.ts:651
What minecraft:behavior.move_around_target declares.
Properties
destinationRange
readonlydestinationRange:Range
Defined in: goals/attacking.ts:653
How far from the target the entity repositions, in blocks.
heightDifferenceLimit
readonlyheightDifferenceLimit:number
Defined in: goals/attacking.ts:657
The most height difference a destination may have, in blocks.
movementSpeed
readonlymovementSpeed:number
Defined in: goals/attacking.ts:658
spreadDegrees
readonlyspreadDegrees: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
readonlygoalRadius:number
Defined in: goals/movement.ts:827
How close counts as arriving, in blocks.
onReach
readonlyonReach: readonlyGoalEvent[]
Defined in: goals/movement.ts:836
onStayCompleted
readonlyonStayCompleted: readonlyGoalEvent[]
Defined in: goals/movement.ts:837
searchCount
readonlysearchCount:number
Defined in: goals/movement.ts:825
How many candidates it considers.
searchHeight
readonlysearchHeight:number
Defined in: goals/movement.ts:823
How far it looks vertically, in blocks.
searchRange
readonlysearchRange:number
Defined in: goals/movement.ts:821
How far it looks horizontally, in blocks.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/movement.ts:817
startChance
readonlystartChance:number
Defined in: goals/movement.ts:831
The chance per attempt that the goal runs at all, in [0, 1].
stayDuration
readonlystayDuration:number
Defined in: goals/movement.ts:833
How long the entity waits at the block, in ticks.
targetBlocks
readonlytargetBlocks: readonlystring[]
Defined in: goals/movement.ts:819
The blocks the goal walks to.
targetOffset
readonlytargetOffset:EntityPosition
Defined in: goals/movement.ts:835
How far from the found block the entity actually stands.
tickInterval
readonlytickInterval: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
readonlyspeedMultiplier:number
Defined in: goals/attacking.ts:712
withinRadius
readonlywithinRadius: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
readonlycanNapFilters:Filter|undefined
Defined in: goals/environment.ts:159
What has to be true for the entity to nap at all.
cooldown
readonlycooldown:Range
Defined in: goals/environment.ts:153
How long before the entity naps again, in ticks.
mobDetectDistance
readonlymobDetectDistance:number
Defined in: goals/environment.ts:155
How far a mob has to be for the entity to feel safe, in blocks.
mobDetectHeight
readonlymobDetectHeight:number
Defined in: goals/environment.ts:157
How far above and below it looks, in blocks.
wakeMobExceptions
readonlywakeMobExceptions:Filter|undefined
Defined in: goals/environment.ts:161
Mobs whose presence does not wake the entity.
NavigationProfile
Defined in: navigation/profile.ts:21
How an entity is allowed to move, and what it refuses to path through.
Properties
avoidDamageBlocks
readonlyavoidDamageBlocks:boolean
Defined in: navigation/profile.ts:51
avoidPortals
readonlyavoidPortals:boolean
Defined in: navigation/profile.ts:50
avoidSun
readonlyavoidSun:boolean
Defined in: navigation/profile.ts:49
avoidWater
readonlyavoidWater:boolean
Defined in: navigation/profile.ts:48
blocksToAvoid
readonlyblocksToAvoid: readonlystring[]
Defined in: navigation/profile.ts:56
Block identifiers the path refuses to enter, from blocks_to_avoid.
canBreach
readonlycanBreach:boolean
Defined in: navigation/profile.ts:42
canBreakDoors
readonlycanBreakDoors:boolean
Defined in: navigation/profile.ts:47
canClimbLadders?
readonlyoptionalcanClimbLadders?:boolean
Defined in: navigation/profile.ts:38
Whether minecraft:can_climb lets the entity climb ladder blocks.
canFloat
readonlycanFloat:boolean
Defined in: navigation/profile.ts:32
canFly
readonlycanFly:boolean
Defined in: navigation/profile.ts:41
canJump
readonlycanJump:boolean
Defined in: navigation/profile.ts:43
canOpenDoors
readonlycanOpenDoors:boolean
Defined in: navigation/profile.ts:44
canOpenIronDoors
readonlycanOpenIronDoors:boolean
Defined in: navigation/profile.ts:45
canPassDoors
readonlycanPassDoors:boolean
Defined in: navigation/profile.ts:46
canPathFromAir
readonlycanPathFromAir:boolean
Defined in: navigation/profile.ts:31
canPathOverLava
readonlycanPathOverLava:boolean
Defined in: navigation/profile.ts:30
canPathOverWater
readonlycanPathOverWater:boolean
Defined in: navigation/profile.ts:29
canSink
readonlycanSink:boolean
Defined in: navigation/profile.ts:33
canStandOnPowderSnow?
readonlyoptionalcanStandOnPowderSnow?:boolean
Defined in: navigation/profile.ts:40
Whether minecraft:can_stand_on_powder_snow lets the entity use powder snow as support.
canSwim
readonlycanSwim:boolean
Defined in: navigation/profile.ts:34
canWalk
readonlycanWalk:boolean
Defined in: navigation/profile.ts:35
canWalkInLava
readonlycanWalkInLava:boolean
Defined in: navigation/profile.ts:36
height
readonlyheight:number
Defined in: navigation/profile.ts:24
How many whole blocks of headroom the entity needs, at least 1.
isAmphibious
readonlyisAmphibious:boolean
Defined in: navigation/profile.ts:52
kind
readonlykind:"float"|"swim"|"fly"|"hover"|"walk"|"generic"|"climb"
Defined in: navigation/profile.ts:22
maxFallDistance
readonlymaxFallDistance:number
Defined in: navigation/profile.ts:28
How far the entity drops in one step, in blocks.
pathfindingMalus?
readonlyoptionalpathfindingMalus?:Readonly<Record<string,number>>
Defined in: navigation/profile.ts:54
Java's path-type costs, keyed by PathType; negative values are blocked.
stepHeight
readonlystepHeight:number
Defined in: navigation/profile.ts:26
How high the entity climbs without jumping, in blocks.
NavigationView
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
Returns
string | undefined
canSeeSky()?
optionalcanSeeSky(position):boolean
Defined in: navigation/view.ts:46
Whether Java's level says the block column can see the sky.
Parameters
position
Returns
boolean
doorAt()?
optionaldoorAt(position):DoorState|undefined
Defined in: navigation/view.ts:40
The door at the block, or undefined when it is not a door.
Parameters
position
Returns
DoorState | undefined
isClimbable()?
optionalisClimbable(position):boolean
Defined in: navigation/view.ts:52
Whether an entity climbs the block, such as a ladder or a vine.
Parameters
position
Returns
boolean
isDamaging()?
optionalisDamaging(position):boolean
Defined in: navigation/view.ts:42
Whether standing in the block hurts, for avoid_damage_blocks.
Parameters
position
Returns
boolean
isLadder()?
optionalisLadder(position):boolean
Defined in: navigation/view.ts:54
Whether the block is a ladder, which minecraft:can_climb lets entities climb.
Parameters
position
Returns
boolean
isLava()
isLava(
position):boolean
Defined in: navigation/view.ts:38
Whether the block is lava.
Parameters
position
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
Returns
boolean
isPortal()?
optionalisPortal(position):boolean
Defined in: navigation/view.ts:50
Whether the block is a portal, for avoid_portals.
Parameters
position
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
Returns
boolean
isSunlit()?
optionalisSunlit(position):boolean
Defined in: navigation/view.ts:44
Whether the sky reaches the block, for avoid_sun.
Parameters
position
Returns
boolean
isWater()
isWater(
position):boolean
Defined in: navigation/view.ts:36
Whether the block is water or waterlogged.
Parameters
position
Returns
boolean
walkTargetValue()?
optionalwalkTargetValue(position):number
Defined in: navigation/view.ts:48
The entity's Java walk-target value at the block, for hide-position searches.
Parameters
position
Returns
number
NavigatorContext
Defined in: navigator.ts:81
What one entity's movement needs from the rest of the package.
Properties
actuator
readonlyactuator:EntityActuator|undefined
Defined in: navigator.ts:83
Moves, looks and jumps; undefined when the caller supplied no actuator.
Methods
navigation()
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
NearestAttackableTargetParams
Defined in: goals/targeting.ts:107
What minecraft:behavior.nearest_attackable_target declares.
Properties
acquisitionProbability
readonlyacquisitionProbability:number
Defined in: goals/targeting.ts:122
The chance a scan takes the candidate it found, in [0, 1].
attackInterval
readonlyattackInterval: readonly [number,number]
Defined in: goals/targeting.ts:126
How long between attack attempts, in ticks.
entityTypes
readonlyentityTypes: readonlyTargetEntityType[]
Defined in: goals/targeting.ts:108
mustReach
readonlymustReach:boolean
Defined in: goals/targeting.ts:114
mustSee
readonlymustSee:boolean
Defined in: goals/targeting.ts:113
mustSeeForgetDuration
readonlymustSeeForgetDuration:number
Defined in: goals/targeting.ts:118
How long a target survives out of sight, in ticks.
persistTime
readonlypersistTime:number
Defined in: goals/targeting.ts:120
How long the target is held at most, in ticks; 0 means until it is invalid.
reselectTargets
readonlyreselectTargets:boolean
Defined in: goals/targeting.ts:116
Whether the goal replaces a target it already has.
scanInterval
readonlyscanInterval:number
Defined in: goals/targeting.ts:124
How many ticks between scans.
targetSearchHeight
readonlytargetSearchHeight:number
Defined in: goals/targeting.ts:112
How far above and below the goal looks, in blocks.
withinRadius
readonlywithinRadius: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
readonlycooldown:number
Defined in: goals/attacking.ts:1210
How long between pounces, in ticks.
maxDistance
readonlymaxDistance:number
Defined in: goals/attacking.ts:1212
How far the goal reaches at all, in blocks.
maxSneakRange
readonlymaxSneakRange:number
Defined in: goals/attacking.ts:1214
Inside this distance the entity sneaks, in blocks.
maxSprintRange
readonlymaxSprintRange:number
Defined in: goals/attacking.ts:1216
Inside this distance the entity sprints, in blocks.
reachMultiplier
readonlyreachMultiplier:number
Defined in: goals/attacking.ts:1218
How far a swing reaches, as a multiple of the entity's width.
sneakSpeedMultiplier
readonlysneakSpeedMultiplier:number
Defined in: goals/attacking.ts:1219
sprintSpeedMultiplier
readonlysprintSpeedMultiplier:number
Defined in: goals/attacking.ts:1220
walkSpeedMultiplier
readonlywalkSpeedMultiplier:number
Defined in: goals/attacking.ts:1221
PanicParams
Defined in: goals/movement.ts:459
What minecraft:behavior.panic declares.
Properties
damageSources
readonlydamageSources: readonlystring[]
Defined in: goals/movement.ts:464
Which damage causes start a panic; an empty list accepts every one.
force
readonlyforce:boolean
Defined in: goals/movement.ts:466
Whether the panic runs even when nothing hurt the entity.
ignoreMobDamage
readonlyignoreMobDamage:boolean
Defined in: goals/movement.ts:462
Whether damage from another mob counts as a reason to panic.
panicSound
readonlypanicSound:string|undefined
Defined in: goals/movement.ts:469
preferWater
readonlypreferWater:boolean
Defined in: goals/movement.ts:468
Whether the entity runs for water rather than away.
soundInterval
readonlysoundInterval:Range
Defined in: goals/movement.ts:471
How long between panic sounds, in ticks.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/movement.ts:460
Path
Defined in: navigation/pathfinder.ts:49
A route through the world, as block positions.
Properties
nodes
readonlynodes: readonlyEntityPosition[]
Defined in: navigation/pathfinder.ts:51
The blocks to walk, the first step first and the start left out.
reachedGoal
readonlyreachedGoal: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?
readonlyoptionalallowPartial?:boolean
Defined in: navigation/pathfinder.ts:45
Whether to return the closest node reached when the goal is out of reach.
from
readonlyfrom:EntityPosition
Defined in: navigation/pathfinder.ts:37
Where the entity is now; the search floors it to a block.
goalRadius?
readonlyoptionalgoalRadius?:number
Defined in: navigation/pathfinder.ts:41
How close to to counts as arriving, in blocks. Defaults to the exact block.
maxNodes?
readonlyoptionalmaxNodes?:number
Defined in: navigation/pathfinder.ts:43
The most nodes to expand before giving up. Defaults to 512.
to
readonlyto: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
readonlycanPickupAnyItem:boolean
Defined in: goals/work.ts:115
Whether the entity picks up anything or only what it wants.
canPickupToHandOrEquipment
readonlycanPickupToHandOrEquipment:boolean
Defined in: goals/work.ts:119
Whether a picked-up item may go to the hand or the armor slots.
cooldownAfterBeingAttacked
readonlycooldownAfterBeingAttacked:number
Defined in: goals/work.ts:127
How long after being hurt before the entity picks things up again, in ticks.
excludedItems
readonlyexcludedItems: readonlystring[]
Defined in: goals/work.ts:125
Items the entity never takes.
goalRadius
readonlygoalRadius:number
Defined in: goals/work.ts:113
How close it has to be to take the item, in blocks.
maxDistance
readonlymaxDistance:number
Defined in: goals/work.ts:109
How far the entity looks for an item, in blocks.
onPickupItemEnd
readonlyonPickupItemEnd:GoalEvent|undefined
Defined in: goals/work.ts:129
onPickupItemStart
readonlyonPickupItemStart:GoalEvent|undefined
Defined in: goals/work.ts:128
pickupBasedOnChance
readonlypickupBasedOnChance:boolean
Defined in: goals/work.ts:117
Whether the pickup is gated on the entity's own chance.
pickupSameItemsAsInHand
readonlypickupSameItemsAsInHand:boolean
Defined in: goals/work.ts:121
Whether the entity only takes items matching what it already holds.
searchHeight
readonlysearchHeight:number
Defined in: goals/work.ts:111
How far it looks up and down, in blocks.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/work.ts:107
stopIfHoldingItem
readonlystopIfHoldingItem: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
readonlyaffectedByGriefingRule:boolean
Defined in: goals/work.ts:843
Whether the mobGriefing game rule gates the placement.
canPlace
readonlycanPlace:Filter|undefined
Defined in: goals/work.ts:845
What has to be true of the position for the placement to happen.
chance
readonlychance:number
Defined in: goals/work.ts:836
The chance per tick of placing, in [0, 1].
onPlace
readonlyonPlace:GoalEvent|undefined
Defined in: goals/work.ts:846
placeableBlocks
readonlyplaceableBlocks: readonlystring[]
Defined in: goals/work.ts:841
The blocks the entity may place.
xzRange
readonlyxzRange:Range
Defined in: goals/work.ts:838
How far from the entity the block may land, in blocks.
yRange
readonlyyRange:Range
Defined in: goals/work.ts:839
PlayDeadParams
Defined in: goals/environment.ts:695
What minecraft:behavior.play_dead declares.
Properties
applyRegeneration
readonlyapplyRegeneration:boolean
Defined in: goals/environment.ts:703
Whether it regenerates while down.
damageSources
readonlydamageSources: readonlystring[]
Defined in: goals/environment.ts:705
The damage causes that start it.
duration
readonlyduration:number
Defined in: goals/environment.ts:697
How long the entity stays down, in ticks.
filters
readonlyfilters:Filter|undefined
Defined in: goals/environment.ts:708
forceBelowHealth
readonlyforceBelowHealth:number
Defined in: goals/environment.ts:701
The health below which it plays dead.
randomDamageRange
readonlyrandomDamageRange:Range
Defined in: goals/environment.ts:707
The damage it still takes while down.
randomStartChance
readonlyrandomStartChance: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
readonlyfriendTypes: readonlyTargetEntityType[]
Defined in: goals/social.ts:621
Which entities the entity plays with.
speedMultiplier
readonlyspeedMultiplier: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
readonlychance:number
Defined in: goals/attacking.ts:1547
The chance of picking it, in [0, 1].
id
readonlyid: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
readonlyblocks: readonlystring[]
Defined in: goals/work.ts:430
The crops the entity eats.
goalRadius
readonlygoalRadius:number
Defined in: goals/work.ts:435
How close counts as arriving, in blocks.
initialEatDelay
readonlyinitialEatDelay:number
Defined in: goals/work.ts:437
How long it waits before the first bite, in ticks.
maxToEat
readonlymaxToEat:number
Defined in: goals/work.ts:439
How many crops it eats before it stops.
searchHeight
readonlysearchHeight:number
Defined in: goals/work.ts:433
searchRange
readonlysearchRange:number
Defined in: goals/work.ts:432
How far it looks, in blocks.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/work.ts:428
RamAttackParams
Defined in: goals/attacking.ts:1040
What minecraft:behavior.ram_attack declares.
Properties
cooldown
readonlycooldown:Range
Defined in: goals/attacking.ts:1042
How long between rams, in ticks.
impactSound
readonlyimpactSound:string|undefined
Defined in: goals/attacking.ts:1052
knockbackForce
readonlyknockbackForce:number
Defined in: goals/attacking.ts:1049
knockbackHeight
readonlyknockbackHeight:number
Defined in: goals/attacking.ts:1050
minRamDistance
readonlyminRamDistance:number
Defined in: goals/attacking.ts:1046
How close the target has to be before the entity backs up, in blocks.
onStart
readonlyonStart: readonlyGoalEvent[]
Defined in: goals/attacking.ts:1053
preRamSound
readonlypreRamSound:string|undefined
Defined in: goals/attacking.ts:1051
ramDistance
readonlyramDistance:number
Defined in: goals/attacking.ts:1044
How far the ram starts from, in blocks.
ramSpeed
readonlyramSpeed:number
Defined in: goals/attacking.ts:1047
runSpeed
readonlyrunSpeed:number
Defined in: goals/attacking.ts:1048
RandomBreachParams
Defined in: goals/environment.ts:802
What minecraft:behavior.random_breach declares.
Properties
cooldown
readonlycooldown:number
Defined in: goals/environment.ts:806
How long before the entity breaches again, in ticks.
interval
readonlyinterval:number
Defined in: goals/environment.ts:804
One tick in this many breaches.
xzDistance
readonlyxzDistance: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
readonlyangleOfView:Range
Defined in: goals/looking.ts:216
How wide the glances spread, in degrees.
continueIfLeashed
readonlycontinueIfLeashed:boolean
Defined in: goals/looking.ts:221
continueSittingOnReload
readonlycontinueSittingOnReload:boolean
Defined in: goals/looking.ts:222
cooldown
readonlycooldown:number
Defined in: goals/looking.ts:220
How long before the goal may run again, in ticks.
lookCount
readonlylookCount:Range
Defined in: goals/looking.ts:212
How many glances one sitting takes.
lookTime
readonlylookTime:Range
Defined in: goals/looking.ts:214
How long each glance lasts, in ticks.
probability
readonlyprobability: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
readonlylookDistance:number
Defined in: goals/looking.ts:162
How far the entity looks, in blocks.
lookTime
readonlylookTime: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
readonlycooldown:Range
Defined in: goals/work.ts:657
How long before the entity digs again, in ticks.
diggingDuration
readonlydiggingDuration:Range
Defined in: goals/work.ts:655
How long one dig takes, in ticks.
findValidPositionRetries
readonlyfindValidPositionRetries:number
Defined in: goals/work.ts:659
How many positions it tries before giving up.
goalRadius
readonlygoalRadius:number
Defined in: goals/work.ts:653
How close counts as arriving, in blocks.
itemTable
readonlyitemTable:string|undefined
Defined in: goals/work.ts:661
The table the find is rolled from.
onDiggingStart
readonlyonDiggingStart:GoalEvent|undefined
Defined in: goals/work.ts:667
onFailDuringDigging
readonlyonFailDuringDigging:GoalEvent|undefined
Defined in: goals/work.ts:671
onFailDuringSearching
readonlyonFailDuringSearching:GoalEvent|undefined
Defined in: goals/work.ts:670
onItemFound
readonlyonItemFound:GoalEvent|undefined
Defined in: goals/work.ts:668
onSearchingStart
readonlyonSearchingStart:GoalEvent|undefined
Defined in: goals/work.ts:666
onSuccess
readonlyonSuccess:GoalEvent|undefined
Defined in: goals/work.ts:669
searchRangeXz
readonlysearchRangeXz:number
Defined in: goals/work.ts:649
How far it looks horizontally, in blocks.
searchRangeY
readonlysearchRangeY:number
Defined in: goals/work.ts:651
How far it looks vertically, in blocks.
spawnItemAfter
readonlyspawnItemAfter:number
Defined in: goals/work.ts:663
How long after the dig the item appears, in ticks.
spawnItemPosOffset
readonlyspawnItemPosOffset:number
Defined in: goals/work.ts:665
How far in front of the entity the item appears, in blocks.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/work.ts:645
targetBlocks
readonlytargetBlocks: readonlystring[]
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
readonlycooldown:number
Defined in: goals/environment.ts:299
How long before the entity may sit again, in ticks.
minSitTime
readonlyminSitTime:number
Defined in: goals/environment.ts:301
The least time one sitting lasts, in ticks.
startChance
readonlystartChance:number
Defined in: goals/environment.ts:303
The chance per tick of sitting down, in [0, 1].
stopChance
readonlystopChance: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
readonlyattackInterval:Range
Defined in: goals/attacking.ts:245
How long between shots, in ticks, as a [min, max] pair.
attackRadius
readonlyattackRadius:number
Defined in: goals/attacking.ts:241
How far the entity shoots from, in blocks.
attackRadiusMin
readonlyattackRadiusMin:number
Defined in: goals/attacking.ts:243
How close it refuses to shoot from, in blocks.
attackRange
readonlyattackRange:Range
Defined in: goals/attacking.ts:247
How far the target may be for the goal to run at all, in blocks.
burstInterval
readonlyburstInterval:number
Defined in: goals/attacking.ts:253
How long between the shots of one volley, in ticks.
burstShots
readonlyburstShots:number
Defined in: goals/attacking.ts:251
How many shots one volley fires.
chargeChargedTrigger
readonlychargeChargedTrigger:number
Defined in: goals/attacking.ts:257
When a charged weapon counts as charged, in ticks.
chargeShootTrigger
readonlychargeShootTrigger:number
Defined in: goals/attacking.ts:255
When the entity starts the charge animation, in ticks before the shot.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/attacking.ts:239
swing
readonlyswing:boolean
Defined in: goals/attacking.ts:258
targetInSightTime
readonlytargetInSightTime: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
readonlycontrolFlags: readonly ("move"|"look"|"jump")[]
Defined in: goal.ts:40
The control flags the goal holds when the definition names none.
name
readonlyname: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
source
Returns
void
RestrictionParams
Defined in: goals/movement.ts:1018
What the home and dwelling restriction goals declare.
Properties
goalRadius
readonlygoalRadius:number
Defined in: goals/movement.ts:1021
How close to home counts as arriving, in blocks.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/movement.ts:1019
RoarParams
Defined in: goals/attacking.ts:863
What the roar-style goals declare.
Properties
duration
readonlyduration: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
readonlyprobability: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
readonlycastDuration:number
Defined in: goals/attacking.ts:1750
How long the cast takes, in ticks.
cooldownTime
readonlycooldownTime:number
Defined in: goals/attacking.ts:1752
How long before the choice may run again, in ticks.
id
readonlyid:number
Defined in: goals/attacking.ts:1748
maxActivationRange
readonlymaxActivationRange:number
Defined in: goals/attacking.ts:1754
minActivationRange
readonlyminActivationRange:number
Defined in: goals/attacking.ts:1753
sequence
readonlysequence: readonlyobject[]
Defined in: goals/attacking.ts:1757
The events fired over the cast, each with its own delay in ticks.
startSound
readonlystartSound:string|undefined
Defined in: goals/attacking.ts:1755
SendEventParams
Defined in: goals/attacking.ts:1741
What minecraft:behavior.send_event declares.
Properties
choices
readonlychoices: readonlySendEventChoice[]
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
readonlyentityTypes: readonlyTargetEntityType[]
Defined in: goals/social.ts:724
goalRadius
readonlygoalRadius:number
Defined in: goals/social.ts:729
How close it has to be to hand the item over, in blocks.
maxDistance
readonlymaxDistance:number
Defined in: goals/social.ts:727
How far the entity looks for someone to give to, in blocks.
speedMultiplier
readonlyspeedMultiplier: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
readonlyspeedMultiplier:number
Defined in: goals/movement.ts:1210
timeoutCooldown
readonlytimeoutCooldown: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
readonlyduration:number
Defined in: goals/specials.ts:347
How long the trap stays armed, in ticks.
withinRadius
readonlywithinRadius: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
readonlycolliderHeight:number
Defined in: goals/environment.ts:92
How tall the entity's collision box is while it sleeps, in blocks.
colliderWidth
readonlycolliderWidth:number
Defined in: goals/environment.ts:94
How wide it is, in blocks.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/environment.ts:88
timeoutCooldown
readonlytimeoutCooldown:number
Defined in: goals/environment.ts:90
How long before the goal may run again after it fails, in ticks.
yOffset
readonlyyOffset: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
readonlyaddRandomTimeRange:number
Defined in: goals/specials.ts:246
How much longer it may keep it, in ticks.
minChangeDirectionTime
readonlyminChangeDirectionTime:number
Defined in: goals/specials.ts:244
The least time the slime keeps one heading, in ticks.
turnRange
readonlyturnRange: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
readonlycooldown:Range
Defined in: goals/environment.ts:534
How long before it snacks again, in ticks.
items
readonlyitems: readonlystring[]
Defined in: goals/environment.ts:532
The items the entity snacks on.
stopChance
readonlystopChance: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
readonlycooldown:number
Defined in: goals/environment.ts:749
How long before the next sneeze, in ticks.
dropItemChance
readonlydropItemChance:number
Defined in: goals/environment.ts:757
The chance of dropping an item, in [0, 1].
entityTypes
readonlyentityTypes: readonlyTargetEntityType[]
Defined in: goals/environment.ts:747
The entities the sneeze scares.
lootTable
readonlylootTable:string|undefined
Defined in: goals/environment.ts:759
The table the dropped item is rolled from.
prepareSound
readonlyprepareSound:string|undefined
Defined in: goals/environment.ts:760
prepareTime
readonlyprepareTime:number
Defined in: goals/environment.ts:751
How long the wind-up lasts, in ticks.
probability
readonlyprobability:number
Defined in: goals/environment.ts:753
The chance per tick of sneezing, in [0, 1].
sound
readonlysound:string|undefined
Defined in: goals/environment.ts:761
withinRadius
readonlywithinRadius: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
readonlycooldown:Range
Defined in: goals/environment.ts:603
How long between sniffs, in ticks.
duration
readonlyduration:number
Defined in: goals/environment.ts:601
How long one sniff lasts, in ticks.
sniffingRadius
readonlysniffingRadius:number
Defined in: goals/environment.ts:605
How far the sniff reaches, in blocks.
suspicionRadiusHorizontal
readonlysuspicionRadiusHorizontal:number
Defined in: goals/environment.ts:607
How far the entity remembers what it smelled, in blocks.
suspicionRadiusVertical
readonlysuspicionRadiusVertical:number
Defined in: goals/environment.ts:608
SonicBoomParams
Defined in: goals/attacking.ts:967
What minecraft:behavior.sonic_boom declares.
Properties
attackSound
readonlyattackSound:string|undefined
Defined in: goals/attacking.ts:977
chargeSound
readonlychargeSound:string|undefined
Defined in: goals/attacking.ts:976
cooldown
readonlycooldown:number
Defined in: goals/attacking.ts:971
How long before the beam can fire again, in ticks.
damage
readonlydamage:number
Defined in: goals/attacking.ts:972
duration
readonlyduration:number
Defined in: goals/attacking.ts:969
How long the charge and beam take together, in ticks.
heightCap
readonlyheightCap:number
Defined in: goals/attacking.ts:975
horizontalStrength
readonlyhorizontalStrength:number
Defined in: goals/attacking.ts:973
verticalStrength
readonlyverticalStrength: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
readonlyinterestTime:number
Defined in: goals/attacking.ts:1285
How long the entity watches before it pounces, in ticks.
leapDistance
readonlyleapDistance:number
Defined in: goals/attacking.ts:1287
How far the pounce carries, in blocks.
leapHeight
readonlyleapHeight:number
Defined in: goals/attacking.ts:1288
maxStalkDistance
readonlymaxStalkDistance:number
Defined in: goals/attacking.ts:1290
How far the entity stalks from, in blocks.
pounceMaxDistance
readonlypounceMaxDistance:number
Defined in: goals/attacking.ts:1292
The furthest the pounce starts from, in blocks.
stalkSpeed
readonlystalkSpeed:number
Defined in: goals/attacking.ts:1295
strikeDistance
readonlystrikeDistance:number
Defined in: goals/attacking.ts:1294
How close the pounce has to land to hurt, in blocks.
stuckTime
readonlystuckTime: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
readonlyattackOnce:boolean
Defined in: goals/attacking.ts:140
Inherited from
canSpreadOnFire
readonlycanSpreadOnFire:boolean
Defined in: goals/attacking.ts:149
Inherited from
MeleeAttackParams.canSpreadOnFire
cooldownTime
readonlycooldownTime:number
Defined in: goals/attacking.ts:144
How long between swings, in ticks.
Inherited from
MeleeAttackParams.cooldownTime
meleeFov
readonlymeleeFov:number
Defined in: goals/attacking.ts:148
How wide the swing arc is, in degrees.
Inherited from
noDamageRangeMultiplier
readonlynoDamageRangeMultiplier:number
Defined in: goals/attacking.ts:1122
How far from the stomp the damage stops, as a multiple of the width.
onAttack
readonlyonAttack:GoalEvent|undefined
Defined in: goals/attacking.ts:150
Inherited from
onKill
readonlyonKill:GoalEvent|undefined
Defined in: goals/attacking.ts:151
Inherited from
randomStopInterval
readonlyrandomStopInterval:number
Defined in: goals/attacking.ts:142
Inherited from
MeleeAttackParams.randomStopInterval
reachMultiplier
readonlyreachMultiplier: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
readonlyrequireCompletePath:boolean
Defined in: goals/attacking.ts:141
Inherited from
MeleeAttackParams.requireCompletePath
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/attacking.ts:138
Inherited from
MeleeAttackParams.speedMultiplier
stompRangeMultiplier
readonlystompRangeMultiplier:number
Defined in: goals/attacking.ts:1120
How far the stomp reaches, as a multiple of the entity's width.
trackTarget
readonlytrackTarget:boolean
Defined in: goals/attacking.ts:139
Inherited from
StompTurtleEggParams
Defined in: goals/work.ts:929
What minecraft:behavior.stomp_turtle_egg declares.
Properties
goalRadius
readonlygoalRadius:number
Defined in: goals/work.ts:935
How close counts as arriving, in blocks.
interval
readonlyinterval:number
Defined in: goals/work.ts:937
One tick in this many starts a search.
searchHeight
readonlysearchHeight:number
Defined in: goals/work.ts:933
searchRange
readonlysearchRange:number
Defined in: goals/work.ts:932
How far the entity looks for eggs, in blocks.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/work.ts:930
SummonChoice
Defined in: goals/attacking.ts:1637
One entry of summon_choices.
Properties
castDuration
readonlycastDuration:number
Defined in: goals/attacking.ts:1640
How long the cast takes, in ticks.
cooldownTime
readonlycooldownTime:number
Defined in: goals/attacking.ts:1642
How long before the choice may run again, in ticks.
id
readonlyid:number
Defined in: goals/attacking.ts:1638
maxActivationRange
readonlymaxActivationRange:number
Defined in: goals/attacking.ts:1645
minActivationRange
readonlyminActivationRange:number
Defined in: goals/attacking.ts:1644
How far the target may be, in blocks.
sequence
readonlysequence: readonlySummonStep[]
Defined in: goals/attacking.ts:1648
What the cast does, as the spell's own sequence of steps.
startSound
readonlystartSound:string|undefined
Defined in: goals/attacking.ts:1646
SummonEntityParams
Defined in: goals/attacking.ts:1631
What minecraft:behavior.summon_entity declares.
Properties
choices
readonlychoices: readonlySummonChoice[]
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
readonlybaseDelay:number
Defined in: goals/attacking.ts:1661
entityType
readonlyentityType:string|undefined
Defined in: goals/attacking.ts:1654
The entity type to create.
numberOfSummons
readonlynumberOfSummons:number
Defined in: goals/attacking.ts:1656
How many to create.
spawnEvent
readonlyspawnEvent:string|undefined
Defined in: goals/attacking.ts:1658
The event to run on each.
summonCap
readonlysummonCap: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
readonlystartDistance:number
Defined in: goals/attacking.ts:762
How close the target has to be to start swelling, in blocks.
stopDistance
readonlystopDistance: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
readonlyidleTime:number
Defined in: goals/movement.ts:356
How long the entity hangs still, in ticks.
successRate
readonlysuccessRate: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
readonlyinterval:number
Defined in: goals/movement.ts:302
One tick in this many starts a drift.
lookAhead
readonlylookAhead:number
Defined in: goals/movement.ts:304
How far ahead the entity aims, in blocks.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/movement.ts:300
wanderTime
readonlywanderTime: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
readonlycatchUpMultiplier:number
Defined in: goals/movement.ts:1577
How much faster the entity swims when it falls behind.
catchUpThreshold
readonlycatchUpThreshold:number
Defined in: goals/movement.ts:1579
How far behind counts as falling behind, in blocks.
chanceToStop
readonlychanceToStop:number
Defined in: goals/movement.ts:1581
The chance per check of letting the companion go, in [0, 1].
entityTypes
readonlyentityTypes: readonlyTargetEntityType[]
Defined in: goals/movement.ts:1570
matchDirectionThreshold
readonlymatchDirectionThreshold:number
Defined in: goals/movement.ts:1587
How closely the entity matches the companion's heading, in blocks.
searchRange
readonlysearchRange:number
Defined in: goals/movement.ts:1573
How far the goal looks for a companion, in blocks.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/movement.ts:1571
stateCheckInterval
readonlystateCheckInterval:number
Defined in: goals/movement.ts:1585
How many ticks between checks.
stopDistance
readonlystopDistance:number
Defined in: goals/movement.ts:1575
How close the entity swims, in blocks.
successRate
readonlysuccessRate: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
readonlyblocks: readonlystring[]
Defined in: goals/work.ts:896
The blocks the entity may pick up.
chance
readonlychance:number
Defined in: goals/work.ts:892
The chance per tick of taking a block, in [0, 1].
xzRange
readonlyxzRange:Range
Defined in: goals/work.ts:893
yRange
readonlyyRange: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
readonlycooldown:number
Defined in: params.ts:158
How long the entry waits between attempts, in ticks.
filters
readonlyfilters:Filter|undefined
Defined in: params.ts:148
Which entities the entry matches, evaluated with the candidate as other.
maxDistance
readonlymaxDistance:number
Defined in: params.ts:150
How far the entry reaches, in blocks.
mustSee
readonlymustSee:boolean
Defined in: params.ts:152
Whether the entity has to see the candidate.
mustSeeForgetDuration
readonlymustSeeForgetDuration:number
Defined in: params.ts:154
How long a seen candidate stays valid out of sight, in ticks.
sprintSpeedMultiplier
readonlysprintSpeedMultiplier:number
Defined in: params.ts:156
walkSpeedMultiplier
readonlywalkSpeedMultiplier:number
Defined in: params.ts:155
TargetWhenPushedParams
Defined in: goals/targeting.ts:420
What minecraft:behavior.target_when_pushed declares.
Properties
entityTypes
readonlyentityTypes: readonlyTargetEntityType[]
Defined in: goals/targeting.ts:421
percentChance
readonlypercentChance: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
readonlycanGetScared:boolean
Defined in: goals/social.ts:246
Whether a sudden move or turn scares the entity off.
canTemptVertically
readonlycanTemptVertically:boolean
Defined in: goals/social.ts:248
Whether the entity follows an item held above or below it.
canTemptWhileRidden
readonlycanTemptWhileRidden:boolean
Defined in: goals/social.ts:250
Whether a ridden entity still follows the item.
items
readonlyitems: readonlystring[]
Defined in: goals/social.ts:242
The items that tempt the entity.
onTemptEnd
readonlyonTemptEnd:GoalEvent|undefined
Defined in: goals/social.ts:256
onTemptStart
readonlyonTemptStart:GoalEvent|undefined
Defined in: goals/social.ts:255
soundInterval
readonlysoundInterval:Range
Defined in: goals/social.ts:254
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/social.ts:240
stopDistance
readonlystopDistance:number
Defined in: goals/social.ts:252
How close the entity comes before it stops, in blocks.
temptSound
readonlytemptSound:string|undefined
Defined in: goals/social.ts:253
withinRadius
readonlywithinRadius: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?
readonlyoptionalfamilies?: readonlystring[]
Defined in: harness.ts:119
flags?
readonlyoptionalflags?: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?
readonlyoptionalhealth?:number
Defined in: harness.ts:118
heldItem?
readonlyoptionalheldItem?:string
Defined in: harness.ts:117
identifier?
readonlyoptionalidentifier?:string
Defined in: harness.ts:116
lastDamager?
readonlyoptionallastDamager?:GoalMob
Defined in: harness.ts:122
target?
readonlyoptionaltarget?:GoalMob
Defined in: harness.ts:121
TimerFlagParams
Defined in: goals/specials.ts:516
What the three timer flag goals declare.
Properties
cooldown
readonlycooldown:Range
Defined in: goals/specials.ts:520
How long it stays down, in ticks.
duration
readonlyduration:Range
Defined in: goals/specials.ts:518
How long the flag stays up, in ticks.
onEnd
readonlyonEnd:GoalEvent|undefined
Defined in: goals/specials.ts:522
onStart
readonlyonStart:GoalEvent|undefined
Defined in: goals/specials.ts:521
TradeInterestParams
Defined in: goals/social.ts:1004
What minecraft:behavior.trade_interest declares.
Properties
carriedItemSwitchTime
readonlycarriedItemSwitchTime:number
Defined in: goals/social.ts:1006
How long the entity shows one item, in ticks.
cooldown
readonlycooldown:number
Defined in: goals/social.ts:1012
How long before the goal may run again, in ticks.
interestTime
readonlyinterestTime:number
Defined in: goals/social.ts:1008
How long before the entity loses interest, in ticks.
removeItemTime
readonlyremoveItemTime:number
Defined in: goals/social.ts:1010
How long it holds the last item out, in ticks.
withinRadius
readonlywithinRadius: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
readonlydestinationContainerTypes: readonlystring[]
Defined in: goals/work.ts:560
The containers it puts them into.
idleCooldown
readonlyidleCooldown:number
Defined in: goals/work.ts:566
How long it waits between runs, in ticks.
initialCooldown
readonlyinitialCooldown:number
Defined in: goals/work.ts:568
How long it waits before the first run, in ticks.
maxStackSize
readonlymaxStackSize:number
Defined in: goals/work.ts:562
How many items it moves at a time.
maxVisitedContainers
readonlymaxVisitedContainers:number
Defined in: goals/work.ts:564
How many containers it visits before it gives up.
placeStrategy
readonlyplaceStrategy:string|undefined
Defined in: goals/work.ts:574
How it decides where an item goes.
searchDistance
readonlysearchDistance:number
Defined in: goals/work.ts:570
How far it looks for a container, in blocks.
searchStrategy
readonlysearchStrategy:string|undefined
Defined in: goals/work.ts:572
How it picks a container, which vanilla writes as a strategy name.
sourceContainerTypes
readonlysourceContainerTypes: readonlystring[]
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
readonlyapproachDistance:number
Defined in: goals/attacking.ts:1367
How close the entity rides in before it strikes, in blocks.
cooldownDistance
readonlycooldownDistance:Range
Defined in: goals/attacking.ts:1371
How long it waits between strikes, in ticks.
cooldownSpeedMultiplier
readonlycooldownSpeedMultiplier:number
Defined in: goals/attacking.ts:1381
hijackMountNavigation
readonlyhijackMountNavigation:boolean
Defined in: goals/attacking.ts:1377
Whether the goal steers the mount rather than the rider.
repositionDistance
readonlyrepositionDistance:Range
Defined in: goals/attacking.ts:1369
How far it backs off after a strike, in blocks.
repositionSpeedMultiplier
readonlyrepositionSpeedMultiplier:number
Defined in: goals/attacking.ts:1380
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/attacking.ts:1379
trackTarget
readonlytrackTarget:boolean
Defined in: goals/attacking.ts:1378
weaponMinSpeedMultiplier
readonlyweaponMinSpeedMultiplier:number
Defined in: goals/attacking.ts:1375
The least speed the weapon needs to hurt, as a multiple of the mount's speed.
weaponReachMultiplier
readonlyweaponReachMultiplier: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?
optionalsupport?: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()?
optionalworld(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
Returns
GoalWorld | undefined
VillageMoveParams
Defined in: goals/movement.ts:1105
What the village movement goals declare.
Properties
cooldown
readonlycooldown:number
Defined in: goals/movement.ts:1114
How long before the goal may run again, in ticks.
goalRadius
readonlygoalRadius:number
Defined in: goals/movement.ts:1108
How close counts as arriving, in blocks.
searchRange
readonlysearchRange:number
Defined in: goals/movement.ts:1110
How far the entity looks for the village, in blocks.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/movement.ts:1106
startChance
readonlystartChance: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?
readonlyoptionalclimbable?:boolean
Defined in: navigation/voxelGrid.ts:25
damaging?
readonlyoptionaldamaging?:boolean
Defined in: navigation/voxelGrid.ts:21
door?
readonlyoptionaldoor?:DoorState
Defined in: navigation/voxelGrid.ts:20
identifier
readonlyidentifier:string
Defined in: navigation/voxelGrid.ts:15
lava?
readonlyoptionallava?:boolean
Defined in: navigation/voxelGrid.ts:19
passable
readonlypassable:boolean
Defined in: navigation/voxelGrid.ts:16
portal?
readonlyoptionalportal?:boolean
Defined in: navigation/voxelGrid.ts:24
skyVisible?
readonlyoptionalskyVisible?:boolean
Defined in: navigation/voxelGrid.ts:23
solid
readonlysolid:boolean
Defined in: navigation/voxelGrid.ts:17
sunlit?
readonlyoptionalsunlit?:boolean
Defined in: navigation/voxelGrid.ts:22
water?
readonlyoptionalwater?:boolean
Defined in: navigation/voxelGrid.ts:18
WanderParams
Defined in: goals/movement.ts:106
What the wandering goals declare.
Extended by
Properties
interval
readonlyinterval:number
Defined in: goals/movement.ts:113
One tick in this many starts a walk.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/movement.ts:107
xzDistance
readonlyxzDistance:number
Defined in: goals/movement.ts:109
How far the destination may be horizontally, in blocks.
yDistance
readonlyyDistance: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
readonlyactiveTime:number
Defined in: goals/work.ts:266
How long one shift lasts, in ticks.
canWorkInRain
readonlycanWorkInRain:boolean
Defined in: goals/work.ts:270
Whether the entity works in the rain.
goalCooldown
readonlygoalCooldown:number
Defined in: goals/work.ts:268
How long before the entity may work again, in ticks.
onArrival
readonlyonArrival:GoalEvent|undefined
Defined in: goals/work.ts:275
soundDelay
readonlysoundDelay:Range
Defined in: goals/work.ts:274
How long between work sounds, in ticks.
speedMultiplier
readonlyspeedMultiplier:number
Defined in: goals/work.ts:264
workInRainTolerance
readonlyworkInRainTolerance: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
Returns
GoalWorld | undefined
NavigationKind
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
Returns
Variables
NAVIGATION_KINDS
constNAVIGATION_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
constSLIME_HOP_REACH:4=4
Defined in: goals/slimeHeading.ts:67
How far one hop carries a slime, in blocks.
VOXEL_KINDS
constVOXEL_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
constadmireItem: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
constaquaticChargeAttack: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
constattackingGoals: readonlyRegisterableGoal[]
Defined in: goals/attacking.ts:1861
Every goal in the attacking family.
avoidBlock
constavoidBlock: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
constavoidMobType: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
constbarter: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
constbeg: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
constbreed: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
constcelebrate: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
constcelebrateSurvive: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
constchargeAttack: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
constchargeHeldItem: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
constcircleAroundAnchor: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
constcontrolledByPlayer: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
constcroak: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
constdefaultNavigationProfile: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
constdefendTrustedTarget: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
constdefendVillageTarget: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
constdelayedAttack: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
constdig: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
constdragonChargePlayer:RegisterableGoal
Defined in: goals/specials.ts:70
minecraft:behavior.dragonchargeplayer, the dragon's dive at a player.
dragonDeath
constdragonDeath:RegisterableGoal
Defined in: goals/specials.ts:85
minecraft:behavior.dragondeath, which holds the dragon still until its death animation ends.
dragonFlaming
constdragonFlaming:RegisterableGoal
Defined in: goals/specials.ts:79
minecraft:behavior.dragonflaming, the dragon's breath attack from the portal.
dragonHoldingPattern
constdragonHoldingPattern:RegisterableGoal
Defined in: goals/specials.ts:61
minecraft:behavior.dragonholdingpattern, the dragon's default circling of the end crystals.
dragonLanding
constdragonLanding:RegisterableGoal
Defined in: goals/specials.ts:73
minecraft:behavior.dragonlanding, the dragon's descent to the portal.
dragonScanning
constdragonScanning:RegisterableGoal
Defined in: goals/specials.ts:64
minecraft:behavior.dragonscanning, the dragon's pause on the portal while it chooses a target.
dragonStrafePlayer
constdragonStrafePlayer:RegisterableGoal
Defined in: goals/specials.ts:67
minecraft:behavior.dragonstrafeplayer, the dragon's strafing fireball run.
dragonTakeoff
constdragonTakeoff:RegisterableGoal
Defined in: goals/specials.ts:76
minecraft:behavior.dragontakeoff, the dragon's climb back off the portal.
drinkMilk
constdrinkMilk: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
constdrinkPotion: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
constdropItemFor: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
consteatBlock: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
consteatCarriedItem: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
consteatMob: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
constemerge: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
constemptyBody:ComponentSchema<GoalBody>
Defined in: params.ts:177
Accepts any object body, for a goal whose behavior takes no parameters.
emptyGoalWorld
constemptyGoalWorld:GoalWorld={}
Defined in: world.ts:251
A world that answers nothing, which is what a goal gets when the server supplies none.
environmentGoals
constenvironmentGoals: readonlyRegisterableGoal[]
Defined in: goals/environment.ts:860
Every goal in the environment family.
equipItem
constequipItem: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
constexploreOutskirts: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
constfertilizeFarmBlock: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
constfindCover: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
constfindMount: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
constfindUnderwaterTreasure: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
constfireAtTarget: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
constfleeSun: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
constfloat: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
constfloatTempt: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
constfloatWander: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
constfollowCaravan: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
constfollowMob: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
constfollowOwner: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
constfollowParent: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
constfollowTargetCaptain: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
constgoAndGiveItemsToNoteblock: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
constgoAndGiveItemsToOwner: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
constgoHome: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
constgoalInventory:GoalInventory=data
Defined in: inventory.ts:51
The measured inventory of the vanilla pack this package was written against.
goalNames
constgoalNames: readonlystring[]
Defined in: inventory.ts:54
Every vanilla goal name, in descending use order.
guardianAttack
constguardianAttack: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
constharvestFarmBlock: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
consthide: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
constholdGround: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
consthurtByTarget: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
constinspectBookshelf: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
constinvestigateSuspiciousLocation: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
constjumpAroundTarget: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
constjumpToBlock: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
constknockbackRoar: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
constlayDown: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
constlayEgg: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
constleapAtTarget: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
constlookAtEntity: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
constlookAtPlayer: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
constlookAtTarget: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
constlookAtTradingPlayer: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
constlookingGoals: readonlyRegisterableGoal[]
Defined in: goals/looking.ts:284
Every goal in the looking family.
makeLove
constmakeLove: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
constmeleeAttack: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
constmeleeBoxAttack: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
constmingle: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
constmountPathing: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
constmoveAroundTarget: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
constmoveIndoors: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
constmoveOutdoors: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
constmoveThroughVillage: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
constmoveToBlock: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
constmoveToLand: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
constmoveToLiquid: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
constmoveToRandomBlock: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
constmoveToVillage: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
constmoveToWater: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
constmoveTowardsDwellingRestriction: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
constmoveTowardsHomeRestriction: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
constmoveTowardsTarget: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
constmovementGoals: readonlyRegisterableGoal[]
Defined in: goals/movement.ts:1983
Every goal in the movement family.
nap
constnap: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
constnearestAttackableTarget: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
constnearestPrioritizedAttackableTarget: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
constocelotAttack: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
constocelotSitOnBlock: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
constofferFlower: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
constopenDoor: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
constownerHurtByTarget: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
constownerHurtTarget: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
constpanic: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
constpetSleepWithOwner: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
constpickupItems: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
constplaceBlock: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
constplay:RegisterableGoal
Defined in: goals/social.ts:628
minecraft:behavior.play, which the baby villager carries. It chases another young villager around the village.
playDead
constplayDead: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
constplayerRideTamed: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
constraidGarden: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
constramAttack: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
constrandomBreach: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
constrandomFly: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
constrandomHover: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
constrandomLookAround: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
constrandomLookAroundAndSit: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
constrandomSearchAndDig: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
constrandomSitting: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
constrandomStroll: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
constrandomSwim: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
constrangedAttack: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
constreceiveLove: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
constrestrictOpenDoor: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
constriseToLiquidLevel: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
constroar:RegisterableGoal
Defined in: goals/attacking.ts:872
minecraft:behavior.roar, which the warden carries. It holds the entity still for the roar animation.
roll
constroll: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
construnAroundLikeCrazy: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
constscared: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
constsendEvent: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
constshareItems: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
constsilverfishMergeWithStone: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
constsilverfishWakeUpFriends: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
constskeletonHorseTrap: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
constsleep: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
constslimeAttack: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
constslimeFloat: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
constslimeKeepOnJumping: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
constslimeRandomDirection: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
constsnacking: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
constsneeze: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
constsniff: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
constsocialGoals: readonlyRegisterableGoal[]
Defined in: goals/social.ts:1310
Every goal in the social family.
sonicBoom
constsonicBoom: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
constspecialGoals: readonlyRegisterableGoal[]
Defined in: goals/specials.ts:582
Every goal in the single-entity family.
squidDive
constsquidDive:RegisterableGoal
Defined in: goals/specials.ts:160
minecraft:behavior.squid_dive, the squid's push toward deeper water.
squidFlee
constsquidFlee:RegisterableGoal
Defined in: goals/specials.ts:163
minecraft:behavior.squid_flee, the squid's burst away from a threat.
squidIdle
constsquidIdle:RegisterableGoal
Defined in: goals/specials.ts:157
minecraft:behavior.squid_idle, the squid's default slow drift.
squidMoveAwayFromGround
constsquidMoveAwayFromGround: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
constsquidOutOfWater: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
conststalkAndPounceOnTarget: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
conststayNearNoteblock: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
conststayWhileSitting: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
conststompAttack: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
conststompTurtleEgg: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
conststrollTowardsVillage: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
constsummonEntity: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
constswell: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
constswimIdle: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
constswimUpForBreath: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
constswimWander: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
constswimWithEntity: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
constswoopAttack: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
consttakeBlock: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
consttakeFlower: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
consttargetWhenPushed: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
consttargetingGoals: readonlyRegisterableGoal[]
Defined in: goals/targeting.ts:496
Every goal in the targeting family.
teleportToOwner
constteleportToOwner: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
consttempt: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
consttimerFlag1:RegisterableGoal
Defined in: goals/specials.ts:573
minecraft:behavior.timer_flag_1, which four vanilla entities carry.
timerFlag2
consttimerFlag2:RegisterableGoal
Defined in: goals/specials.ts:576
minecraft:behavior.timer_flag_2, which the villager carries.
timerFlag3
consttimerFlag3:RegisterableGoal
Defined in: goals/specials.ts:579
minecraft:behavior.timer_flag_3, which the villager carries.
tradeInterest
consttradeInterest: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
consttradeWithPlayer: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
consttransportItems: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
constuseKineticWeapon: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
constvanillaGoalNames: readonlystring[]
Defined in: register.ts:38
Every goal name this package registers, sorted.
vanillaGoals
constvanillaGoals: readonlyRegisterableGoal[]
Defined in: register.ts:26
Every goal this package implements, in family order.
witherRandomAttackPos
constwitherRandomAttackPos: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
constwitherTargetHighestDamage: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
constwork: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
constworkComposter: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
constworkGoals: readonlyRegisterableGoal[]
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
Returns
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
booleanAt()
booleanAt(
body,key,fallback):boolean
Defined in: params.ts:34
Reads a boolean, falling back when the key is absent.
Parameters
body
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
profile
at
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
Returns
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
distanceBetween()
distanceBetween(
a,b):number
Defined in: navigation/view.ts:72
The straight-line distance between two positions.
Parameters
a
b
Returns
number
entityTypesAt()
entityTypesAt(
body,key?): readonlyTargetEntityType[]
Defined in: params.ts:173
Reads the entity_types table, which vanilla writes as one entry or as a list.
Parameters
body
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
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): readonlyGoalEvent[]
Defined in: params.ts:120
Reads a list of event hooks, which on_item_throw and on_reach write as arrays.
Parameters
body
key
string
Returns
readonly GoalEvent[]
filterAt()
filterAt(
body,key):Filter|undefined
Defined in: params.ts:137
Reads a filter under a key.
Parameters
body
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
profile
request
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
Returns
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): readonlystring[]
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
b
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
navigationProfile()
navigationProfile(
entity):NavigationProfile
Defined in: navigation/profile.ts:150
Builds the path finder's rules from the entity's active navigation component.
Parameters
entity
Returns
The profile of the first minecraft:navigation.* the entity has active, or defaultNavigationProfile when it has none.
navigationProfileOf()
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
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
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
key
string
fallback
Returns
recordsAt()
recordsAt(
body,key): readonlyGoalBody[]
Defined in: params.ts:91
Reads the members of a list, dropping anything that is not an object.
Parameters
body
key
string
Returns
readonly GoalBody[]
registerVanillaGoals()
registerVanillaGoals(
registry,options?): readonlystring[]
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
The registry the entity types resolve against.
options?
VanillaGoalOptions = {}
Returns
readonly string[]
The names that were already registered and were left alone.
Example
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
The slime, which is the key the goals of one mob meet on.
Returns
stringAt()
stringAt(
body,key):string|undefined
Defined in: params.ts:38
Reads a string, or undefined when the key is absent.
Parameters
body
key
string
Returns
string | undefined
stringsAt()
stringsAt(
body,key): readonlystring[]
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
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
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
options?
TestMobOptions = {}
Returns
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
key
string
fallbackSeconds
Returns
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
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
A view that answers every member, with unwritten positions treated as impassable so a scenario does not need walls around it.
Example
const view = voxelGrid([['###', '###'], ['...', '...']]);