API reference / @jsprismarine/entity-brains
@jsprismarine/entity-brains
Java Edition's brain AI: memories, sensors, activities, the behavior combinators, and the twenty mobs that build a brain. This is the half of vanilla mob behavior that Bedrock's entity JSON has no way to describe.
import { BrainMobRegistry, registerBrainMobs } from '@jsprismarine/entity-brains';
const registry = new BrainMobRegistry();
registerBrainMobs(registry); // 20 mobs
const villager = registry.get('minecraft:villager');
const brain = villager.makeBrain({ variant: 'minecraft:farmer' });
// Once per mob tick, in this order, as Java's Mob.customServerAiStep does.
villager.updateActivity(context);
brain.tick(context);Why this package exists
Java runs two unrelated mob AI systems. The goal system is 68 classes and 5520 lines, and 30 of its 67 concrete goal names match a Bedrock minecraft:behavior.* name after snake-casing, so Bedrock's data-driven JSON carries those mobs; @jsprismarine/entity-goals implements them. The brain system is 116 classes and 8905 lines plus 24 sensors, 115 memory modules and 26 activities, and Bedrock publishes no memory, sensor or activity registry at all. A Bedrock-shaped runtime cannot hold the per-mob state a Java brain holds, because the format never names it.
Exactly twenty mob classes build a brain. The list is not a judgement call: scanning the constant pool of every top-level class under net/minecraft/world/entity/ for brainProvider or makeBrain finds 21 classes, and the twenty-first is LivingEntity, which holds the base. Everything else in the game, including every zombie, skeleton, farm animal, slime, guardian and the ender dragon, is goals only.
Two of the twenty carry both systems. Camel and HappyGhast have a registerGoals and a brainProvider, so a server must run both schedulers for them. DUAL_SYSTEM_MOBS reports that list, and BrainMobDefinition.alsoRunsGoals reports it per mob.
docs/research/java-code-only-behavior.md section 4 is the source for the two-system split and for the twenty-mob list.
The source
Everything here is read out of the pinned Java Edition 26.3 server jar, which since release 26.1 ships with original class, field and method names and no obfuscation map. The jar is the one @jsprismarine/bedrock-data caches under node_modules/.cache/jsprismarine/java-server/26.3. The villager schedule is the one exception, because Mojang moved it into a datapack: it comes from data/minecraft/timeline/villager_schedule.json in the 26.3 vanilla datapack.
Measured counts, against the research note
| Registry | Note | Measured | Where |
|---|---|---|---|
minecraft:memory_module_type | 115 | 115 | MemoryModuleType.<clinit> |
minecraft:sensor_type | 24 | 24 | SensorType.<clinit> |
minecraft:activity | 26 | 26 | Activity.<clinit> |
| Mobs with a brain | 20 | 20 | brainProvider and makeBrain references |
All three match. Six of the 115 memory modules register under a name that differs from their Java field name, which is worth knowing when reading a saved brain: NEAREST_LIVING_ENTITIES registers as mobs, NEAREST_VISIBLE_LIVING_ENTITIES as visible_mobs, NEAREST_VISIBLE_ATTACKABLE_PLAYER(S) as nearest_visible_targetable_player(s), LONG_JUMP_COOLDOWN_TICKS as long_jump_cooling_down, BREEZE_SHOOT_RECOVERING as breeze_shoot_recover, and LIKED_NOTEBLOCK_POSITION as liked_noteblock.
The brain model
A brain is a memory map, a sensor list, and a table of behaviors keyed by priority and activity. One tick runs four steps in Java's order: age the memories, run the sensors, start every stopped behavior whose activity is active, then tick every running one. Starting before ticking is observable, because a behavior started this tick also ticks this tick.
Memories
A memory is a typed slot holding an optional value with an optional expiry in ticks. Three rules decide most of what a brain does.
A memory set with a time to live of n is readable on n ticks and is cleared on the n plus first, because MemorySlot.tick checks expiry before decrementing.
An empty array is stored as no value. Brain.setMemory nulls out an empty collection, which is why value_present on a list memory means "the sensor found something" rather than "the sensor ran".
An unregistered memory fails every precondition, including registered. A brain only registers the memories its declared list, its sensors and its behaviors name, so a behavior whose memories the mob never declared is silently inert. That is the mechanism behind several vanilla quirks, including why WardenAi.setDigCooldown checks that the memory already has a value before writing it.
Memory preconditions
MemoryStatus has three members. value_present and value_absent are the obvious ones. registered means the slot must exist but may be empty, and a behavior asks for it when it intends to write the memory, which is how the brain learns to allocate the slot.
Activities
A brain is in exactly one non-core activity at a time plus every core activity, and core is the only core activity any vanilla mob declares. The brain itself never chooses an activity: it only answers whether one is possible. The choice lives in each mob's updateActivity, which calls setActiveActivityToFirstValid with an ordered list, and that list is the mob's priority order between activities.
Leaving an activity erases the memories it declared as memoriesToEraseWhenStopped, which is the ActivityData.create(activity, priority, list, memory) shorthand Java uses for ATTACK_TARGET, AVOID_TARGET, ADMIRING_ITEM and friends.
Behaviors
BehaviorControl has four members: tryStart, tickOrStop, doStop and a status that is stopped or running. Behavior adds memory preconditions and a duration drawn from [minDuration, maxDuration], and its canStillUse returns false by default, so a behavior that does not override it runs for exactly one tick.
OneShot is a behavior whose whole body is one function that reports whether it did anything. Nearly all of Java's behavior library is built this way, through BehaviorBuilder.
The declarative form
Java writes BehaviorBuilder as an applicative functor over MemoryCondition, because DataFixerUpper gave it one for free. The content is simpler than the encoding, and this package writes it as a fluent chain that accumulates the accessor types.
const setLookTarget = behavior('SetEntityLookTarget')
.absent(MemoryModuleTypes.LOOK_TARGET)
.present(MemoryModuleTypes.NEAREST_VISIBLE_LIVING_ENTITIES)
.build((context, lookTarget, nearest) => {
const target = nearest.get().findClosest(predicate);
if (target === undefined) return false;
lookTarget.set(entityTracker(target));
return true;
});The combinators
GateBehavior runs a weighted list of children under one set of memory conditions. Its order policy is ordered or shuffled and its running policy is run_one or try_all, and it stops once no child is running. RunOne is the shuffled run_one case and is the most used combinator in the game. TriggerGate is the same over plain triggers rather than full behaviors, so nothing stays running across ticks.
The shuffle is the exponential ranking trick Java uses. Each entry takes the key -random ** (1 / weight) and the list sorts ascending, which makes the chance an entry sorts first proportional to its weight.
The twenty mobs and their activity tables
Priorities are Java's. A number in parentheses after an activity is the priority its first behavior takes; ActivityData.createPriorityPairs numbers the rest upward from there.
| Mob | Activities | Gated by | Sensors |
|---|---|---|---|
| allay | core (0), idle (0) | 4 | |
| armadillo | core (0), idle (0 to 4), panic (0) | panic: DANGER_DETECTED_RECENTLY present and IS_PANICKING absent | 5 |
| axolotl | core (0), idle (0 to 4), fight (0), play_dead (0) | fight: ATTACK_TARGET; play_dead: PLAY_DEAD_TICKS | 5 |
| breeze | core (0), idle (0 to 3), fight (0 to 4) | fight: ATTACK_TARGET present, WALK_TARGET absent | 4 |
| camel | core (0), idle (0 to 4) | 4 | |
| copper golem | core (0), idle (0 to 2) | 2 | |
| creaking | core (0), idle (10), fight (10) | fight: ATTACK_TARGET | 2 |
| frog | core (0), idle (0 to 4), swim (0 to 5), lay_spawn (0 to 4), tongue (0), long_jump (0 to 1) | three activities split on IS_IN_WATER, IS_PREGNANT and LONG_JUMP_MID_JUMP | 5 |
| goat | core (0), idle (0 to 3), long_jump (0 to 1), ram (0 to 1) | idle needs both cooldowns present | 6 |
| happy ghast | core (0), idle (1 to 4), panic (no behaviors) | panic: IS_PANICKING | 5 |
| hoglin | core (0), idle (10), fight (10), avoid (10) | fight: ATTACK_TARGET; avoid: AVOID_TARGET | 4 |
| nautilus | core (0), idle (1 to 4), fight (0) | fight: four memory conditions | 5 |
| piglin | core (0), idle (10), admire_item (10), fight (10), celebrate (10), avoid (10), ride (10) | one memory each | 5 |
| piglin brute | core (0), idle (10), fight (10) | fight: ATTACK_TARGET | 5 |
| sniffer | core (0), idle (0 to 4), sniff (0), dig (0) | sniff and dig: three memories each | 4 |
| tadpole | core (0), idle (0 to 2) | 4 | |
| villager | core (0 to 10), work, play, rest, meet, idle, panic, pre_raid, raid, hide | work: JOB_SITE; meet: MEETING_POINT | 9 |
| warden | core (0), emerge (5), dig (0 to 1), idle (10), roar (10), fight (10), investigate (5), sniff (5) | one memory each | 2 |
| zoglin | core (0), idle (10), fight (10) | fight: ATTACK_TARGET | 2 |
| zombie nautilus | core (0), idle (1 to 3), fight (0) | fight: four memory conditions | 5 |
A few of these are worth calling out.
The goat is inverted. Its idle activity requires RAM_COOLDOWN_TICKS and LONG_JUMP_COOLDOWN_TICKS to be present, so a goat is idle precisely while it is still waiting out its timers. GoatAi.initMemories fills both on spawn.
The happy ghast's panic activity has no behaviors at all. It exists so that IS_PANICKING suppresses every idle behavior while the core activity's AnimalPanic flies the ghast away.
The frog splits one wander three ways. idle, swim and lay_spawn do nearly the same thing and are told apart by IS_IN_WATER, IS_PREGNANT and LONG_JUMP_MID_JUMP. None of those three has a Bedrock equivalent.
The warden never gives up on an unreachable target. Its StopAttackingIfTargetInvalid is built with canGrowTiredOfTryingToReachTarget false, where every other mob drops a target it has not reached in 200 ticks.
The creaking's activity choice is overridden outside the table. CreakingAi.updateActivity falls back to the default activity whenever the creaking cannot move, which is how a watched creaking freezes mid-chase.
The zoglin has no <Mob>Ai class. Its three activities are static methods on Zoglin itself, which is why a scan for *Ai.class finds nineteen files for twenty mobs.
The villager schedule
The villager is the only brain mob with a schedule, and in 26.1 Mojang moved it out of code into the minecraft:timeline datapack type. VILLAGER_SCHEDULE and BABY_VILLAGER_SCHEDULE are the two tracks of data/minecraft/timeline/villager_schedule.json.
| Tick | Adult | Baby |
|---|---|---|
| 10 | idle | idle |
| 2000 | work | |
| 3000 | play | |
| 6000 | idle | |
| 9000 | meet | |
| 10000 | play | |
| 11000 | idle | |
| 12000 | rest | rest |
Brain.updateActivityFromSchedule reads the schedule at most once every twenty ticks, which is Brain.SCHEDULE_UPDATE_DELAY. The throttle is observable: a villager crossing a keyframe can take up to a second to notice.
The warden's anger
AngerManagement is per-suspect anger that decays by one a tick, clamped at 150, with three bands at 0, 40 and 80. A plain disturbance adds 35, so it takes three to make a warden angry. A projectile adds 10. Being hit adds ANGRY's minimum plus 20.
The sort is the part worth reading. A suspect the warden is already angry at outranks one it is not, a player outranks a non-player in the same band, and only then does the raw anger decide. That is why a warden chases the player who poked it rather than the skeleton that shot it, even when the skeleton has more anger.
Anger is not a memory and does not live in the brain. A host owns the AngerManagement and passes it to makeWardenBrain, because the anger outlives any one brain.
The piglin's gold economy
wantsToPickUp is the rule, and reading it in order is the clearest statement of the economy. Repellents are never picked up. A baby skips the items in #minecraft:ignored_by_piglin_babies. A gold ingot is taken only when the off hand is free. Food is taken only when the piglin has not eaten recently. Anything else goes by whether it beats what the piglin already holds.
Being handed a gold ingot holds ADMIRING_ITEM for 119 ticks, which is ADMIRE_DURATION, and that memory is what puts the piglin into the admire_item activity. onBarter is the hook makePiglinBrain takes so the host can roll its data-defined barter table after admiration ends.
Four memories decide what admiring does, and none of them has a Bedrock equivalent: ADMIRING_ITEM, TIME_TRYING_TO_REACH_ADMIRE_ITEM, DISABLE_WALK_TO_ADMIRE_ITEM and ADMIRING_DISABLED. The third is the interesting one. A piglin that spends 200 ticks failing to reach an item gives up and refuses to path to one for another 200, but still wants an item that lands in front of it.
The BrainWorld seam
Java's behaviors reach straight into ServerLevel, Mob, PathNavigation and PoiManager. This package keeps none of those. Everything a behavior or a sensor needs from outside the brain arrives through three interfaces in src/world.ts.
BrainWorld is the level: the clock, the random source, the entities and items nearby, the targeting tests, blocks and block tags, a block search, points of interest with claim and release, a random reachable position, sounds and game events.
BrainMob is the body: its brain, its navigation, a condition writer, look, jump, attack, a sound, and an attribute lookup.
BrainNavigation is path following: moveTo, isDone, isStuck, canReach and stop. This is deliberately this package's own interface and not an import. @jsprismarine/entity-goals owns the 170 Bedrock goals and an A* path finder over its own NavigationView, and a server satisfies both interfaces with one adapter over that finder. Depending on entity-goals here would make the brain system wait on the goal system, and the two are independent.
Two members do more work than their size suggests. BrainWorld.randomPos stands in for Java's whole ai/util tree, nine classes (LandRandomPos, AirRandomPos, AirAndWaterRandomPos, DefaultRandomPos, HoverRandomPos and their helpers) whose only job is to draw a reachable position subject to a medium and a direction. BrainEntity.conditions is a string set that answers every boolean fact Java reads off a concrete mob class, such as Armadillo::isScared or Camel::refuseToMove; EntityCondition names the ones this package reads. That mirrors how @jsprismarine/entities keeps its filter view small, and it means a host that cannot answer a fact simply leaves it out.
The test double
src/testWorld.ts carries TestWorld, TestMob, TestEntity, TestItemEntity and TestNavigation. It is a real implementation, not a mock: entities, blocks, points of interest and the clock are plain data a test writes, and every member answers from that data. Tests script the random source rather than seeding it, so a draw is a fact of the test.
const world = new TestWorld({ dayTime: 2000 });
world.addPoi({ x: 2, y: 64, z: 0 }, 'minecraft:farmer');
const body = world.spawn('minecraft:villager', { x: 0, y: 64, z: 0 });
body.attach(VILLAGER_BRAIN.makeBrain({ variant: 'minecraft:farmer' }));
VILLAGER_BRAIN.updateActivity(body.context);
body.tickBrain();TestNavigation records every moveTo and lets a test mark a position unreachable, which is how the CANT_REACH_WALK_TARGET_SINCE path is exercised without a path finder.
What is covered and what is partial
The brain core, the activity stack, the memory model, the combinators and all 24 sensors are complete. All twenty mobs have their real activity table, their real priorities, their real memory conditions and their real constants, and the brain runs them.
The behavior library is 37 shared behaviors in src/behavior/common.ts plus the mob-specific ones beside each mob. A behavior whose effect is expressible through the seam is implemented in full. The rest keep their real name, their real memory conditions and their real constants, and they do the memory bookkeeping Java does, while leaving the world effect to the host. Those are the behaviors that need facts the seam deliberately does not carry.
- Inventories and items. The allay's delivery needs its inventory, and the copper golem's transfer needs two containers. Piglin bartering uses
makePiglinBrain'sonBarterhook so the host can roll the activeminecraft:bartertable; the allay and copper golem write their memories and leave the item move to the host. - Block effects. The frog's
TryLaySpawnOnFluidNearLandleaves block placement to the host. The sniffer checksminecraft:sniffer_diggable_block, drops Java's digging loot after 120 ticks, and remembers a position only after a successful dig. Java does not change the block. - Damage and projectiles. The warden fires its sonic boom after a 34-tick windup. The host applies 10
sonic_boomdamage, which bypasses armor and armor enchantments, then applies the 15-by-20-block range and resistance-scaled knockback. The breeze's wind charge still leaves its projectile effect to the host. - Villager professions and trading.
VillagerProfessioncarries only what the brain reads: the profession id, its job-site point of interest and its secondary blocks. The brain decides when a villager works and the host does the work throughBrainWorld.villagerTask: baking bread and composting at a composter (WorkAtComposter, as aWorkAtPoiat a composter block), harvesting, sowing and bone-mealing crops (HarvestFarmland,UseBonemeal, farmers only, throughvillagerWorkSpot), sharing food and wheat (TradeWithVillager), thanking a hero (GiveGiftToHero) and having a child (VillagerMakeLove).WorkAtPoialso asks the host to restock the villager's trades. The trades themselves belong to@jsprismarine/trading.ShowTradesToPlayercycles the items of its trades in the villager's hand throughvillagerShowTrade. - Raids. The villager brain reads raid status from its host and requests bell, sky-seeking, celebration, and reset effects through that seam. The host still owns raid creation, waves, and victory state; this server does not start pillager patrols or village raids.
- Poses and animations. A behavior that sets a pose in Java writes an
EntityConditionhere instead, so a host can drive its own animation state.
Two deliberate simplifications are worth naming. AnimalMakeLove writes only the body's own BREED_TARGET, because a partner is a BrainEntity view rather than a second brain; a host that wants Java's symmetric pairing writes the partner's memory itself. GoToWantedItem always declares WALK_TARGET as registered and refuses in its body when a walk is already running, where Java picks registered or absent from its interruptOngoingWalk argument; the behavior is the same and it keeps one builder chain instead of two with different accessor shapes.
Tests
The tests cover the memory expiry rule and the precondition map, the activity stack and the schedule throttle, each combinator, each of the 24 sensors against the world double, and one representative situation for each of the twenty mobs: an idle villager going to work at tick 2000 and staying idle without a job site, a piglin holding ADMIRING_ITEM for 119 ticks when given gold, a warden escalating through 0, 40 and 80, a frog targeting a slime and switching to tongue, and the camel and the happy ghast ticking their brain beside a goal scheduler double.
Where a constant matters, the test title or a comment names it and says where it came from.
pnpm --filter @jsprismarine/entity-brains exec vitest runClasses
- AdultSensor
- AdultSensorAnyType
- AngerManagement
- AxolotlAttackablesSensor
- Behavior
- BehaviorBuilder
- Brain
- BrainMobRegistry
- BreezeAttackEntitySensor
- DoNothing
- DummySensor
- FrogAttackablesSensor
- GateBehavior
- GolemSensor
- HoglinSpecificSensor
- HurtBySensor
- IsInWaterSensor
- MemorySlot
- MobSensor
- NearestBedSensor
- NearestItemSensor
- NearestLivingEntitySensor
- NearestVisibleLivingEntitySensor
- OneShot
- PiglinBruteSpecificSensor
- PiglinSpecificSensor
- PlayerSensor
- RunOne
- SecondaryPoiSensor
- Sensor
- ShufflingList
- TemptingSensor
- TestEntity
- TestItemEntity
- TestMob
- TestNavigation
- TestWorld
- VillagerBabiesSensor
- VillagerHostilesSensor
- WardenEntitySensor
Interfaces
Activity
Defined in: activity.ts:9
An activity. Equality is by name, as Java's Activity.equals is.
Properties
name
readonlyname:string
Defined in: activity.ts:11
The registered name without its namespace, such as admire_item.
ActivityData
Defined in: brain.ts:30
One activity's entry in a mob's brain. Java's ActivityData.
conditions gate whether Brain.setActiveActivityIfPossible will choose the activity. An empty set passes, so a registered activity with no conditions is always available; it is an activity the mob never registered at all that is refused.
Properties
activity
readonlyactivity:Activity
Defined in: brain.ts:31
behaviors
readonlybehaviors: readonlyPrioritizedBehavior[]
Defined in: brain.ts:32
conditions
readonlyconditions: readonlyActivityCondition[]
Defined in: brain.ts:33
memoriesToEraseWhenStopped
readonlymemoriesToEraseWhenStopped: readonlyMemoryModuleType<unknown>[]
Defined in: brain.ts:35
Erased when the brain leaves the activity. Java's memoriesToEraseWhenStopped.
ActivityDataOptions
Defined in: brain.ts:44
Options for activityData beyond the behavior list.
Properties
conditions?
readonlyoptionalconditions?: readonlyActivityCondition[]
Defined in: brain.ts:45
gatedBy?
readonlyoptionalgatedBy?:MemoryModuleType<unknown>
Defined in: brain.ts:51
The shorthand Java spells ActivityData.create(activity, priority, list, memory): the memory must be present for the activity to start and is erased when it stops.
memoriesToEraseWhenStopped?
readonlyoptionalmemoriesToEraseWhenStopped?: readonlyMemoryModuleType<unknown>[]
Defined in: brain.ts:46
AnimalPanicOptions
Defined in: behavior/common.ts:95
Options for animalPanic.
Properties
extraStartConditions?
readonlyoptionalextraStartConditions?: (context) =>boolean
Defined in: behavior/common.ts:100
Parameters
context
Returns
boolean
flyHeight?
readonlyoptionalflyHeight?:number
Defined in: behavior/common.ts:99
When set, the mob flees through the air at this height offset, as the happy ghast does.
onStart?
readonlyoptionalonStart?: (context) =>void
Defined in: behavior/common.ts:101
Parameters
context
Returns
void
panicCausingDamageTypes?
readonlyoptionalpanicCausingDamageTypes?:string
Defined in: behavior/common.ts:97
The damage type tag that triggers a panic. Defaults to minecraft:panic_causes.
BehaviorControl
Defined in: behavior/control.ts:33
Anything the brain can run. Java's BehaviorControl.
The brain only ever calls BehaviorControl.tryStart on a stopped behavior and BehaviorControl.tickOrStop on a running one, so an implementation may rely on the lifecycle being tryStart then zero or more tickOrStop then doStop.
Properties
name
readonlyname:string
Defined in: behavior/control.ts:35
The Java class name, which is what a debug read-out shows.
requiredMemories
readonlyrequiredMemories: readonlyMemoryModuleType<unknown>[]
Defined in: behavior/control.ts:41
Every memory the behavior reads or writes. The brain registers each one when the behavior is added, which is how a memory a mob never declares still gets a slot.
status
readonlystatus:BehaviorStatus
Defined in: behavior/control.ts:36
Methods
doStop()
doStop(
context,timestamp):void
Defined in: behavior/control.ts:47
Stops a running behavior.
Parameters
context
timestamp
number
Returns
void
tickOrStop()
tickOrStop(
context,timestamp):void
Defined in: behavior/control.ts:45
Advances a running behavior, or stops it when it timed out or can no longer be used.
Parameters
context
timestamp
number
Returns
void
tryStart()
tryStart(
context,timestamp):boolean
Defined in: behavior/control.ts:43
Runs the entry conditions and starts the behavior; returns whether it started.
Parameters
context
timestamp
number
Returns
boolean
BehaviorDuration
Defined in: behavior/control.ts:64
How long a Behavior may run before it times out.
Properties
maxDuration
readonlymaxDuration:number
Defined in: behavior/control.ts:66
minDuration
readonlyminDuration:number
Defined in: behavior/control.ts:65
BehaviorHooks
Defined in: behavior/control.ts:51
The hooks a Behavior subclass overrides.
Methods
canStillUse()?
optionalcanStillUse(context,timestamp):boolean
Defined in: behavior/control.ts:58
Java's canStillUse, which defaults to false, so a behavior runs one tick unless it says so.
Parameters
context
timestamp
number
Returns
boolean
checkExtraStartConditions()?
optionalcheckExtraStartConditions(context):boolean
Defined in: behavior/control.ts:53
Java's checkExtraStartConditions, run after the memory conditions pass.
Parameters
context
Returns
boolean
start()?
optionalstart(context,timestamp):void
Defined in: behavior/control.ts:54
Parameters
context
timestamp
number
Returns
void
stop()?
optionalstop(context,timestamp):void
Defined in: behavior/control.ts:56
Parameters
context
timestamp
number
Returns
void
tick()?
optionaltick(context,timestamp):void
Defined in: behavior/control.ts:55
Parameters
context
timestamp
number
Returns
void
timedOut()?
optionaltimedOut(timestamp):boolean
Defined in: behavior/control.ts:60
Java's timedOut. CountDownCooldownTicks is the one vanilla behavior that overrides it.
Parameters
timestamp
number
Returns
boolean
BlockPos
Defined in: world.ts:63
A whole-block position. Java's BlockPos.
Properties
x
readonlyx:number
Defined in: world.ts:64
y
readonlyy:number
Defined in: world.ts:65
z
readonlyz:number
Defined in: world.ts:66
BrainContext
Defined in: world.ts:384
Everything one brain tick needs. Every behavior and sensor takes exactly this.
Properties
body
readonlybody:BrainMob
Defined in: world.ts:386
world
readonlyworld:BrainWorld
Defined in: world.ts:385
BrainDamageSource
Defined in: memory.ts:31
The part of Java's DamageSource that HurtBySensor and the panic behaviors read.
Properties
entity?
readonlyoptionalentity?:BrainEntity
Defined in: memory.ts:37
The entity that caused the damage, when there was one.
tags
readonlytags:ReadonlySet<string>
Defined in: memory.ts:35
Every damage type tag, such as minecraft:panic_environmental_causes.
type
readonlytype:string
Defined in: memory.ts:33
The damage type id, such as minecraft:lava.
BrainDefinition
Defined in: brain.ts:97
How a brain is built: its extra memories, its sensors and its activity table.
Properties
activities
readonlyactivities: readonlyActivityData[]
Defined in: brain.ts:104
coreActivities?
readonlyoptionalcoreActivities?: readonlyActivity[]
Defined in: brain.ts:107
Defaults to core, which is what every vanilla brain uses.
defaultActivity?
readonlyoptionaldefaultActivity?:Activity
Defined in: brain.ts:109
Defaults to idle, as Java's field initializer does.
memories?
readonlyoptionalmemories?: readonlyMemoryModuleType<unknown>[]
Defined in: brain.ts:102
Memories the mob keeps that no sensor and no behavior declares. Java calls this overload of Brain.provider deprecated but eight of the twenty mobs still use it.
schedule?
readonlyoptionalschedule?:Schedule
Defined in: brain.ts:105
sensors
readonlysensors: readonlySensor[]
Defined in: brain.ts:103
BrainEntity
Defined in: world.ts:200
An entity as a brain sees it. Sensors build memories out of these and behaviors read them back, so this is the only entity shape the package knows.
Extended by
Properties
alive
readonlyalive:boolean
Defined in: world.ts:212
armorItems?
readonlyoptionalarmorItems?: readonlyBrainItem[]
Defined in: world.ts:221
baby
readonlybaby:boolean
Defined in: world.ts:213
conditions
readonlyconditions:EntityConditions
Defined in: world.ts:218
See EntityConditions.
dimensions?
readonlyoptionaldimensions?:EntityDimensions
Defined in: world.ts:209
Its Java collision box, when the host can provide it.
eyePosition?
readonlyoptionaleyePosition?:Vec3
Defined in: world.ts:211
Where its eyes are, when the world can provide that detail.
id
readonlyid:string
Defined in: world.ts:202
A stable identity, used wherever Java stores a UUID in a memory.
mainHandItem?
readonlyoptionalmainHandItem?:BrainItem
Defined in: world.ts:219
offHandItem?
readonlyoptionaloffHandItem?:BrainItem
Defined in: world.ts:220
position
readonlyposition:Vec3
Defined in: world.ts:207
spectator
readonlyspectator:boolean
Defined in: world.ts:214
type
readonlytype:string
Defined in: world.ts:204
The entity type id, such as minecraft:piglin.
typeTags
readonlytypeTags:ReadonlySet<string>
Defined in: world.ts:206
The entity type tags, such as minecraft:axolotl_hunt_targets.
Methods
canBeTargeted()?
optionalcanBeTargeted():boolean
Defined in: world.ts:216
A live check for whether combat AI may choose this entity as a target.
Returns
boolean
BrainItem
Defined in: world.ts:125
An item as a brain reads it. Brains only ever ask whether an item is in a tag or which item it is, never about its components, so this stays to two fields.
Properties
id
readonlyid:string
Defined in: world.ts:127
The item id, such as minecraft:gold_ingot.
tags
readonlytags:ReadonlySet<string>
Defined in: world.ts:129
Every item tag the item is in, such as minecraft:piglin_loved.
BrainItemEntity
Defined in: world.ts:133
An item lying on the ground, as NearestItemSensor reads it.
Extends
Properties
alive
readonlyalive:boolean
Defined in: world.ts:212
Inherited from
armorItems?
readonlyoptionalarmorItems?: readonlyBrainItem[]
Defined in: world.ts:221
Inherited from
baby
readonlybaby:boolean
Defined in: world.ts:213
Inherited from
conditions
readonlyconditions:EntityConditions
Defined in: world.ts:218
See EntityConditions.
Inherited from
count
readonlycount:number
Defined in: world.ts:135
dimensions?
readonlyoptionaldimensions?:EntityDimensions
Defined in: world.ts:209
Its Java collision box, when the host can provide it.
Inherited from
eyePosition?
readonlyoptionaleyePosition?:Vec3
Defined in: world.ts:211
Where its eyes are, when the world can provide that detail.
Inherited from
id
readonlyid:string
Defined in: world.ts:202
A stable identity, used wherever Java stores a UUID in a memory.
Inherited from
item
readonlyitem:BrainItem
Defined in: world.ts:134
mainHandItem?
readonlyoptionalmainHandItem?:BrainItem
Defined in: world.ts:219
Inherited from
offHandItem?
readonlyoptionaloffHandItem?:BrainItem
Defined in: world.ts:220
Inherited from
position
readonlyposition:Vec3
Defined in: world.ts:207
Inherited from
spectator
readonlyspectator:boolean
Defined in: world.ts:214
Inherited from
type
readonlytype:string
Defined in: world.ts:204
The entity type id, such as minecraft:piglin.
Inherited from
typeTags
readonlytypeTags:ReadonlySet<string>
Defined in: world.ts:206
The entity type tags, such as minecraft:axolotl_hunt_targets.
Inherited from
Methods
canBeTargeted()?
optionalcanBeTargeted():boolean
Defined in: world.ts:216
A live check for whether combat AI may choose this entity as a target.
Returns
boolean
Inherited from
BrainMob
Defined in: world.ts:241
The body a brain drives.
Extends
Properties
alive
readonlyalive:boolean
Defined in: world.ts:212
Inherited from
armorItems?
readonlyoptionalarmorItems?: readonlyBrainItem[]
Defined in: world.ts:221
Inherited from
baby
readonlybaby:boolean
Defined in: world.ts:213
Inherited from
brain
readonlybrain:Brain
Defined in: world.ts:242
conditions
readonlyconditions:EntityConditions
Defined in: world.ts:218
See EntityConditions.
Inherited from
dimensions?
readonlyoptionaldimensions?:EntityDimensions
Defined in: world.ts:209
Its Java collision box, when the host can provide it.
Inherited from
eyePosition?
readonlyoptionaleyePosition?:Vec3
Defined in: world.ts:211
Where its eyes are, when the world can provide that detail.
Inherited from
id
readonlyid:string
Defined in: world.ts:202
A stable identity, used wherever Java stores a UUID in a memory.
Inherited from
mainHandItem?
readonlyoptionalmainHandItem?:BrainItem
Defined in: world.ts:219
Inherited from
navigation
readonlynavigation:BrainNavigation
Defined in: world.ts:243
offHandItem?
readonlyoptionaloffHandItem?:BrainItem
Defined in: world.ts:220
Inherited from
position
readonlyposition:Vec3
Defined in: world.ts:207
Inherited from
spectator
readonlyspectator:boolean
Defined in: world.ts:214
Inherited from
type
readonlytype:string
Defined in: world.ts:204
The entity type id, such as minecraft:piglin.
Inherited from
typeTags
readonlytypeTags:ReadonlySet<string>
Defined in: world.ts:206
The entity type tags, such as minecraft:axolotl_hunt_targets.
Inherited from
Methods
attack()
attack(
target):void
Defined in: world.ts:251
Java's Mob::doHurtTarget, with the swing.
Parameters
target
Returns
void
attribute()
attribute(
attribute):number
Defined in: world.ts:255
An attribute value, such as minecraft:follow_range or minecraft:tempt_range.
Parameters
attribute
string
Returns
number
canBeTargeted()?
optionalcanBeTargeted():boolean
Defined in: world.ts:216
A live check for whether combat AI may choose this entity as a target.
Returns
boolean
Inherited from
jump()
jump():
void
Defined in: world.ts:249
Java's JumpControl::jump.
Returns
void
lookAt()
lookAt(
position):void
Defined in: world.ts:247
Java's LookControl::setLookAt.
Parameters
position
Returns
void
playSound()
playSound(
sound):void
Defined in: world.ts:253
Java's Entity::playSound, by sound event id.
Parameters
sound
string
Returns
void
setCondition()
setCondition(
condition,value):void
Defined in: world.ts:245
Writes one of the EntityCondition flags back, as Mob::setAggressive does.
Parameters
condition
string
value
boolean
Returns
void
BrainMobDefinition
Defined in: registry.ts:27
One mob's brain. Java's <Mob>Ai class plus the brainProvider field on the mob.
Properties
alsoRunsGoals
readonlyalsoRunsGoals:boolean
Defined in: registry.ts:40
Whether the mob also runs the Bedrock goal scheduler.
Two do: Camel and HappyGhast carry both registerGoals and brainProvider. Everything else is one system or the other.
id
readonlyid:string
Defined in: registry.ts:29
The entity type id, such as minecraft:piglin.
memories
readonlymemories: readonlyMemoryModuleType<unknown>[]
Defined in: registry.ts:31
The memory types the mob declares beyond the ones its sensors and behaviors require.
sensorTypes
readonlysensorTypes: readonly ("dummy"|"nearest_players"|"nearest_bed"|"hurt_by"|"is_in_water"|"nearest_items"|"nearest_living_entities"|"villager_hostiles"|"villager_babies"|"secondary_pois"|"golem_detected"|"armadillo_scare_detected"|"piglin_specific_sensor"|"piglin_brute_specific_sensor"|"hoglin_specific_sensor"|"nearest_adult"|"nearest_adult_any_type"|"axolotl_attackables"|"food_temptations"|"frog_temptations"|"nautilus_temptations"|"frog_attackables"|"warden_entity_sensor"|"breeze_attack_entity_sensor")[]
Defined in: registry.ts:33
The sensor types the mob registers, in Java's order.
Methods
initMemories()?
optionalinitMemories(context):void
Defined in: registry.ts:44
Java's <Mob>Ai.initMemories, run once when the mob is first placed in the world.
Parameters
context
Returns
void
makeBrain()
makeBrain(
options?):Brain
Defined in: registry.ts:42
Builds the brain. Java's Brain.Provider.makeBrain.
Parameters
options?
Returns
updateActivity()
updateActivity(
context):void
Defined in: registry.ts:51
Java's <Mob>Ai.updateActivity, run from the mob's own tick before the brain ticks.
This is where the between-activity priority lives: the brain itself never chooses an activity, it only answers whether one is possible.
Parameters
context
Returns
void
BrainMobOptions
Defined in: registry.ts:14
What a host knows about a body before its brain exists.
Properties
baby?
readonlyoptionalbaby?:boolean
Defined in: registry.ts:16
A baby villager gets the play activity and the baby schedule instead of work.
onBarter?
readonlyoptionalonBarter?: (context) =>void
Defined in: registry.ts:23
Called when a piglin finishes admiring a barter item, so the host can roll its loot table.
Parameters
context
Returns
void
variant?
readonlyoptionalvariant?:string
Defined in: registry.ts:21
The mob's variant, where the brain depends on it. The villager reads its profession id here, which decides its job-site point of interest type and the weights in its work package.
BrainNavigation
Defined in: world.ts:225
Path following, the one capability a brain needs that @jsprismarine/entity-goals also owns.
Methods
canReach()
canReach(
target):boolean
Defined in: world.ts:236
Whether a path to the position exists without starting to follow it.
Parameters
target
Returns
boolean
isDone()
isDone():
boolean
Defined in: world.ts:232
Whether the current path is finished or was never started.
Returns
boolean
isStuck()
isStuck():
boolean
Defined in: world.ts:234
Whether the mob has stopped making progress along its path.
Returns
boolean
moveTo()
moveTo(
target,speedModifier):boolean
Defined in: world.ts:230
Starts walking to a position. Returns false when no path exists, which is what makes MoveToTargetSink record CANT_REACH_WALK_TARGET_SINCE.
Parameters
target
speedModifier
number
Returns
boolean
stop()
stop():
void
Defined in: world.ts:237
Returns
void
BrainPath
Defined in: memory.ts:25
A path as a brain stores it. Java keeps the whole Path in MemoryModuleType.PATH; a brain only ever asks whether it reaches and where it ends, so that is all this carries.
Properties
target
readonlytarget:BlockPos
Defined in: memory.ts:26
Methods
canReach()
canReach():
boolean
Defined in: memory.ts:27
Returns
boolean
BrainWorld
Defined in: world.ts:286
The level a brain reads.
Properties
dimension
readonlydimension:string
Defined in: world.ts:288
The dimension id, used to qualify a GlobalPos.
Methods
blockAt()
blockAt(
pos):string
Defined in: world.ts:323
The block id at a position, such as minecraft:note_block.
Parameters
pos
Returns
string
blockTagsAt()
blockTagsAt(
pos):ReadonlySet<string>
Defined in: world.ts:327
Every block tag at a position, such as minecraft:piglin_repellents.
Parameters
pos
Returns
ReadonlySet<string>
canSee()
canSee(
body,target):boolean
Defined in: world.ts:309
Whether body can see target, Java's Mob::hasLineOfSight.
Parameters
body
target
Returns
boolean
canStandAt()
canStandAt(
position):boolean
Defined in: world.ts:339
Whether Java would accept this position as a dry place to stand.
Parameters
position
Returns
boolean
claimPoi()
claimPoi(
pos,claimant):boolean
Defined in: world.ts:345
Takes a ticket on a point of interest; false when it had no space left.
Parameters
pos
claimant
Returns
boolean
dayTime()
dayTime():
number
Defined in: world.ts:292
Java's ServerLevel::getDayTime: ticks into the current day, wrapped to the day length.
Returns
number
dropSnifferSeed()
dropSnifferSeed(
body):void
Defined in: world.ts:355
Rolls and drops the sniffer's seed loot at its head.
Parameters
body
Returns
void
emitGameEvent()
emitGameEvent(
event,pos,source?):void
Defined in: world.ts:351
Emits a game event at a position, which is what a warden's vibration listener hears.
Parameters
event
string
pos
source?
Returns
void
findBlock()
findBlock(
center,xzRange,yRange,test):BlockPos|undefined
Defined in: world.ts:332
Java's Level::findBlocksInBoxByManhattanDistance: the nearest block in the box around center whose tag set or id satisfies test.
Parameters
center
xzRange
number
yRange
number
test
(block, tags, position) => boolean
Returns
BlockPos | undefined
gameTime()
gameTime():
number
Defined in: world.ts:290
Java's ServerLevel::getGameTime: ticks since the world was created.
Returns
number
isAttackable()
isAttackable(
body,target):boolean
Defined in: world.ts:319
Java's TargetingConditions.forCombat() test, which adds Mob::canAttack and the difficulty and game mode rules on top of BrainWorld.isTargetable.
Parameters
body
target
Returns
boolean
isTargetable()
isTargetable(
body,target):boolean
Defined in: world.ts:314
Java's TargetingConditions.forNonCombat() test: close enough, visible, and not excluded. Sensors call this for a look or follow target.
Parameters
body
target
Returns
boolean
isVillageHero()
isVillageHero(
player):boolean
Defined in: world.ts:378
Whether a player carries Hero of the Village, which is what makes a villager give gifts.
Parameters
player
Returns
boolean
isWaterAt()
isWaterAt(
pos):boolean
Defined in: world.ts:325
Whether the block at a position has Java's water fluid tag.
Parameters
pos
Returns
boolean
isWithinMeleeRange()
isWithinMeleeRange(
body,target):boolean
Defined in: world.ts:321
Java's Mob::isWithinMeleeAttackRange.
Parameters
body
target
Returns
boolean
itemEntitiesNear()
itemEntitiesNear(
center,xzRange,yRange): readonlyBrainItemEntity[]
Defined in: world.ts:307
Every dropped item within the given box half-extents of center.
Parameters
center
xzRange
number
yRange
number
Returns
readonly BrainItemEntity[]
livingEntitiesNear()
livingEntitiesNear(
center,radius,exclude,excludeDimensions?): readonlyBrainEntity[]
Defined in: world.ts:298
Every living entity whose box intersects exclude's box inflated by radius, nearest first.
Parameters
center
radius
number
exclude
excludeDimensions?
Returns
readonly BrainEntity[]
players()
players(): readonly
BrainEntity[]
Defined in: world.ts:305
Every player in the level, including ones far away; sensors filter by range themselves.
Returns
readonly BrainEntity[]
playSound()
playSound(
sound,pos):void
Defined in: world.ts:349
Plays a sound event at a position, for the behaviors whose whole effect is a sound.
Parameters
sound
string
pos
Returns
void
pointsOfInterest()
pointsOfInterest(
center,radius,type): readonlyPoiRecord[]
Defined in: world.ts:343
Java's PoiManager::findAll: points of interest of a type within radius of center.
Parameters
center
radius
number
type
(type) => boolean
Returns
readonly PoiRecord[]
random()
random():
number
Defined in: world.ts:294
A float in [0, 1).
Returns
number
randomInt()
randomInt(
bound):number
Defined in: world.ts:296
An integer in [0, bound).
Parameters
bound
number
Returns
number
randomPos()
randomPos(
body,request):Vec3|undefined
Defined in: world.ts:341
A reachable position matching the request, or undefined when the draw found none.
Parameters
body
request
Returns
Vec3 | undefined
releasePoi()
releasePoi(
pos,claimant):void
Defined in: world.ts:347
Releases a ticket taken by BrainWorld.claimPoi.
Parameters
pos
claimant
Returns
void
snifferDigPosition()
snifferDigPosition(
body):BlockPos|undefined
Defined in: world.ts:353
The block beneath the sniffer's head, or undefined when its host cannot resolve it.
Parameters
body
Returns
BlockPos | undefined
sonicBoom()
sonicBoom(
body,target):void
Defined in: world.ts:357
Deals the warden's sonic-boom damage and applies its target effect.
Parameters
body
target
Returns
void
villagerCanBreed()
villagerCanBreed(
body,partner):boolean
Defined in: world.ts:380
Whether two villagers are both willing and able to have a child now.
Parameters
body
partner
Returns
boolean
villagerRaidEffect()
villagerRaidEffect(
body,effect):void
Defined in: world.ts:361
Performs a world-owned effect requested by a villager raid behavior.
Parameters
body
effect
Returns
void
villagerRaidState()
villagerRaidState(
body):VillagerRaidState|undefined
Defined in: world.ts:359
Reads the active raid near a villager, if its host tracks one.
Parameters
body
Returns
VillagerRaidState | undefined
villagerRestock()
villagerRestock(
body):void
Defined in: world.ts:363
Restocks a villager's trades, as Java's Villager.restock does once it works at its job site.
Parameters
body
Returns
void
villagerShowTrade()
villagerShowTrade(
body,shown):void
Defined in: world.ts:376
Shows the next of a villager's trades in its hand, or empties the hand when shown is false. Java's ShowTradesToPlayer cycles the items of the villager's offers.
Parameters
body
shown
boolean
Returns
void
villagerTask()
villagerTask(
body,task,target?):boolean
Defined in: world.ts:371
Carries out a VillagerTask. target is the block or the entity the task is about.
Parameters
body
task
target?
Returns
boolean
Whether anything happened.
villagerWorkSpot()
villagerWorkSpot(
body,task):BlockPos|undefined
Defined in: world.ts:365
Where a farmer has farming to do near itself, or undefined when there is none.
Parameters
body
task
"harvest_farmland" | "use_bonemeal"
Returns
BlockPos | undefined
EntityBounds
Defined in: world.ts:30
An axis-aligned query box, with strict overlap matching Java's AABB.intersects.
Properties
max
readonlymax:Vec3
Defined in: world.ts:32
min
readonlymin:Vec3
Defined in: world.ts:31
EntityDimensions
Defined in: world.ts:22
The size of an entity's box, measured across and up from its feet.
Properties
height
readonlyheight:number
Defined in: world.ts:26
The height above the entity's position.
width
readonlywidth:number
Defined in: world.ts:24
The width across both horizontal axes.
GateOptions
Defined in: behavior/gate.ts:55
Options for GateBehavior.
Properties
entryCondition?
readonlyoptionalentryCondition?:MemoryConditions
Defined in: behavior/gate.ts:57
exitErasedMemories?
readonlyoptionalexitErasedMemories?: readonlyMemoryModuleType<unknown>[]
Defined in: behavior/gate.ts:59
Erased when the gate stops. Java's exitErasedMemories.
name?
readonlyoptionalname?:string
Defined in: behavior/gate.ts:56
GlobalPos
Defined in: world.ts:70
A block position qualified by its dimension. Java's GlobalPos.
Properties
dimension
readonlydimension:string
Defined in: world.ts:71
pos
readonlypos:BlockPos
Defined in: world.ts:72
MemoryModuleType
Defined in: memory.ts:78
A memory module type. The type parameter is the value the slot holds and is carried by MemoryModuleType.valueType, a declaration-only marker that never exists at runtime.
Type Parameters
Value
Value
Properties
name
readonlyname:string
Defined in: memory.ts:80
The registered name without its namespace, such as attack_target.
valueType?
readonlyoptionalvalueType?:Value
Defined in: memory.ts:82
Declaration-only: carries MemoryModuleType's value type. Always undefined.
MemoryWriter
Defined in: behavior/builder.ts:33
The writes every accessor allows. Java's MemoryAccessor.
Extended by
Type Parameters
Value
Value
Methods
erase()
erase():
void
Defined in: behavior/builder.ts:38
Returns
void
set()
set(
value):void
Defined in: behavior/builder.ts:34
Parameters
value
Value
Returns
void
setOrErase()
setOrErase(
value):void
Defined in: behavior/builder.ts:37
Writes the value, or erases the memory when it is undefined.
Parameters
value
Value | undefined
Returns
void
setWithExpiry()
setWithExpiry(
value,timeToLive):void
Defined in: behavior/builder.ts:35
Parameters
value
Value
timeToLive
number
Returns
void
MoveToTargetSinkOptions
Defined in: behavior/common.ts:198
Options for moveToTargetSink.
Properties
extraStartConditions?
readonlyoptionalextraStartConditions?: (context) =>boolean
Defined in: behavior/common.ts:202
Parameters
context
Returns
boolean
maxDuration?
readonlyoptionalmaxDuration?:number
Defined in: behavior/common.ts:201
minDuration?
readonlyoptionalminDuration?:number
Defined in: behavior/common.ts:200
Java's default is (150, 250); the sniffer uses (500, 700) and the breeze (20, 40).
onStart?
readonlyoptionalonStart?: (context) =>void
Defined in: behavior/common.ts:203
Parameters
context
Returns
void
onStop?
readonlyoptionalonStop?: (context) =>void
Defined in: behavior/common.ts:204
Parameters
context
Returns
void
NearestVisibleLivingEntities
Defined in: memory.ts:49
The visible slice of NEAREST_LIVING_ENTITIES, Java's NearestVisibleLivingEntities.
Java computes line of sight once per scan and caches it, so a behavior that asks for the closest entity matching a predicate pays for the predicate and not for the ray cast.
Methods
contains()
contains(
entity):boolean
Defined in: memory.ts:55
Whether the entity is in the visible set.
Parameters
entity
Returns
boolean
findAll()
findAll(
predicate): readonlyBrainEntity[]
Defined in: memory.ts:53
Every visible entity satisfying the predicate, nearest first.
Parameters
predicate
(entity) => boolean
Returns
readonly BrainEntity[]
findClosest()
findClosest(
predicate):BrainEntity|undefined
Defined in: memory.ts:51
The nearest entity satisfying the predicate, nearest first.
Parameters
predicate
(entity) => boolean
Returns
BrainEntity | undefined
PoiRecord
Defined in: world.ts:277
A claimed or free point of interest, as Java's PoiManager reports one.
Properties
hasSpace
readonlyhasSpace:boolean
Defined in: world.ts:282
Whether the point of interest still has a free ticket.
pos
readonlypos:BlockPos
Defined in: world.ts:278
type
readonlytype:string
Defined in: world.ts:280
The point of interest type id, such as minecraft:home.
PositionTracker
Defined in: world.ts:105
Java's PositionTracker: either a fixed block (BlockPosTracker) or a moving entity (EntityTracker). A walk or look target holds one of these rather than a bare position, which is what lets a mob keep following a target that moves.
Properties
entity?
readonlyoptionalentity?:BrainEntity
Defined in: world.ts:111
The entity being tracked, when the tracker follows one.
Methods
currentBlockPosition()
currentBlockPosition():
BlockPos
Defined in: world.ts:109
The block the tracker currently occupies.
Returns
currentPosition()
currentPosition():
Vec3
Defined in: world.ts:107
The position to aim at this tick.
Returns
PresentMemory
Defined in: behavior/builder.ts:42
An accessor for a memory the behavior required to be present.
Extends
MemoryWriter<Value>
Type Parameters
Value
Value
Methods
erase()
erase():
void
Defined in: behavior/builder.ts:38
Returns
void
Inherited from
get()
get():
Value
Defined in: behavior/builder.ts:43
Returns
Value
set()
set(
value):void
Defined in: behavior/builder.ts:34
Parameters
value
Value
Returns
void
Inherited from
setOrErase()
setOrErase(
value):void
Defined in: behavior/builder.ts:37
Writes the value, or erases the memory when it is undefined.
Parameters
value
Value | undefined
Returns
void
Inherited from
setWithExpiry()
setWithExpiry(
value,timeToLive):void
Defined in: behavior/builder.ts:35
Parameters
value
Value
timeToLive
number
Returns
void
Inherited from
RandomPosRequest
Defined in: world.ts:265
What BrainWorld.randomPos should look for.
This one member stands in for Java's whole ai/util tree: LandRandomPos, AirRandomPos, AirAndWaterRandomPos, DefaultRandomPos and HoverRandomPos, nine classes whose only job is to draw a reachable position subject to a medium and a direction.
Properties
away?
readonlyoptionalaway?:Vec3
Defined in: world.ts:271
Bias the draw away from this position. Java's getPosAway.
medium
readonlymedium:"land"|"air"|"water"
Defined in: world.ts:269
land is LandRandomPos, air is AirRandomPos, water is the swimmable draw.
towards?
readonlyoptionaltowards?:Vec3
Defined in: world.ts:273
Bias the draw towards this position. Java's getPosTowards.
xzRange
readonlyxzRange:number
Defined in: world.ts:266
yRange
readonlyyRange:number
Defined in: world.ts:267
RegisteredMemory
Defined in: behavior/builder.ts:50
An accessor for a memory the behavior required only to be registered.
Extends
MemoryWriter<Value>
Type Parameters
Value
Value
Methods
erase()
erase():
void
Defined in: behavior/builder.ts:38
Returns
void
Inherited from
set()
set(
value):void
Defined in: behavior/builder.ts:34
Parameters
value
Value
Returns
void
Inherited from
setOrErase()
setOrErase(
value):void
Defined in: behavior/builder.ts:37
Writes the value, or erases the memory when it is undefined.
Parameters
value
Value | undefined
Returns
void
Inherited from
setWithExpiry()
setWithExpiry(
value,timeToLive):void
Defined in: behavior/builder.ts:35
Parameters
value
Value
timeToLive
number
Returns
void
Inherited from
tryGet()
tryGet():
Value|undefined
Defined in: behavior/builder.ts:51
Returns
Value | undefined
Schedule
Defined in: brain.ts:79
A timetable mapping the time of day to an activity, the shape Java moved into the minecraft:timeline datapack type in 26.1.
Keyframes are sorted by tick; the activity in force is the last keyframe at or before the current day time, wrapping at periodTicks.
Properties
keyframes
readonlykeyframes: readonly (readonly [number,Activity])[]
Defined in: brain.ts:81
periodTicks
readonlyperiodTicks:number
Defined in: brain.ts:80
StopAttackingOptions
Defined in: behavior/common.ts:547
Options for stopAttackingIfTargetInvalid.
Properties
canGrowTired?
readonlyoptionalcanGrowTired?:boolean
Defined in: behavior/common.ts:552
Java's canGrowTiredOfTryingToReachTarget, true for every use but the warden's.
onTargetErased?
readonlyoptionalonTargetErased?: (context,target) =>void
Defined in: behavior/common.ts:550
Parameters
context
target
Returns
void
stopAttackingWhen?
readonlyoptionalstopAttackingWhen?: (context,target) =>boolean
Defined in: behavior/common.ts:549
An extra reason to drop the target.
Parameters
context
target
Returns
boolean
TestEntityOptions
Defined in: testWorld.ts:47
What a test says about an entity it places.
Properties
alive?
readonlyoptionalalive?:boolean
Defined in: testWorld.ts:51
armorItems?
readonlyoptionalarmorItems?: readonlyBrainItem[]
Defined in: testWorld.ts:59
attributes?
readonlyoptionalattributes?:Readonly<Record<string,number>>
Defined in: testWorld.ts:60
baby?
readonlyoptionalbaby?:boolean
Defined in: testWorld.ts:52
conditions?
readonlyoptionalconditions?: readonlystring[]
Defined in: testWorld.ts:56
creative?
readonlyoptionalcreative?:boolean
Defined in: testWorld.ts:54
dimensions?
readonlyoptionaldimensions?:EntityDimensions
Defined in: testWorld.ts:50
id?
readonlyoptionalid?:string
Defined in: testWorld.ts:48
mainHandItem?
readonlyoptionalmainHandItem?:BrainItem
Defined in: testWorld.ts:57
offHandItem?
readonlyoptionaloffHandItem?:BrainItem
Defined in: testWorld.ts:58
position?
readonlyoptionalposition?:Vec3
Defined in: testWorld.ts:49
spectator?
readonlyoptionalspectator?:boolean
Defined in: testWorld.ts:53
typeTags?
readonlyoptionaltypeTags?: readonlystring[]
Defined in: testWorld.ts:55
TestWorldOptions
Defined in: testWorld.ts:243
How a test sets up its world.
Properties
attackable?
readonlyoptionalattackable?: (body,target) =>boolean
Defined in: testWorld.ts:255
Whether a target is attackable. Defaults to anything alive that is not the body.
Parameters
body
target
Returns
boolean
dayTime?
readonlyoptionaldayTime?:number
Defined in: testWorld.ts:246
dimension?
readonlyoptionaldimension?:string
Defined in: testWorld.ts:244
gameTime?
readonlyoptionalgameTime?:number
Defined in: testWorld.ts:245
lineOfSight?
readonlyoptionallineOfSight?: (body,target) =>boolean
Defined in: testWorld.ts:253
Whether an entity can see another. Defaults to always.
Parameters
body
target
Returns
boolean
meleeRange?
readonlyoptionalmeleeRange?:number
Defined in: testWorld.ts:257
The melee reach, in blocks. Defaults to 2.
randomValues?
readonlyoptionalrandomValues?: readonlynumber[]
Defined in: testWorld.ts:251
The values BrainWorld.random returns, consumed in order and then repeating the last. Defaults to always returning 0.
villagerRaidState?
readonlyoptionalvillagerRaidState?:VillagerRaidState
Defined in: testWorld.ts:259
The raid state visible to villagers, when a test exercises raid activities.
UniformInt
Defined in: behavior/common.ts:25
A number drawn uniformly from an inclusive integer range. Java's UniformInt.
Properties
max
readonlymax:number
Defined in: behavior/common.ts:27
min
readonlymin:number
Defined in: behavior/common.ts:26
Vec3
Defined in: world.ts:15
A position in world space. Java's Vec3.
Properties
x
readonlyx:number
Defined in: world.ts:16
y
readonlyy:number
Defined in: world.ts:17
z
readonlyz:number
Defined in: world.ts:18
VillagerProfession
Defined in: mobs/villager.ts:112
What the brain needs to know about a villager profession.
Properties
id
readonlyid:string
Defined in: mobs/villager.ts:114
The profession id, such as minecraft:farmer.
jobSitePoi
readonlyjobSitePoi:string
Defined in: mobs/villager.ts:116
The point-of-interest type the profession works at, such as minecraft:farmer.
secondaryPoiBlocks
readonlysecondaryPoiBlocks:ReadonlySet<string>
Defined in: mobs/villager.ts:118
The blocks SecondaryPoiSensor looks for, such as farmland for the farmer.
VillagerRaidState
Defined in: world.ts:76
The raid facts Java's villager brain reads from its host raid manager.
Properties
betweenWaves
readonlybetweenWaves:boolean
Defined in: world.ts:80
The raid is between waves and its villagers should prepare for the next one.
hasStarted
readonlyhasStarted:boolean
Defined in: world.ts:78
At least one wave has spawned.
victory
readonlyvictory:boolean
Defined in: world.ts:82
The villagers won and may celebrate.
WalkTarget
Defined in: world.ts:115
Java's WalkTarget: where to walk, how fast, and how close counts as arrival.
Properties
closeEnoughDist
readonlycloseEnoughDist:number
Defined in: world.ts:118
speedModifier
readonlyspeedModifier:number
Defined in: world.ts:117
target
readonlytarget:PositionTracker
Defined in: world.ts:116
WardenAnger
Defined in: mobs/warden.ts:556
What a host must answer for a warden brain: its anger model, in the two forms the brain reads.
Methods
canTargetEntity()
canTargetEntity(
context,entity):boolean
Defined in: mobs/warden.ts:562
Java's Warden::canTargetEntity.
Parameters
context
entity
Returns
boolean
clearAnger()
clearAnger(
context,entity):void
Defined in: mobs/warden.ts:564
Java's Warden::clearAnger.
Parameters
context
entity
Returns
void
entityAngryAt()
entityAngryAt(
context):BrainEntity|undefined
Defined in: mobs/warden.ts:558
The suspect the warden is angry at, Java's Warden::getEntityAngryAt.
Parameters
context
Returns
BrainEntity | undefined
increaseAngerAt()?
optionalincreaseAngerAt(context,entity,amount):void
Defined in: mobs/warden.ts:566
Java's Warden::increaseAngerAt, which Roar calls with 20 and no sound.
Parameters
context
entity
amount
number
Returns
void
isAngry()
isAngry(
context):boolean
Defined in: mobs/warden.ts:560
Java's Warden::getAngerLevel().isAngry().
Parameters
context
Returns
boolean
Type Aliases
AbsentMemory
AbsentMemory<
Value> =MemoryWriter<Value>
Defined in: behavior/builder.ts:47
An accessor for a memory the behavior required to be absent.
Type Parameters
Value
Value
ActivityCondition
ActivityCondition = readonly [
MemoryModuleType<unknown>,MemoryStatus]
Defined in: brain.ts:18
A memory condition on an activity: the activity may start only while it holds.
AngerLevelName
AngerLevelName = typeof
ANGER_LEVELS[number]["name"]
Defined in: mobs/warden.ts:92
One of the three ANGER_LEVELS names.
BehaviorStatus
BehaviorStatus =
"stopped"|"running"
Defined in: behavior/control.ts:12
Java's Behavior.Status.
EntityConditionName
EntityConditionName = typeof
EntityCondition[keyof typeofEntityCondition]
Defined in: world.ts:194
One of the EntityCondition names.
EntityConditionWrite
EntityConditionWrite =
string
Defined in: behavior/common.ts:1132
The name of a condition flag a behavior writes back to the body.
EntityConditions
EntityConditions =
ReadonlySet<string>
Defined in: world.ts:147
The boolean facts about a mob that Java reads off the concrete mob class rather than off the brain, such as Armadillo::isScared or Camel::refuseToMove.
They live in one set rather than in one accessor each for the same reason @jsprismarine/entities keeps its filter view small: one member answers every one of them, and a host that cannot answer one simply leaves it out. EntityCondition names the ones this package reads.
EntityPredicate
EntityPredicate = (
entity,context) =>boolean
Defined in: behavior/common.ts:299
A predicate over an entity a sensor or a behavior is choosing between.
Parameters
entity
context
Returns
boolean
MemoryConditions
MemoryConditions =
ReadonlyMap<MemoryModuleType<unknown>,MemoryStatus>
Defined in: behavior/control.ts:15
The map of memory preconditions a behavior must satisfy before it may start.
MemoryStatus
MemoryStatus =
"value_present"|"value_absent"|"registered"
Defined in: memory.ts:97
Java's MemoryStatus, the three ways a behavior or an activity can depend on a memory.
value_present: registered and holding a value.value_absent: registered and empty.registered: registered, value or not. A behavior that writes a memory asks for this so the brain allocates the slot without requiring it to be filled first.
OrderPolicy
OrderPolicy =
"ordered"|"shuffled"
Defined in: behavior/gate.ts:46
Java's GateBehavior.OrderPolicy.
PrioritizedBehavior
PrioritizedBehavior = readonly [
priority:number,behavior:BehaviorControl]
Defined in: brain.ts:21
One behavior with the priority it holds inside its activity.
RunningPolicy
RunningPolicy =
"run_one"|"try_all"
Defined in: behavior/gate.ts:49
Java's GateBehavior.RunningPolicy.
SensorTypeName
SensorTypeName = typeof
SENSOR_TYPE_NAMES[number]
Defined in: sensing/sensors.ts:777
One of the 24 registered sensor type names.
SpearStatus
SpearStatus =
"charging"|"engaging"|"retreating"
Defined in: memory.ts:41
Java's SpearAttack.SpearStatus, the piglin spear state machine.
TargetFinder
TargetFinder = (
context) =>BrainEntity|undefined
Defined in: behavior/common.ts:514
Finds the entity a mob should attack, or nothing. Java's StartAttacking.TargetFinder.
Parameters
context
Returns
BrainEntity | undefined
Trigger
Trigger = (
context,timestamp) =>boolean
Defined in: behavior/control.ts:158
A trigger: a function run once that reports whether it did anything. Java's Trigger.
Everything built through BehaviorBuilder is one of these, which is most of Java's behavior library.
Parameters
context
timestamp
number
Returns
boolean
Unit
Unit = typeof
UNIT
Defined in: memory.ts:19
The type of UNIT.
VillagerRaidEffect
VillagerRaidEffect =
"ring_bell"|"move_to_sky_seeing_spot"|"celebrate_victory"|"reset_status"
Defined in: world.ts:86
A world effect requested by a villager raid behavior.
VillagerTask
VillagerTask =
"work_at_composter"|"harvest_farmland"|"use_bonemeal"|"trade_with_villager"|"give_gift_to_hero"|"make_love"
Defined in: world.ts:92
A piece of villager work whose effect belongs to the world: the brain decides when, the host changes blocks, inventories and entities.
WantsToPickUp
WantsToPickUp = (
item,context) =>boolean
Defined in: sensing/sensors.ts:102
Decides whether a mob wants to pick an item up. Java's Mob::wantsToPickUp.
Parameters
item
context
Returns
boolean
WeightedBehavior
WeightedBehavior = readonly [
behavior:BehaviorControl,weight:number]
Defined in: behavior/gate.ts:52
One entry of a gate's list.
WeightedTrigger
WeightedTrigger = readonly [
trigger:Trigger,weight:number]
Defined in: behavior/gate.ts:170
One entry of a triggerGate list.
Variables
ALLAY
constALLAY:object
Defined in: mobs/allay.ts:28
The named constants of AllayAi.
Type Declaration
closeEnoughToTarget
readonlycloseEnoughToTarget:4=4
distanceToWantedItem
readonlydistanceToWantedItem:32=32
giveItemTimeoutDuration
readonlygiveItemTimeoutDuration:20=20
itemPickupCooldownDuration
readonlyitemPickupCooldownDuration:60=60
maxLookDistance
readonlymaxLookDistance:6=6
noteblockRememberDistance
readonlynoteblockRememberDistance:1024=1024
The horizontal reach of GlobalPos::isCloseEnough for the liked note block.
speedWhenFollowingDepositTarget
readonlyspeedWhenFollowingDepositTarget:2.25=2.25
speedWhenIdling
readonlyspeedWhenIdling:1=1
speedWhenPanicking
readonlyspeedWhenPanicking:2.5=2.5
speedWhenRetrievingItem
readonlyspeedWhenRetrievingItem:1.75=1.75
timeToForgetNoteblock
readonlytimeToForgetNoteblock:600=600
tooFarFromTarget
readonlytooFarFromTarget:16=16
waitDuration
readonlywaitDuration:UniformInt
ALLAY_BRAIN
constALLAY_BRAIN:BrainMobDefinition
Defined in: mobs/allay.ts:193
The allay's registry entry. It keeps a liked player and a liked note block across ticks, and only ever picks idle.
ALL_ACTIVITIES
constALL_ACTIVITIES: readonlyActivity[]
Defined in: activity.ts:50
Every registered activity, in registration order.
ALL_MEMORY_MODULE_TYPES
constALL_MEMORY_MODULE_TYPES: readonlyMemoryModuleType<unknown>[]
Defined in: memory.ts:409
Every registered memory module type, in registration order.
ANGER_LEVELS
constANGER_LEVELS: readonly [{minimumAnger:0;name:"calm"; }, {minimumAnger:40;name:"agitated"; }, {minimumAnger:80;name:"angry"; }]
Defined in: mobs/warden.ts:85
Java's AngerLevel: three bands over the same integer.
ANGER_MANAGEMENT
constANGER_MANAGEMENT:object
Defined in: mobs/warden.ts:106
Java's AngerManagement.MAX_ANGER, CONVERSION_DELAY and DEFAULT_ANGER_DECREASE.
Type Declaration
conversionDelay
readonlyconversionDelay:2=2
defaultAngerDecrease
readonlydefaultAngerDecrease:1=1
maxAnger
readonlymaxAnger:150=150
ANIMAL_MAKE_LOVE
constANIMAL_MAKE_LOVE:object
Defined in: behavior/common.ts:788
Java's AnimalMakeLove.BREED_RANGE, MIN_DURATION and MAX_DURATION.
Type Declaration
breedRange
breedRange:
number=3
maxDuration
maxDuration:
number=110
minDuration
minDuration:
number=60
ARMADILLO
constARMADILLO:object
Defined in: mobs/armadillo.ts:39
The named constants of ArmadilloAi and ArmadilloAi.ArmadilloBallUp.
Type Declaration
adultFollowRange
readonlyadultFollowRange:UniformInt
babyCloseEnoughDist
readonlybabyCloseEnoughDist:1=1
ballUpStayInState
readonlyballUpStayInState:number
5 * TimeUtil.SECONDS_PER_MINUTE * 20, five minutes of staying balled up.
dangerDetectedRecentlyDangerThreshold
readonlydangerDetectedRecentlyDangerThreshold:75=75
Below this much time left on DANGER_DETECTED_RECENTLY, the armadillo unrolls.
defaultCloseEnoughDist
readonlydefaultCloseEnoughDist:2=2
peekTimer
readonlypeekTimer:UniformInt
scareMemoryTimeToLive
readonlyscareMemoryTimeToLive:number=ARMADILLO_SCARE_SENSOR.memoryTimeToLive
scareScanRate
readonlyscareScanRate:number=ARMADILLO_SCARE_SENSOR.scanRate
Java's SensorType.ARMADILLO_SCARE_DETECTED arguments.
speedWhenFollowingAdult
readonlyspeedWhenFollowingAdult:1.25=1.25
speedWhenIdling
readonlyspeedWhenIdling:1=1
speedWhenMakingLove
readonlyspeedWhenMakingLove:1=1
speedWhenPanicking
readonlyspeedWhenPanicking:2=2
speedWhenTempted
readonlyspeedWhenTempted:1.25=1.25
ticksDelayToDetermineIfDangerIsStillAround
readonlyticksDelayToDetermineIfDangerIsStillAround:5=5
ARMADILLO_BRAIN
constARMADILLO_BRAIN:BrainMobDefinition
Defined in: mobs/armadillo.ts:199
The armadillo's registry entry. Its fifth sensor is the scare scan that writes DANGER_DETECTED_RECENTLY, which is the memory panic runs on.
ARMADILLO_SCARE_SENSOR
constARMADILLO_SCARE_SENSOR:object
Defined in: sensing/sensors.ts:746
Java's Armadillo scare rules, the only MobSensor registration.
Type Declaration
memoryTimeToLive
memoryTimeToLive:
number=80
scanRate
scanRate:
number=5
AXOLOTL
constAXOLOTL:object
Defined in: mobs/axolotl.ts:41
The named constants of AxolotlAi.
Type Declaration
adultFollowRange
readonlyadultFollowRange:UniformInt
huntingCooldown
readonlyhuntingCooldown:2400=2400
AxolotlAi.updateActivity sets this after a fight ends.
meleeAttackCooldown
readonlymeleeAttackCooldown:20=20
playDeadTicks
readonlyplayDeadTicks:200=200
Axolotl.PLAY_DEAD_TICKS is set by the host when the axolotl is hurt in water.
speedOnLand
readonlyspeedOnLand:0.15=0.15
speedWhenChasingInWater
readonlyspeedWhenChasingInWater:0.6=0.6
speedWhenFollowingAdultInWater
readonlyspeedWhenFollowingAdultInWater:0.6=0.6
speedWhenIdlingInWater
readonlyspeedWhenIdlingInWater:0.5=0.5
speedWhenMakingLove
readonlyspeedWhenMakingLove:0.2=0.2
AXOLOTL_BRAIN
constAXOLOTL_BRAIN:BrainMobDefinition
Defined in: mobs/axolotl.ts:225
The axolotl's registry entry. updateActivity leaves an axolotl that is already playing dead alone, and stamps a hunting cooldown when one drops out of fight.
AXOLOTL_TARGET_DETECTION_DISTANCE
constAXOLOTL_TARGET_DETECTION_DISTANCE:8=8
Defined in: sensing/sensors.ts:301
Java's AxolotlAttackablesSensor.TARGET_DETECTION_DISTANCE, and its squared form.
Activities
constActivities:object
Defined in: activity.ts:19
The 26 entries of minecraft:activity in the 26.3 server jar, in registration order.
Type Declaration
ADMIRE_ITEM
readonlyADMIRE_ITEM:Activity
AVOID
readonlyAVOID:Activity
CELEBRATE
readonlyCELEBRATE:Activity
CORE
readonlyCORE:Activity
Always active alongside the current activity; never chosen by itself.
DIG
readonlyDIG:Activity
EMERGE
readonlyEMERGE:Activity
FIGHT
readonlyFIGHT:Activity
HIDE
readonlyHIDE:Activity
IDLE
readonlyIDLE:Activity
INVESTIGATE
readonlyINVESTIGATE:Activity
LAY_SPAWN
readonlyLAY_SPAWN:Activity
LONG_JUMP
readonlyLONG_JUMP:Activity
MEET
readonlyMEET:Activity
PANIC
readonlyPANIC:Activity
PLAY
readonlyPLAY:Activity
PLAY_DEAD
readonlyPLAY_DEAD:Activity
PRE_RAID
readonlyPRE_RAID:Activity
RAID
readonlyRAID:Activity
RAM
readonlyRAM:Activity
REST
readonlyREST:Activity
RIDE
readonlyRIDE:Activity
ROAR
readonlyROAR:Activity
SNIFF
readonlySNIFF:Activity
SWIM
readonlySWIM:Activity
TONGUE
readonlyTONGUE:Activity
WORK
readonlyWORK:Activity
BABY_VILLAGER_SCHEDULE
constBABY_VILLAGER_SCHEDULE:Schedule
Defined in: mobs/villager.ts:100
The baby track of the same timeline: play instead of work and meet.
BRAIN_MOBS
constBRAIN_MOBS: readonlyBrainMobDefinition[]
Defined in: mobs/index.ts:32
Every brain mob, in the order the research note lists them.
BREEZE
constBREEZE:object
Defined in: mobs/breeze.ts:33
The named constants of BreezeAi and the behaviors it composes.
Type Declaration
jumpCircleInnerRadius
readonlyjumpCircleInnerRadius:4=4
jumpCircleMiddleRadius
readonlyjumpCircleMiddleRadius:8=8
jumpCircleOuterRadius
readonlyjumpCircleOuterRadius:24=24
jumpInhalingTicks
readonlyjumpInhalingTicks:10=10
shootAfterSlideTicks
readonlyshootAfterSlideTicks:60=60
SlideToTargetSink.stop holds BREEZE_SHOOT for 60 ticks once a slide lands.
shootChargingTicks
readonlyshootChargingTicks:10=10
Shoot's three phases, in ticks.
shootCooldownTicks
readonlyshootCooldownTicks:20=20
shootRecoveringTicks
readonlyshootRecoveringTicks:5=5
shootTicks
readonlyshootTicks:5=5
slideTimeout
readonlyslideTimeout:object
new BreezeAi.SlideToTargetSink(20, 40): a much shorter sink than the usual (150, 250).
slideTimeout.maxDuration
readonlymaxDuration:40=40
slideTimeout.minDuration
readonlyminDuration:20=20
speedWhenSliding
readonlyspeedWhenSliding:0.6=0.6
ticksToRememberSeenTarget
readonlyticksToRememberSeenTarget:100=100
BREEZE_BRAIN
constBREEZE_BRAIN:BrainMobDefinition
Defined in: mobs/breeze.ts:257
The breeze's registry entry. BreezeAttackEntitySensor picks the target that fight shoots at.
CAMEL
constCAMEL:object
Defined in: mobs/camel.ts:37
The named constants of CamelAi.
Type Declaration
adultFollowRange
readonlyadultFollowRange:UniformInt
minimalPoseSeconds
readonlyminimalPoseSeconds:20=20
new CamelAi.RandomSitting(20): twenty seconds in the current pose before it may change.
speedWhenFollowingAdult
readonlyspeedWhenFollowingAdult:2.5=2.5
speedWhenIdling
readonlyspeedWhenIdling:2=2
speedWhenMakingLove
readonlyspeedWhenMakingLove:1=1
speedWhenPanicking
readonlyspeedWhenPanicking:4=4
speedWhenTempted
readonlyspeedWhenTempted:2.5=2.5
temptedCloseEnoughAdult
readonlytemptedCloseEnoughAdult:3.5=3.5
temptedCloseEnoughBaby
readonlytemptedCloseEnoughBaby:2.5=2.5
CAMEL_BRAIN
constCAMEL_BRAIN:BrainMobDefinition
Defined in: mobs/camel.ts:139
The camel's registry entry. alsoRunsGoals is true, so riding, leashing and breeding stay on the goal system.
COPPER_GOLEM
constCOPPER_GOLEM:object
Defined in: mobs/copperGolem.ts:25
The named constants of CopperGolemAi.
Type Declaration
destinationBlocks
readonlydestinationBlocks:Set<string>
gazeInterval
readonlygazeInterval:UniformInt
sourceBlockTag
readonlysourceBlockTag:"minecraft:copper_chests"='minecraft:copper_chests'
The source is #minecraft:copper_chests; the destination is a chest or a trapped chest.
speedWhenIdling
readonlyspeedWhenIdling:1=1
speedWhenPanicking
readonlyspeedWhenPanicking:1.5=1.5
tickToCloseContainer
readonlytickToCloseContainer:60=60
The tick at which TransportItemsBetweenContainers closes the chest again.
tickToPlayOnReachedSound
readonlytickToPlayOnReachedSound:9=9
tickToStartOnReachedInteraction
readonlytickToStartOnReachedInteraction:1=1
transportItemHorizontalSearchRadius
readonlytransportItemHorizontalSearchRadius:32=32
transportItemVerticalSearchRadius
readonlytransportItemVerticalSearchRadius:8=8
COPPER_GOLEM_BRAIN
constCOPPER_GOLEM_BRAIN:BrainMobDefinition
Defined in: mobs/copperGolem.ts:123
The copper golem's registry entry: two sensors, no starting memories, and idle as its only choice.
CREAKING
constCREAKING:object
Defined in: mobs/creaking.ts:34
The named constants of CreakingAi.
Type Declaration
activityBasePriority
readonlyactivityBasePriority:10=10
Both non-core activities start at priority 10, unusually for a brain mob.
gazeInterval
readonlygazeInterval:UniformInt
maxLookDistance
readonlymaxLookDistance:8=8
meleeAttackCooldown
readonlymeleeAttackCooldown:40=40
speedWhenFighting
readonlyspeedWhenFighting:1=1
speedWhenIdling
readonlyspeedWhenIdling:0.3=0.3
CREAKING_BRAIN
constCREAKING_BRAIN:BrainMobDefinition
Defined in: mobs/creaking.ts:101
The creaking's registry entry. updateActivity falls back to the default activity while the creaking cannot move, which is how a watched one freezes mid-chase.
DEFAULT_BEHAVIOR_DURATION
constDEFAULT_BEHAVIOR_DURATION:60=60
Defined in: behavior/control.ts:70
Java's Behavior.DEFAULT_DURATION.
DEFAULT_SCAN_RATE
constDEFAULT_SCAN_RATE:20=20
Defined in: sensing/sensor.ts:13
Java's Sensor.DEFAULT_SCAN_RATE.
DEFAULT_TARGETING_RANGE
constDEFAULT_TARGETING_RANGE:16=16
Defined in: sensing/sensor.ts:16
Java's Sensor.DEFAULT_TARGETING_RANGE, the range before minecraft:follow_range overrides it.
DUAL_SYSTEM_MOBS
constDUAL_SYSTEM_MOBS: readonlystring[]
Defined in: mobs/index.ts:61
The two mobs that carry both AI systems, registerGoals and brainProvider.
A server running @jsprismarine/entity-goals beside this package must run both schedulers for these two and neither system's alone.
EntityCondition
constEntityCondition:object
Defined in: world.ts:150
The EntityConditions members this package reads, with the Java accessor each mirrors.
Type Declaration
ACTIVE
readonlyACTIVE:"active"='active'
Creaking::isActive.
ADULT
readonlyADULT:"adult"='adult'
Piglin::isAdult negated, and AgeableMob::isBaby for the mobs that read it as a flag.
AGGRESSIVE
readonlyAGGRESSIVE:"aggressive"='aggressive'
Mob::isAggressive.
CAN_BE_HUNTED
readonlyCAN_BE_HUNTED:"can_be_hunted"='can_be_hunted'
Hoglin::canBeHunted.
CAN_BREED
readonlyCAN_BREED:"can_breed"='can_breed'
AgeableMob::canBreed.
CAN_DIG
readonlyCAN_DIG:"can_dig"='can_dig'
Sniffer::canDig.
CAN_MOVE
readonlyCAN_MOVE:"can_move"='can_move'
Creaking::canMove.
CAN_SNIFF
readonlyCAN_SNIFF:"can_sniff"='can_sniff'
Sniffer::canSniff.
DANCING
readonlyDANCING:"dancing"='dancing'
Piglin::isDancing.
IN_LOVE
readonlyIN_LOVE:"in_love"='in_love'
Animal::isInLove.
IN_WATER
readonlyIN_WATER:"in_water"='in_water'
Entity::isInWater.
LEASHED
readonlyLEASHED:"leashed"='leashed'
LivingEntity::isLeashed.
ON_FIRE
readonlyON_FIRE:"on_fire"='on_fire'
Entity::isOnFire, which is what makes a panicking animal look for water.
ON_GROUND
readonlyON_GROUND:"on_ground"='on_ground'
Entity::onGround.
PASSENGER
readonlyPASSENGER:"passenger"='passenger'
Entity::isPassenger.
REFUSE_TO_MOVE
readonlyREFUSE_TO_MOVE:"refuse_to_move"='refuse_to_move'
Camel::refuseToMove.
SCARED
readonlySCARED:"scared"='scared'
Armadillo::isScared.
SCREAMING
readonlySCREAMING:"screaming"='screaming'
Goat::isScreamingGoat.
SITTING
readonlySITTING:"sitting"='sitting'
Camel::isCamelSitting.
TAME
readonlyTAME:"tame"='tame'
TamableAnimal::isTame, and AbstractNautilus::isTame.
FOLLOW_RANGE_ATTRIBUTE
constFOLLOW_RANGE_ATTRIBUTE:"minecraft:follow_range"='minecraft:follow_range'
Defined in: sensing/sensors.ts:15
Java's Attributes.FOLLOW_RANGE, the range every untargeted sensor scans.
FROG
constFROG:object
Defined in: mobs/frog.ts:47
The named constants of FrogAi.
Type Declaration
findLandIdle
readonlyfindLandIdle:object
TryFindLand.create(6, 1.0F) in idle and TryFindLand.create(8, 1.5F) in swim.
findLandIdle.range
readonlyrange:6=6
findLandIdle.speed
readonlyspeed:1=1
findLandNearLiquid
readonlyfindLandNearLiquid:object
findLandNearLiquid.range
readonlyrange:8=8
findLandNearLiquid.speed
readonlyspeed:1=1
findLandSwim
readonlyfindLandSwim:object
findLandSwim.range
readonlyrange:8=8
findLandSwim.speed
readonlyspeed:1.5=1.5
frogspawn
readonlyfrogspawn:"minecraft:frogspawn"='minecraft:frogspawn'
maxJumpVelocityMultiplier
readonlymaxJumpVelocityMultiplier:3.5714288=3.5714288
maxLongJumpHeight
readonlymaxLongJumpHeight:2=2
maxLongJumpWidth
readonlymaxLongJumpWidth:4=4
preferJumpToTag
readonlypreferJumpToTag:"minecraft:frog_prefer_jump_to"='minecraft:frog_prefer_jump_to'
preferredBlockChance
readonlypreferredBlockChance:0.5=0.5
The LongJumpToPreferredBlock bias towards a preferred landing block.
speedInWater
readonlyspeedInWater:0.75=0.75
speedOnLand
readonlyspeedOnLand:1=1
speedWhenIdling
readonlyspeedWhenIdling:1=1
speedWhenPanicking
readonlyspeedWhenPanicking:2=2
speedWhenTempted
readonlyspeedWhenTempted:1.25=1.25
temptationTag
readonlytemptationTag:"minecraft:frog_food"='minecraft:frog_food'
FrogAi.getTemptations() is #minecraft:frog_food.
timeBetweenLongJumps
readonlytimeBetweenLongJumps:UniformInt
FROG_BRAIN
constFROG_BRAIN:BrainMobDefinition
Defined in: mobs/frog.ts:330
The frog's registry entry. initMemories starts the long-jump cooldown at a full interval, so a freshly spawned frog does not jump on its first tick.
FROG_TARGET_DETECTION_DISTANCE
constFROG_TARGET_DETECTION_DISTANCE:10=10
Defined in: sensing/sensors.ts:331
Java's FrogAttackablesSensor.TARGET_DETECTION_DISTANCE.
GOAT
constGOAT:object
Defined in: mobs/goat.ts:38
The named constants of GoatAi.
Type Declaration
adultFollowRange
readonlyadultFollowRange:UniformInt
adultRamKnockbackForce
readonlyadultRamKnockbackForce:2.5=2.5
babyRamKnockbackForce
readonlybabyRamKnockbackForce:1=1
maxJumpVelocityMultiplier
readonlymaxJumpVelocityMultiplier:3.5714288=3.5714288
maxLongJumpHeight
readonlymaxLongJumpHeight:5=5
maxLongJumpWidth
readonlymaxLongJumpWidth:5=5
ramMaxDistance
readonlyramMaxDistance:7=7
ramMinDistance
readonlyramMinDistance:4=4
ramPrepareTime
readonlyramPrepareTime:20=20
speedWhenFollowingAdult
readonlyspeedWhenFollowingAdult:1.25=1.25
speedWhenIdling
readonlyspeedWhenIdling:1=1
speedWhenPanicking
readonlyspeedWhenPanicking:2=2
speedWhenPreparingToRam
readonlyspeedWhenPreparingToRam:1.25=1.25
speedWhenRamming
readonlyspeedWhenRamming:3=3
speedWhenTempted
readonlyspeedWhenTempted:1.25=1.25
timeBetweenLongJumps
readonlytimeBetweenLongJumps:UniformInt
timeBetweenRams
readonlytimeBetweenRams:UniformInt
timeBetweenRamsScreamer
readonlytimeBetweenRamsScreamer:UniformInt
GOAT_BRAIN
constGOAT_BRAIN:BrainMobDefinition
Defined in: mobs/goat.ts:266
The goat's registry entry. initMemories fills both the ram and the long-jump cooldown, so a fresh goat starts idle.
GOLEM_SENSOR
constGOLEM_SENSOR:object
Defined in: sensing/sensors.ts:248
Java's GolemSensor.GOLEM_SCAN_RATE and MEMORY_TIME_TO_LIVE.
Type Declaration
memoryTimeToLive
memoryTimeToLive:
number=599
scanRate
scanRate:
number=200
HAPPY_GHAST
constHAPPY_GHAST:object
Defined in: mobs/happyGhast.ts:38
The named constants of HappyGhastAi.
Type Declaration
adultFollowRange
readonlyadultFollowRange:UniformInt
babyCloseEnoughDist
readonlybabyCloseEnoughDist:3=3
panicFlyHeight
readonlypanicFlyHeight:0=0
speedWhenFollowingAdult
readonlyspeedWhenFollowingAdult:1.1=1.1
speedWhenIdling
readonlyspeedWhenIdling:1=1
speedWhenPanicking
readonlyspeedWhenPanicking:2=2
new AnimalPanic(2.0F, 0): the second argument is the fly height offset.
speedWhenTempted
readonlyspeedWhenTempted:1.25=1.25
HAPPY_GHAST_BRAIN
constHAPPY_GHAST_BRAIN:BrainMobDefinition
Defined in: mobs/happyGhast.ts:120
The happy ghast's registry entry. alsoRunsGoals is true: the harness, the riding and the flight control stay on the goal system.
HOGLIN
constHOGLIN:object
Defined in: mobs/hoglin.ts:35
The named constants of HoglinAi.
Type Declaration
activityBasePriority
readonlyactivityBasePriority:10=10
Both non-core activities start at priority 10.
adultFollowRange
readonlyadultFollowRange:UniformInt
attackDuration
readonlyattackDuration:200=200
attackInterval
readonlyattackInterval:40=40
babyAttackInterval
readonlybabyAttackInterval:15=15
desiredDistanceFromPiglinWhenIdling
readonlydesiredDistanceFromPiglinWhenIdling:8=8
desiredDistanceFromPiglinWhenRetreating
readonlydesiredDistanceFromPiglinWhenRetreating:15=15
repellentDetectionRangeHorizontal
readonlyrepellentDetectionRangeHorizontal:8=8
repellentDetectionRangeVertical
readonlyrepellentDetectionRangeVertical:4=4
repellentPacifyTime
readonlyrepellentPacifyTime:200=200
retreatDuration
readonlyretreatDuration:UniformInt
speedWhenAvoidingRepellent
readonlyspeedWhenAvoidingRepellent:1=1
speedWhenFollowingAdult
readonlyspeedWhenFollowingAdult:0.6=0.6
speedWhenIdling
readonlyspeedWhenIdling:0.4=0.4
speedWhenMakingLove
readonlyspeedWhenMakingLove:0.6=0.6
speedWhenRetreating
readonlyspeedWhenRetreating:1.3=1.3
HOGLIN_BRAIN
constHOGLIN_BRAIN:BrainMobDefinition
Defined in: mobs/hoglin.ts:179
The hoglin's registry entry. updateActivity also mirrors ATTACK_TARGET onto the aggressive condition, which is what the client renders.
MOVE_TO_TARGET_SINK_MAX_RETRY_COOLDOWN
constMOVE_TO_TARGET_SINK_MAX_RETRY_COOLDOWN:40=40
Defined in: behavior/common.ts:195
Java's MoveToTargetSink.MAX_COOLDOWN_BEFORE_RETRYING.
MemoryModuleTypes
constMemoryModuleTypes:object
Defined in: memory.ts:175
The 115 entries of minecraft:memory_module_type in the 26.3 server jar, in registration order.
The field names are Java's field names, which differ from the registered names in six places: NEAREST_LIVING_ENTITIES registers as mobs, NEAREST_VISIBLE_LIVING_ENTITIES as visible_mobs, NEAREST_VISIBLE_ATTACKABLE_PLAYER(S) as nearest_visible_targetable_player(s), LONG_JUMP_COOLDOWN_TICKS as long_jump_cooling_down, BREEZE_SHOOT_RECOVERING as breeze_shoot_recover, and LIKED_NOTEBLOCK_POSITION as liked_noteblock.
Type Declaration
ADMIRING_DISABLED
readonlyADMIRING_DISABLED:MemoryModuleType<boolean>
minecraft:admiring_disabled, Java Boolean.
ADMIRING_ITEM
readonlyADMIRING_ITEM:MemoryModuleType<boolean>
minecraft:admiring_item, Java Boolean.
ANGRY_AT
readonlyANGRY_AT:MemoryModuleType<string>
minecraft:angry_at, Java UUID.
ATE_RECENTLY
readonlyATE_RECENTLY:MemoryModuleType<boolean>
minecraft:ate_recently, Java Boolean.
ATTACK_COOLING_DOWN
readonlyATTACK_COOLING_DOWN:MemoryModuleType<boolean>
minecraft:attack_cooling_down, Java Boolean.
ATTACK_TARGET
readonlyATTACK_TARGET:MemoryModuleType<BrainEntity>
minecraft:attack_target, Java LivingEntity.
ATTACK_TARGET_COOLDOWN
readonlyATTACK_TARGET_COOLDOWN:MemoryModuleType<number>
minecraft:attack_target_cooldown, Java Integer.
AVOID_TARGET
readonlyAVOID_TARGET:MemoryModuleType<BrainEntity>
minecraft:avoid_target, Java LivingEntity.
BREED_TARGET
readonlyBREED_TARGET:MemoryModuleType<BrainEntity>
minecraft:breed_target, Java AgeableMob.
BREEZE_JUMP_COOLDOWN
readonlyBREEZE_JUMP_COOLDOWN:MemoryModuleType<typeofUNIT>
minecraft:breeze_jump_cooldown, Java Unit.
BREEZE_JUMP_INHALING
readonlyBREEZE_JUMP_INHALING:MemoryModuleType<typeofUNIT>
minecraft:breeze_jump_inhaling, Java Unit.
BREEZE_JUMP_TARGET
readonlyBREEZE_JUMP_TARGET:MemoryModuleType<BlockPos>
minecraft:breeze_jump_target, Java BlockPos.
BREEZE_LEAVING_WATER
readonlyBREEZE_LEAVING_WATER:MemoryModuleType<typeofUNIT>
minecraft:breeze_leaving_water, Java Unit.
BREEZE_SHOOT
readonlyBREEZE_SHOOT:MemoryModuleType<typeofUNIT>
minecraft:breeze_shoot, Java Unit.
BREEZE_SHOOT_CHARGING
readonlyBREEZE_SHOOT_CHARGING:MemoryModuleType<typeofUNIT>
minecraft:breeze_shoot_charging, Java Unit.
BREEZE_SHOOT_COOLDOWN
readonlyBREEZE_SHOOT_COOLDOWN:MemoryModuleType<typeofUNIT>
minecraft:breeze_shoot_cooldown, Java Unit.
BREEZE_SHOOT_RECOVERING
readonlyBREEZE_SHOOT_RECOVERING:MemoryModuleType<typeofUNIT>
minecraft:breeze_shoot_recover, Java Unit.
CANT_REACH_WALK_TARGET_SINCE
readonlyCANT_REACH_WALK_TARGET_SINCE:MemoryModuleType<number>
minecraft:cant_reach_walk_target_since, Java Long.
CELEBRATE_LOCATION
readonlyCELEBRATE_LOCATION:MemoryModuleType<BlockPos>
minecraft:celebrate_location, Java BlockPos.
CHARGE_COOLDOWN_TICKS
readonlyCHARGE_COOLDOWN_TICKS:MemoryModuleType<number>
minecraft:charge_cooldown_ticks, Java Integer.
DANCING
readonlyDANCING:MemoryModuleType<boolean>
minecraft:dancing, Java Boolean.
DANGER_DETECTED_RECENTLY
readonlyDANGER_DETECTED_RECENTLY:MemoryModuleType<boolean>
minecraft:danger_detected_recently, Java Boolean.
DIG_COOLDOWN
readonlyDIG_COOLDOWN:MemoryModuleType<typeofUNIT>
minecraft:dig_cooldown, Java Unit.
DISABLE_WALK_TO_ADMIRE_ITEM
readonlyDISABLE_WALK_TO_ADMIRE_ITEM:MemoryModuleType<boolean>
minecraft:disable_walk_to_admire_item, Java Boolean.
DISTURBANCE_LOCATION
readonlyDISTURBANCE_LOCATION:MemoryModuleType<BlockPos>
minecraft:disturbance_location, Java BlockPos.
DOORS_TO_CLOSE
readonlyDOORS_TO_CLOSE:MemoryModuleType<readonlyGlobalPos[]>
minecraft:doors_to_close, Java Set<GlobalPos>.
DUMMY
readonlyDUMMY:MemoryModuleType<never>
minecraft:dummy, Java Void.
GAZE_COOLDOWN_TICKS
readonlyGAZE_COOLDOWN_TICKS:MemoryModuleType<number>
minecraft:gaze_cooldown_ticks, Java Integer.
GOLEM_DETECTED_RECENTLY
readonlyGOLEM_DETECTED_RECENTLY:MemoryModuleType<boolean>
minecraft:golem_detected_recently, Java Boolean.
HAS_HUNTING_COOLDOWN
readonlyHAS_HUNTING_COOLDOWN:MemoryModuleType<boolean>
minecraft:has_hunting_cooldown, Java Boolean.
HEARD_BELL_TIME
readonlyHEARD_BELL_TIME:MemoryModuleType<number>
minecraft:heard_bell_time, Java Long.
HIDING_PLACE
readonlyHIDING_PLACE:MemoryModuleType<GlobalPos>
minecraft:hiding_place, Java GlobalPos.
HOME
readonlyHOME:MemoryModuleType<GlobalPos>
minecraft:home, Java GlobalPos.
HUNTED_RECENTLY
readonlyHUNTED_RECENTLY:MemoryModuleType<boolean>
minecraft:hunted_recently, Java Boolean.
HURT_BY
readonlyHURT_BY:MemoryModuleType<BrainDamageSource>
minecraft:hurt_by, Java DamageSource.
HURT_BY_ENTITY
readonlyHURT_BY_ENTITY:MemoryModuleType<BrainEntity>
minecraft:hurt_by_entity, Java LivingEntity.
INTERACTION_TARGET
readonlyINTERACTION_TARGET:MemoryModuleType<BrainEntity>
minecraft:interaction_target, Java LivingEntity.
IS_EMERGING
readonlyIS_EMERGING:MemoryModuleType<typeofUNIT>
minecraft:is_emerging, Java Unit.
IS_IN_WATER
readonlyIS_IN_WATER:MemoryModuleType<typeofUNIT>
minecraft:is_in_water, Java Unit.
IS_PANICKING
readonlyIS_PANICKING:MemoryModuleType<boolean>
minecraft:is_panicking, Java Boolean.
IS_PREGNANT
readonlyIS_PREGNANT:MemoryModuleType<typeofUNIT>
minecraft:is_pregnant, Java Unit.
IS_SNIFFING
readonlyIS_SNIFFING:MemoryModuleType<typeofUNIT>
minecraft:is_sniffing, Java Unit.
ITEM_PICKUP_COOLDOWN_TICKS
readonlyITEM_PICKUP_COOLDOWN_TICKS:MemoryModuleType<number>
minecraft:item_pickup_cooldown_ticks, Java Integer.
JOB_SITE
readonlyJOB_SITE:MemoryModuleType<GlobalPos>
minecraft:job_site, Java GlobalPos.
LAST_SLEPT
readonlyLAST_SLEPT:MemoryModuleType<number>
minecraft:last_slept, Java Long.
LAST_WOKEN
readonlyLAST_WOKEN:MemoryModuleType<number>
minecraft:last_woken, Java Long.
LAST_WORKED_AT_POI
readonlyLAST_WORKED_AT_POI:MemoryModuleType<number>
minecraft:last_worked_at_poi, Java Long.
LIKED_NOTEBLOCK_COOLDOWN_TICKS
readonlyLIKED_NOTEBLOCK_COOLDOWN_TICKS:MemoryModuleType<number>
minecraft:liked_noteblock_cooldown_ticks, Java Integer.
LIKED_NOTEBLOCK_POSITION
readonlyLIKED_NOTEBLOCK_POSITION:MemoryModuleType<GlobalPos>
minecraft:liked_noteblock, Java GlobalPos.
LIKED_PLAYER
readonlyLIKED_PLAYER:MemoryModuleType<string>
minecraft:liked_player, Java UUID.
LONG_JUMP_COOLDOWN_TICKS
readonlyLONG_JUMP_COOLDOWN_TICKS:MemoryModuleType<number>
minecraft:long_jump_cooling_down, Java Integer.
LONG_JUMP_MID_JUMP
readonlyLONG_JUMP_MID_JUMP:MemoryModuleType<boolean>
minecraft:long_jump_mid_jump, Java Boolean.
LOOK_TARGET
readonlyLOOK_TARGET:MemoryModuleType<PositionTracker>
minecraft:look_target, Java PositionTracker.
MEETING_POINT
readonlyMEETING_POINT:MemoryModuleType<GlobalPos>
minecraft:meeting_point, Java GlobalPos.
NEARBY_ADULT_PIGLINS
readonlyNEARBY_ADULT_PIGLINS:MemoryModuleType<readonlyBrainEntity[]>
minecraft:nearby_adult_piglins, Java List<AbstractPiglin>.
NEAREST_ATTACKABLE
readonlyNEAREST_ATTACKABLE:MemoryModuleType<BrainEntity>
minecraft:nearest_attackable, Java LivingEntity.
NEAREST_BED
readonlyNEAREST_BED:MemoryModuleType<BlockPos>
minecraft:nearest_bed, Java BlockPos.
NEAREST_HOSTILE
readonlyNEAREST_HOSTILE:MemoryModuleType<BrainEntity>
minecraft:nearest_hostile, Java LivingEntity.
NEAREST_LIVING_ENTITIES
readonlyNEAREST_LIVING_ENTITIES:MemoryModuleType<readonlyBrainEntity[]>
minecraft:mobs, Java List<LivingEntity>.
NEAREST_PLAYER_HOLDING_WANTED_ITEM
readonlyNEAREST_PLAYER_HOLDING_WANTED_ITEM:MemoryModuleType<BrainEntity>
minecraft:nearest_player_holding_wanted_item, Java Player.
NEAREST_PLAYERS
readonlyNEAREST_PLAYERS:MemoryModuleType<readonlyBrainEntity[]>
minecraft:nearest_players, Java List<Player>.
NEAREST_REPELLENT
readonlyNEAREST_REPELLENT:MemoryModuleType<BlockPos>
minecraft:nearest_repellent, Java BlockPos.
NEAREST_TARGETABLE_PLAYER_NOT_WEARING_GOLD
readonlyNEAREST_TARGETABLE_PLAYER_NOT_WEARING_GOLD:MemoryModuleType<BrainEntity>
minecraft:nearest_targetable_player_not_wearing_gold, Java Player.
NEAREST_VISIBLE_ADULT
readonlyNEAREST_VISIBLE_ADULT:MemoryModuleType<BrainEntity>
minecraft:nearest_visible_adult, Java LivingEntity.
NEAREST_VISIBLE_ADULT_HOGLINS
readonlyNEAREST_VISIBLE_ADULT_HOGLINS:MemoryModuleType<readonlyBrainEntity[]>
minecraft:nearest_visible_adult_hoglins, Java List<Hoglin>.
NEAREST_VISIBLE_ADULT_PIGLIN
readonlyNEAREST_VISIBLE_ADULT_PIGLIN:MemoryModuleType<BrainEntity>
minecraft:nearest_visible_adult_piglin, Java AbstractPiglin.
NEAREST_VISIBLE_ADULT_PIGLINS
readonlyNEAREST_VISIBLE_ADULT_PIGLINS:MemoryModuleType<readonlyBrainEntity[]>
minecraft:nearest_visible_adult_piglins, Java List<AbstractPiglin>.
NEAREST_VISIBLE_ATTACKABLE_PLAYER
readonlyNEAREST_VISIBLE_ATTACKABLE_PLAYER:MemoryModuleType<BrainEntity>
minecraft:nearest_visible_targetable_player, Java Player.
NEAREST_VISIBLE_ATTACKABLE_PLAYERS
readonlyNEAREST_VISIBLE_ATTACKABLE_PLAYERS:MemoryModuleType<readonlyBrainEntity[]>
minecraft:nearest_visible_targetable_players, Java List<Player>.
NEAREST_VISIBLE_BABY_HOGLIN
readonlyNEAREST_VISIBLE_BABY_HOGLIN:MemoryModuleType<BrainEntity>
minecraft:nearest_visible_baby_hoglin, Java Hoglin.
NEAREST_VISIBLE_HUNTABLE_HOGLIN
readonlyNEAREST_VISIBLE_HUNTABLE_HOGLIN:MemoryModuleType<BrainEntity>
minecraft:nearest_visible_huntable_hoglin, Java Hoglin.
NEAREST_VISIBLE_LIVING_ENTITIES
readonlyNEAREST_VISIBLE_LIVING_ENTITIES:MemoryModuleType<NearestVisibleLivingEntities>
minecraft:visible_mobs, Java NearestVisibleLivingEntities.
NEAREST_VISIBLE_NEMESIS
readonlyNEAREST_VISIBLE_NEMESIS:MemoryModuleType<BrainEntity>
minecraft:nearest_visible_nemesis, Java Mob.
NEAREST_VISIBLE_PLAYER
readonlyNEAREST_VISIBLE_PLAYER:MemoryModuleType<BrainEntity>
minecraft:nearest_visible_player, Java Player.
NEAREST_VISIBLE_WANTED_ITEM
readonlyNEAREST_VISIBLE_WANTED_ITEM:MemoryModuleType<BrainItemEntity>
minecraft:nearest_visible_wanted_item, Java ItemEntity.
NEAREST_VISIBLE_ZOMBIFIED
readonlyNEAREST_VISIBLE_ZOMBIFIED:MemoryModuleType<BrainEntity>
minecraft:nearest_visible_zombified, Java LivingEntity.
PACIFIED
readonlyPACIFIED:MemoryModuleType<boolean>
minecraft:pacified, Java Boolean.
PATH
readonlyPATH:MemoryModuleType<BrainPath>
minecraft:path, Java Path.
PLAY_DEAD_TICKS
readonlyPLAY_DEAD_TICKS:MemoryModuleType<number>
minecraft:play_dead_ticks, Java Integer.
POTENTIAL_JOB_SITE
readonlyPOTENTIAL_JOB_SITE:MemoryModuleType<GlobalPos>
minecraft:potential_job_site, Java GlobalPos.
RAM_COOLDOWN_TICKS
readonlyRAM_COOLDOWN_TICKS:MemoryModuleType<number>
minecraft:ram_cooldown_ticks, Java Integer.
RAM_TARGET
readonlyRAM_TARGET:MemoryModuleType<Vec3>
minecraft:ram_target, Java Vec3.
RECENT_PROJECTILE
readonlyRECENT_PROJECTILE:MemoryModuleType<typeofUNIT>
minecraft:recent_projectile, Java Unit.
RIDE_TARGET
readonlyRIDE_TARGET:MemoryModuleType<BrainEntity>
minecraft:ride_target, Java Entity.
ROAR_SOUND_COOLDOWN
readonlyROAR_SOUND_COOLDOWN:MemoryModuleType<typeofUNIT>
minecraft:roar_sound_cooldown, Java Unit.
ROAR_SOUND_DELAY
readonlyROAR_SOUND_DELAY:MemoryModuleType<typeofUNIT>
minecraft:roar_sound_delay, Java Unit.
ROAR_TARGET
readonlyROAR_TARGET:MemoryModuleType<BrainEntity>
minecraft:roar_target, Java LivingEntity.
SECONDARY_JOB_SITE
readonlySECONDARY_JOB_SITE:MemoryModuleType<readonlyGlobalPos[]>
minecraft:secondary_job_site, Java List<GlobalPos>.
SNIFF_COOLDOWN
readonlySNIFF_COOLDOWN:MemoryModuleType<typeofUNIT>
minecraft:sniff_cooldown, Java Unit.
SNIFFER_DIGGING
readonlySNIFFER_DIGGING:MemoryModuleType<boolean>
minecraft:sniffer_digging, Java Boolean.
SNIFFER_EXPLORED_POSITIONS
readonlySNIFFER_EXPLORED_POSITIONS:MemoryModuleType<readonlyGlobalPos[]>
minecraft:sniffer_explored_positions, Java List<GlobalPos>.
SNIFFER_HAPPY
readonlySNIFFER_HAPPY:MemoryModuleType<boolean>
minecraft:sniffer_happy, Java Boolean.
SNIFFER_SNIFFING_TARGET
readonlySNIFFER_SNIFFING_TARGET:MemoryModuleType<BlockPos>
minecraft:sniffer_sniffing_target, Java BlockPos.
SONIC_BOOM_COOLDOWN
readonlySONIC_BOOM_COOLDOWN:MemoryModuleType<typeofUNIT>
minecraft:sonic_boom_cooldown, Java Unit.
SONIC_BOOM_SOUND_COOLDOWN
readonlySONIC_BOOM_SOUND_COOLDOWN:MemoryModuleType<typeofUNIT>
minecraft:sonic_boom_sound_cooldown, Java Unit.
SONIC_BOOM_SOUND_DELAY
readonlySONIC_BOOM_SOUND_DELAY:MemoryModuleType<typeofUNIT>
minecraft:sonic_boom_sound_delay, Java Unit.
SPEAR_CHARGE_POSITION
readonlySPEAR_CHARGE_POSITION:MemoryModuleType<Vec3>
minecraft:spear_charge_position, Java Vec3.
SPEAR_ENGAGE_TIME
readonlySPEAR_ENGAGE_TIME:MemoryModuleType<number>
minecraft:spear_engage_time, Java Integer.
SPEAR_FLEEING_POSITION
readonlySPEAR_FLEEING_POSITION:MemoryModuleType<Vec3>
minecraft:spear_fleeing_position, Java Vec3.
SPEAR_FLEEING_TIME
readonlySPEAR_FLEEING_TIME:MemoryModuleType<number>
minecraft:spear_fleeing_time, Java Integer.
SPEAR_STATUS
readonlySPEAR_STATUS:MemoryModuleType<SpearStatus>
minecraft:spear_status, Java SpearAttack$SpearStatus.
TEMPTATION_COOLDOWN_TICKS
readonlyTEMPTATION_COOLDOWN_TICKS:MemoryModuleType<number>
minecraft:temptation_cooldown_ticks, Java Integer.
TEMPTING_PLAYER
readonlyTEMPTING_PLAYER:MemoryModuleType<BrainEntity>
minecraft:tempting_player, Java Player.
TIME_TRYING_TO_REACH_ADMIRE_ITEM
readonlyTIME_TRYING_TO_REACH_ADMIRE_ITEM:MemoryModuleType<number>
minecraft:time_trying_to_reach_admire_item, Java Integer.
TOUCH_COOLDOWN
readonlyTOUCH_COOLDOWN:MemoryModuleType<typeofUNIT>
minecraft:touch_cooldown, Java Unit.
TRANSPORT_ITEMS_COOLDOWN_TICKS
readonlyTRANSPORT_ITEMS_COOLDOWN_TICKS:MemoryModuleType<number>
minecraft:transport_items_cooldown_ticks, Java Integer.
UNIVERSAL_ANGER
readonlyUNIVERSAL_ANGER:MemoryModuleType<boolean>
minecraft:universal_anger, Java Boolean.
UNREACHABLE_TONGUE_TARGETS
readonlyUNREACHABLE_TONGUE_TARGETS:MemoryModuleType<readonlystring[]>
minecraft:unreachable_tongue_targets, Java List<UUID>.
UNREACHABLE_TRANSPORT_BLOCK_POSITIONS
readonlyUNREACHABLE_TRANSPORT_BLOCK_POSITIONS:MemoryModuleType<readonlyGlobalPos[]>
minecraft:unreachable_transport_block_positions, Java Set<GlobalPos>.
VIBRATION_COOLDOWN
readonlyVIBRATION_COOLDOWN:MemoryModuleType<typeofUNIT>
minecraft:vibration_cooldown, Java Unit.
VISIBLE_ADULT_HOGLIN_COUNT
readonlyVISIBLE_ADULT_HOGLIN_COUNT:MemoryModuleType<number>
minecraft:visible_adult_hoglin_count, Java Integer.
VISIBLE_ADULT_PIGLIN_COUNT
readonlyVISIBLE_ADULT_PIGLIN_COUNT:MemoryModuleType<number>
minecraft:visible_adult_piglin_count, Java Integer.
VISIBLE_VILLAGER_BABIES
readonlyVISIBLE_VILLAGER_BABIES:MemoryModuleType<readonlyBrainEntity[]>
minecraft:visible_villager_babies, Java List<LivingEntity>.
VISITED_BLOCK_POSITIONS
readonlyVISITED_BLOCK_POSITIONS:MemoryModuleType<readonlyGlobalPos[]>
minecraft:visited_block_positions, Java Set<GlobalPos>.
WALK_TARGET
readonlyWALK_TARGET:MemoryModuleType<WalkTarget>
minecraft:walk_target, Java WalkTarget.
NAUTILUS
constNAUTILUS:object
Defined in: mobs/nautilus.ts:44
The named constants of NautilusAi.
Type Declaration
angerDuration
readonlyangerDuration:400=400
attackKnockbackForce
readonlyattackKnockbackForce:2=2
declineTargetChance
readonlydeclineTargetChance:0.5=0.5
The chance a nautilus declines to pick a non-player target when its cooldown expires.
hostilesTag
readonlyhostilesTag:"minecraft:nautilus_hostiles"='minecraft:nautilus_hostiles'
maxChargeDistance
readonlymaxChargeDistance:12=12
maxTargetDetectionDistance
readonlymaxTargetDetectionDistance:11=11
speedWhenAttacking
readonlyspeedWhenAttacking:0.6=0.6
speedWhenIdlingInWater
readonlyspeedWhenIdlingInWater:1=1
speedWhenMakingLove
readonlyspeedWhenMakingLove:0.4=0.4
speedWhenPanicking
readonlyspeedWhenPanicking:1.6=1.6
speedWhenTempted
readonlyspeedWhenTempted:1.3=1.3
temptationTag
readonlytemptationTag:"minecraft:nautilus_food"='minecraft:nautilus_food'
timeBetweenAttacks
readonlytimeBetweenAttacks:80=80
timeBetweenNonPlayerAttacks
readonlytimeBetweenNonPlayerAttacks:UniformInt
NAUTILUS_BRAIN
constNAUTILUS_BRAIN:BrainMobDefinition
Defined in: mobs/nautilus.ts:262
The nautilus's registry entry. It keeps ANGRY_AT and ATTACK_TARGET_COOLDOWN, and prefers fight over idle.
NEAREST_BED_SENSOR
constNEAREST_BED_SENSOR:object
Defined in: sensing/sensors.ts:433
Java's NearestBedSensor.CACHE_TIMEOUT, BATCH_SIZE and RATE.
Type Declaration
batchSize
batchSize:
number=5
cacheTimeout
cacheTimeout:
number=40
rate
rate:
number=20
searchRadius
searchRadius:
number=48
NEAREST_ITEM_RANGES
constNEAREST_ITEM_RANGES:object
Defined in: sensing/sensors.ts:99
Java's NearestItemSensor.XZ_RANGE, Y_RANGE and MAX_DISTANCE_TO_WANTED_ITEM.
Type Declaration
maxDistanceToWantedItem
maxDistanceToWantedItem:
number=32
xz
xz:
number=32
y
y:
number=16
NEVER_EXPIRE
constNEVER_EXPIRE:number=MemorySlot.NEVER_EXPIRE
Defined in: behavior/builder.ts:250
Re-exported so behaviors can name the never-expire sentinel without reaching into memory.ts.
NO_PROFESSION
constNO_PROFESSION:VillagerProfession
Defined in: mobs/villager.ts:122
Java's VillagerProfession.NONE, the profession an unemployed villager carries.
NO_VISIBLE_ENTITIES
constNO_VISIBLE_ENTITIES:NearestVisibleLivingEntities
Defined in: memory.ts:59
An empty NearestVisibleLivingEntities, Java's NearestVisibleLivingEntities.empty().
PANIC_DISTANCE
constPANIC_DISTANCE:object
Defined in: behavior/common.ts:92
Java's AnimalPanic.PANIC_DISTANCE_HORIZONTAL and PANIC_DISTANCE_VERTICAL.
Type Declaration
xzRange
xzRange:
number=5
yRange
yRange:
number=4
PANIC_DURATION
constPANIC_DURATION:object
Defined in: behavior/common.ts:90
Java's AnimalPanic.PANIC_MIN_DURATION and PANIC_MAX_DURATION.
Type Declaration
maxDuration
maxDuration:
number=120
minDuration
minDuration:
number=100
PIGLIN
constPIGLIN:object
Defined in: mobs/piglin.ts:54
The named constants of PiglinAi.
Type Declaration
activityBasePriority
readonlyactivityBasePriority:10=10
Both non-core activities start at priority 10.
admireDuration
readonlyadmireDuration:119=119
angerDuration
readonlyangerDuration:600=600
avoidZombifiedDuration
readonlyavoidZombifiedDuration:UniformInt
babyAvoidNemesisDuration
readonlybabyAvoidNemesisDuration:UniformInt
babyFleeDurationAfterGettingHit
readonlybabyFleeDurationAfterGettingHit:100=100
barterCurrency
readonlybarterCurrency:"minecraft:gold_ingot"='minecraft:gold_ingot'
barteringItem
readonlybarteringItem:"minecraft:gold_ingot"='minecraft:gold_ingot'
celebrationTime
readonlycelebrationTime:300=300
desiredDistanceFromEntityWhenAvoiding
readonlydesiredDistanceFromEntityWhenAvoiding:12=12
desiredDistanceFromZombified
readonlydesiredDistanceFromZombified:6=6
eatCooldown
readonlyeatCooldown:200=200
hitByPlayerMemoryTimeout
readonlyhitByPlayerMemoryTimeout:400=400
howLongToDisableAdmireWalkingIfCantReachItem
readonlyhowLongToDisableAdmireWalkingIfCantReachItem:200=200
ignoredByBabiesTag
readonlyignoredByBabiesTag:"minecraft:ignored_by_piglin_babies"='minecraft:ignored_by_piglin_babies'
interactionRange
readonlyinteractionRange:8=8
lovedItemTag
readonlylovedItemTag:"minecraft:piglin_loved"='minecraft:piglin_loved'
maxDistanceToWalkToItem
readonlymaxDistanceToWalkToItem:9=9
maxLookDist
readonlymaxLookDist:8=8
maxLookDistForPlayerHoldingLovedItem
readonlymaxLookDistForPlayerHoldingLovedItem:14=14
maxTimeBetweenHunts
readonlymaxTimeBetweenHunts:120=120
maxTimeToWalkToItem
readonlymaxTimeToWalkToItem:200=200
maxWalkDistanceToStartRiding
readonlymaxWalkDistanceToStartRiding:8=8
meleeAttackCooldown
readonlymeleeAttackCooldown:20=20
minDesiredDistFromTargetWhenHoldingCrossbow
readonlyminDesiredDistFromTargetWhenHoldingCrossbow:5=5
playerAngerRange
readonlyplayerAngerRange:16=16
probabilityOfCelebrationDance
readonlyprobabilityOfCelebrationDance:0.1=0.1
repellentDetectionRangeHorizontal
readonlyrepellentDetectionRangeHorizontal:8=8
repellentDetectionRangeVertical
readonlyrepellentDetectionRangeVertical:4=4
repellentItemTag
readonlyrepellentItemTag:"minecraft:piglin_repellents"='minecraft:piglin_repellents'
retreatDuration
readonlyretreatDuration:UniformInt
rideDuration
readonlyrideDuration:UniformInt
rideStartInterval
readonlyrideStartInterval:UniformInt
speedWhenAvoiding
readonlyspeedWhenAvoiding:1=1
speedWhenDancing
readonlyspeedWhenDancing:0.6=0.6
speedWhenGoingToCelebrateLocation
readonlyspeedWhenGoingToCelebrateLocation:1=1
speedWhenGoingToWantedItem
readonlyspeedWhenGoingToWantedItem:1=1
speedWhenIdling
readonlyspeedWhenIdling:0.6=0.6
speedWhenMounting
readonlyspeedWhenMounting:0.8=0.8
speedWhenRetreating
readonlyspeedWhenRetreating:1=1
speedWhenStrafingBackFromTarget
readonlyspeedWhenStrafingBackFromTarget:0.75=0.75
timeBetweenHunts
readonlytimeBetweenHunts:UniformInt
PIGLIN_BRAIN
constPIGLIN_BRAIN:BrainMobDefinition
Defined in: mobs/piglin.ts:773
The piglin's registry entry. admire_item outranks fight, so a piglin handed gold stops attacking to look at it.
PIGLIN_BRUTE
constPIGLIN_BRUTE:object
Defined in: mobs/piglinBrute.ts:45
The named constants of PiglinBruteAi.
Type Declaration
activityBasePriority
readonlyactivityBasePriority:10=10
activitySoundLikelihoodPerTick
readonlyactivitySoundLikelihoodPerTick:0.0125=0.0125
angerDuration
readonlyangerDuration:600=600
homeCloseEnoughDistance
readonlyhomeCloseEnoughDistance:2=2
homeStrollAroundDistance
readonlyhomeStrollAroundDistance:5=5
homeTooFarDistance
readonlyhomeTooFarDistance:100=100
interactionRange
readonlyinteractionRange:8=8
maxLookDist
readonlymaxLookDist:8=8
meleeAttackCooldown
readonlymeleeAttackCooldown:20=20
speedWhenIdling
readonlyspeedWhenIdling:0.6=0.6
PIGLIN_BRUTE_BRAIN
constPIGLIN_BRUTE_BRAIN:BrainMobDefinition
Defined in: mobs/piglinBrute.ts:201
The piglin brute's registry entry. initMemories writes HOME at the spawn position, which is what keeps a brute inside its bastion.
PROJECTILE_ATTACK_RANGE_BUFFER
constPROJECTILE_ATTACK_RANGE_BUFFER:1=1
Defined in: behavior/common.ts:585
Java's SetWalkTargetFromAttackTargetIfTargetOutOfReach.PROJECTILE_ATTACK_RANGE_BUFFER.
RANDOM_STROLL_RANGE
constRANDOM_STROLL_RANGE:object
Defined in: behavior/common.ts:414
Java's RandomStroll.MAX_XZ_DIST and MAX_Y_DIST.
Type Declaration
xzRange
xzRange:
number=10
yRange
yRange:
number=7
REPELLENT_DETECTION_RANGE
constREPELLENT_DETECTION_RANGE:object
Defined in: sensing/sensors.ts:572
Java's PiglinAi.REPELLENT_DETECTION_RANGE_HORIZONTAL and _VERTICAL, shared with the hoglin.
Type Declaration
horizontal
horizontal:
number=8
vertical
vertical:
number=4
SECONDARY_POI_SENSOR
constSECONDARY_POI_SENSOR:object
Defined in: sensing/sensors.ts:400
Java's SecondaryPoiSensor.SCAN_RATE, and the box it walks.
Type Declaration
horizontalSearch
horizontalSearch:
number=4
scanRate
scanRate:
number=40
verticalSearch
verticalSearch:
number=2
SENSOR_TYPE_NAMES
constSENSOR_TYPE_NAMES: readonly ["dummy","nearest_items","nearest_living_entities","nearest_players","nearest_bed","hurt_by","villager_hostiles","villager_babies","secondary_pois","golem_detected","armadillo_scare_detected","piglin_specific_sensor","piglin_brute_specific_sensor","hoglin_specific_sensor","nearest_adult","nearest_adult_any_type","axolotl_attackables","food_temptations","frog_temptations","nautilus_temptations","frog_attackables","is_in_water","warden_entity_sensor","breeze_attack_entity_sensor"]
Defined in: sensing/sensors.ts:749
The 24 registered sensor type names, in registration order.
SNIFFER
constSNIFFER:object
Defined in: mobs/sniffer.ts:37
The named constants of SnifferAi and its five inner behaviors.
Type Declaration
diggingDuration
readonlydiggingDuration:object
diggingDuration.max
readonlymax:180=180
diggingDuration.min
readonlymin:160=160
feelingHappyDuration
readonlyfeelingHappyDuration:object
feelingHappyDuration.max
readonlymax:100=100
feelingHappyDuration.min
readonlymin:40=40
finishedDiggingDuration
readonlyfinishedDiggingDuration:40=40
maxLookDistance
readonlymaxLookDistance:6=6
moveToTargetSink
readonlymoveToTargetSink:object
new MoveToTargetSink(500, 700): by far the longest sink timeout of the twenty mobs.
moveToTargetSink.maxDuration
readonlymaxDuration:700=700
moveToTargetSink.minDuration
readonlyminDuration:500=500
scentingDuration
readonlyscentingDuration:object
scentingDuration.max
readonlymax:80=80
scentingDuration.min
readonlymin:40=40
searchingDuration
readonlysearchingDuration:600=600
sniffingCooldownTicks
readonlysniffingCooldownTicks:9600=9600
sniffingDuration
readonlysniffingDuration:object
sniffingDuration.max
readonlymax:80=80
sniffingDuration.min
readonlymin:40=40
speedWhenIdling
readonlyspeedWhenIdling:1=1
speedWhenPanicking
readonlyspeedWhenPanicking:2=2
speedWhenSniffing
readonlyspeedWhenSniffing:1.25=1.25
speedWhenTempted
readonlyspeedWhenTempted:1.25=1.25
SNIFFER_BRAIN
constSNIFFER_BRAIN:BrainMobDefinition
Defined in: mobs/sniffer.ts:343
The sniffer's registry entry. SNIFFER_EXPLORED_POSITIONS persists, so a sniffer will not dig the same spot twice.
STROLL_AROUND_POI
constSTROLL_AROUND_POI:object
Defined in: behavior/common.ts:949
Java's StrollAroundPoi.MIN_TIME_BETWEEN_STROLLS, STROLL_MAX_XZ_DIST and STROLL_MAX_Y_DIST.
Type Declaration
minTimeBetweenStrolls
minTimeBetweenStrolls:
number=180
xzRange
xzRange:
number=8
yRange
yRange:
number=6
TADPOLE
constTADPOLE:object
Defined in: mobs/tadpole.ts:27
The named constants of TadpoleAi.
Type Declaration
speedWhenIdlingInWater
readonlyspeedWhenIdlingInWater:0.5=0.5
speedWhenPanicking
readonlyspeedWhenPanicking:2=2
speedWhenTempted
readonlyspeedWhenTempted:1.25=1.25
TADPOLE_BRAIN
constTADPOLE_BRAIN:BrainMobDefinition
Defined in: mobs/tadpole.ts:71
The tadpole's registry entry. It shares the frog's temptation sensor and has only idle to pick.
TEMPTATION_CLOSE_ENOUGH
constTEMPTATION_CLOSE_ENOUGH:object
Defined in: behavior/common.ts:732
Java's FollowTemptation.DEFAULT_CLOSE_ENOUGH_DIST and BACKED_UP_CLOSE_ENOUGH_DIST.
Type Declaration
backedUp
backedUp:
number=3.5
default
default:
number=2.5
TEMPTATION_COOLDOWN
constTEMPTATION_COOLDOWN:100=100
Defined in: behavior/common.ts:730
Java's FollowTemptation.TEMPTATION_COOLDOWN.
TEMPT_RANGE_ATTRIBUTE
constTEMPT_RANGE_ATTRIBUTE:"minecraft:tempt_range"='minecraft:tempt_range'
Defined in: sensing/sensors.ts:18
Java's Attributes.TEMPT_RANGE, which TemptingSensor scans instead.
TIMEOUT_TO_GET_WITHIN_ATTACK_RANGE
constTIMEOUT_TO_GET_WITHIN_ATTACK_RANGE:200=200
Defined in: behavior/common.ts:544
Java's StopAttackingIfTargetInvalid.TIMEOUT_TO_GET_WITHIN_ATTACK_RANGE.
UNIT
constUNIT: typeofUNIT
Defined in: memory.ts:16
Java's net.minecraft.util.Unit: a value whose only content is its presence. Twenty memories hold it, which is how the warden and the breeze store pure timers.
VILLAGER
constVILLAGER:object
Defined in: mobs/villager.ts:56
The named constants of VillagerGoalPackages.
Type Declaration
baseSpeedModifier
readonlybaseSpeedModifier:0.5=0.5
Every package is built with 0.5F, the villager's base speed modifier.
giveGiftDuration
readonlygiveGiftDuration:100=100
new GiveGiftToHero(100).
hiddenState
readonlyhiddenState:object
SetHiddenState.create(15, 3): fifteen seconds hidden, three blocks close enough.
hiddenState.closeEnough
readonlycloseEnough:3=3
hiddenState.seconds
readonlyseconds:15=15
hideSearchDistance
readonlyhideSearchDistance:32=32
homeWalkRange
readonlyhomeWalkRange:1=1
interactDistSqr
readonlyinteractDistSqr:5=5
interactSpeedModifier
readonlyinteractSpeedModifier:0.5=0.5
interactWalkupDist
readonlyinteractWalkupDist:2=2
jobSiteWalkRange
readonlyjobSiteWalkRange:9=9
meetingWalkRange
readonlymeetingWalkRange:6=6
panicSpeedMultiplier
readonlypanicSpeedMultiplier:1.5=1.5
The panic package multiplies the base speed by 1.5.
poiAcquireRange
readonlypoiAcquireRange:14=14
AcquirePoi.create(..., Optional.of((byte)14)): the home and meeting acquisition range.
raidHideSearchDistance
readonlyraidHideSearchDistance:24=24
showTradesDuration
readonlyshowTradesDuration:object
new ShowTradesToPlayer(400, 1600).
showTradesDuration.max
readonlymax:1600=1600
showTradesDuration.min
readonlymin:400=400
strollSpeedModifier
readonlystrollSpeedModifier:0.4=0.4
VILLAGER_BRAIN
constVILLAGER_BRAIN:BrainMobDefinition
Defined in: mobs/villager.ts:902
The villager's registry entry. makeBrain reads the profession and the baby flag off the options, and updateActivity goes through the schedule rather than a priority list.
VILLAGER_HOSTILE_DISTANCES
constVILLAGER_HOSTILE_DISTANCES:ReadonlyMap<string,number>
Defined in: sensing/sensors.ts:360
Java's VillagerHostilesSensor: the eleven mob types a villager flees, each with its own distance. The map is the whole content of the class and it is reproduced exactly.
VILLAGER_SCHEDULE
constVILLAGER_SCHEDULE:Schedule
Defined in: mobs/villager.ts:88
The villager schedule, read from data/minecraft/timeline/villager_schedule.json in the 26.3 vanilla datapack.
An adult works from 2000 to 9000, meets from 9000 to 11000, idles until 12000 and rests after. The first keyframe is at tick 10, not 0, so the very start of the day is the previous day's last activity.
WARDEN
constWARDEN:object
Defined in: mobs/warden.ts:42
The named constants of WardenAi.
The four animation durations are written in Java as Mth.ceil of a float, because they come from the animation files: EMERGE_DURATION is ceil(133.59999), ROAR_DURATION is ceil(84), the dig is ceil(100) and the sniff is ceil(83.2).
Type Declaration
angerFromSniffingDistance
readonlyangerFromSniffingDistance:object
Sniffing.ANGER_FROM_SNIFFING_MAX_DISTANCE_XZ and _Y.
angerFromSniffingDistance.xz
readonlyxz:6=6
angerFromSniffingDistance.y
readonlyy:20=20
angerManagementTickDelay
readonlyangerManagementTickDelay:20=20
Warden.ANGERMANAGEMENT_TICK_DELAY, how often the anger map is aged.
defaultAnger
readonlydefaultAnger:35=35
Warden.DEFAULT_ANGER, the anger a plain disturbance adds.
diggingCooldown
readonlydiggingCooldown:1200=1200
diggingDuration
readonlydiggingDuration:number
disturbanceLocationExpiryTime
readonlydisturbanceLocationExpiryTime:100=100
emergeDuration
readonlyemergeDuration:number
meleeAttackCooldown
readonlymeleeAttackCooldown:18=18
onHurtAngerBoost
readonlyonHurtAngerBoost:20=20
Warden.ON_HURT_ANGER_BOOST, added on top of ANGRY's minimum when the warden is hit.
projectileAnger
readonlyprojectileAnger:10=10
Warden.PROJECTILE_ANGER, added for the shooter of an arrow that lands nearby.
projectileAngerDistance
readonlyprojectileAngerDistance:30=30
roarAngerIncrease
readonlyroarAngerIncrease:20=20
roarDuration
readonlyroarDuration:number
roarSoundDelay
readonlyroarSoundDelay:25=25
Roar.TICKS_BEFORE_PLAYING_ROAR_SOUND and Roar.ROAR_ANGER_INCREASE.
sniffCooldown
readonlysniffCooldown:object
TryToSniff.SNIFF_COOLDOWN, UniformInt.of(100, 200).
sniffCooldown.max
readonlymax:200=200
sniffCooldown.min
readonlymin:100=100
sniffingDuration
readonlysniffingDuration:number
sonicBoom
readonlysonicBoom:object
SonicBoom.DISTANCE_XZ, DISTANCE_Y, COOLDOWN, DURATION and TICKS_BEFORE_PLAYING_SOUND.
sonicBoom.cooldown
readonlycooldown:40=40
sonicBoom.damage
readonlydamage:10=10
sonicBoom.distanceXz
readonlydistanceXz:15=15
sonicBoom.distanceY
readonlydistanceY:20=20
sonicBoom.duration
readonlyduration:number
sonicBoom.knockbackHorizontal
readonlyknockbackHorizontal:2.5=2.5
sonicBoom.knockbackVertical
readonlyknockbackVertical:0.5=0.5
sonicBoom.ticksBeforePlayingSound
readonlyticksBeforePlayingSound:number
speedWhenFighting
readonlyspeedWhenFighting:1.2=1.2
speedWhenIdling
readonlyspeedWhenIdling:0.5=0.5
speedWhenInvestigating
readonlyspeedWhenInvestigating:0.7=0.7
vibrationCooldownTicks
readonlyvibrationCooldownTicks:40=40
Warden.VIBRATION_COOLDOWN_TICKS.
WARDEN_BRAIN
constWARDEN_BRAIN:BrainMobDefinition
Defined in: mobs/warden.ts:652
The warden's registry entry. initMemories holds DIG_COOLDOWN for 1200 ticks, so a warden that has just emerged does not burrow straight back down.
WARDEN_FOLLOW_RANGE
constWARDEN_FOLLOW_RANGE:24=24
Defined in: mobs/warden.ts:627
Java's Warden.FOLLOW_RANGE, the look range the fight activity is built with.
ZOGLIN
constZOGLIN:object
Defined in: mobs/zoglin.ts:33
The named constants of Zoglin.
Type Declaration
activityBasePriority
readonlyactivityBasePriority:10=10
attackDamage
readonlyattackDamage:6=6
attackDuration
readonlyattackDuration:200=200
attackInterval
readonlyattackInterval:40=40
attackKnockback
readonlyattackKnockback:1=1
babyAttackDamage
readonlybabyAttackDamage:0.5=0.5
babyAttackInterval
readonlybabyAttackInterval:15=15
knockbackResistance
readonlyknockbackResistance:0.6=0.6
maxHealth
readonlymaxHealth:40=40
movementSpeedWhenFighting
readonlymovementSpeedWhenFighting:0.3=0.3
speedWhenIdling
readonlyspeedWhenIdling:0.4=0.4
ZOGLIN_BRAIN
constZOGLIN_BRAIN:BrainMobDefinition
Defined in: mobs/zoglin.ts:103
The zoglin's registry entry. Two sensors and no starting memories: it attacks whatever it can see.
ZOMBIE_NAUTILUS
constZOMBIE_NAUTILUS:object
Defined in: mobs/nautilus.ts:63
The named constants of ZombieNautilusAi, which overrides four of the nautilus's.
Type Declaration
attackKnockbackForce
readonlyattackKnockbackForce:2=2
maxChargeDistance
readonlymaxChargeDistance:12=12
maxTargetDetectionDistance
readonlymaxTargetDetectionDistance:11=11
speedWhenAttacking
readonlyspeedWhenAttacking:0.5=0.5
speedWhenIdlingInWater
readonlyspeedWhenIdlingInWater:1=1
speedWhenTempted
readonlyspeedWhenTempted:0.9=0.9
timeBetweenAttacks
readonlytimeBetweenAttacks:80=80
ZOMBIE_NAUTILUS_BRAIN
constZOMBIE_NAUTILUS_BRAIN:BrainMobDefinition
Defined in: mobs/nautilus.ts:320
The zombie nautilus's registry entry. The same memories and sensors as the nautilus, under its own id.
Functions
activityByName()
activityByName(
name):Activity|undefined
Defined in: activity.ts:53
Looks an activity up by its registered name.
Parameters
name
string
Returns
Activity | undefined
activityData()
activityData(
activity,behaviors,options?):ActivityData
Defined in: brain.ts:55
Builds an ActivityData, mirroring Java's seven ActivityData.create overloads.
Parameters
activity
behaviors
readonly PrioritizedBehavior[]
options?
ActivityDataOptions = {}
Returns
admireGoldItem()
admireGoldItem(
context,duration?):void
Defined in: mobs/piglin.ts:181
Java's PiglinAi.mobInteract and pickUpItem, reduced to what the brain owns.
Giving a piglin gold writes ADMIRING_ITEM with the 119-tick admire duration and stops the piglin walking; what happens to the item and what comes back out of the barter loot table is the host's, and onBarter is where that lands.
Parameters
context
duration?
number = PIGLIN.admireDuration
How many ticks the admiration memory remains present.
Returns
void
allayActivities()
allayActivities(): readonly
ActivityData[]
Defined in: mobs/allay.ts:188
The allay's two activities: core and idle. It never fights and never panics by itself.
Returns
readonly ActivityData[]
angerFrom()
angerFrom(
anger,canTargetEntity):WardenAnger
Defined in: mobs/warden.ts:575
A WardenAnger over an AngerManagement the caller owns.
getEntityAngryAt returns a suspect only while the warden is angry, which is why an agitated warden listens and sniffs rather than charging.
Parameters
anger
canTargetEntity
(entity) => boolean
Returns
angerLevelByAnger()
angerLevelByAnger(
anger):"calm"|"agitated"|"angry"
Defined in: mobs/warden.ts:95
Java's AngerLevel.byAnger: the highest band whose minimum the value reaches.
Parameters
anger
number
Returns
"calm" | "agitated" | "angry"
animalMakeLove()
animalMakeLove(
partnerType,speedModifier?,closeEnough?):BehaviorControl
Defined in: behavior/common.ts:798
Java's AnimalMakeLove: pairs with a nearby breeding partner of the same type.
Both partners get the BREED_TARGET memory in Java; this writes the body's own, because the partner is a BrainEntity view and not a brain. The spawn itself is the host's, since it needs the entity type registry, and it happens 60 to 110 ticks in, which is what spawnChildAtTime is here.
Parameters
partnerType
string
speedModifier?
number = 1
closeEnough?
number = 2
Returns
animalPanic()
animalPanic(
speedMultiplier,options?):BehaviorControl
Defined in: behavior/common.ts:112
Java's AnimalPanic.
It runs for 100 to 120 ticks, holds IS_PANICKING for its whole duration, and redraws a flee position each time the navigation finishes. The entry conditions are REGISTERED rather than present, so the behavior itself decides whether to run: it starts when HURT_BY is a damage type in the tag or when something else already set IS_PANICKING.
Parameters
speedMultiplier
number
options?
AnimalPanicOptions = {}
Returns
armadilloActivities()
armadilloActivities(): readonly
ActivityData[]
Defined in: mobs/armadillo.ts:186
The armadillo's three activities: the core package, idle, and the panic it rolls up in.
Returns
readonly ActivityData[]
axolotlActivities()
axolotlActivities(): readonly
ActivityData[]
Defined in: mobs/axolotl.ts:217
The axolotl's four activities: the core package, idle, fight and play_dead.
Returns
readonly ActivityData[]
axolotlSpeed()
axolotlSpeed(
body,inWaterSpeed):number
Defined in: mobs/axolotl.ts:58
Java's AxolotlAi.getSpeedModifier, and the two variants that only differ in the water value.
Parameters
body
conditions
ReadonlySet<string>
inWaterSpeed
number
Returns
number
babyFollowAdult()
babyFollowAdult(
followRange,speedModifier,nearestVisible?):OneShot
Defined in: behavior/common.ts:701
Java's BabyFollowAdult: a baby trails an adult while it is between the range's bounds.
Parameters
followRange
speedModifier
number | ((body) => number)
nearestVisible?
MemoryModuleType<BrainEntity> = MemoryModuleTypes.NEAREST_VISIBLE_ADULT
Returns
becomePassiveIfMemoryPresent()
becomePassiveIfMemoryPresent(
pacifyingMemory,pacifyDuration):OneShot
Defined in: behavior/common.ts:685
Java's BecomePassiveIfMemoryPresent: drops the attack target and holds PACIFIED.
Both piglins and hoglins use it with their repellent memory and a 200-tick pacify duration.
Parameters
pacifyingMemory
MemoryModuleType<unknown>
pacifyDuration
number
Returns
behavior()
behavior(
name):BehaviorBuilder<readonly []>
Defined in: behavior/builder.ts:168
Starts a BehaviorBuilder chain. Java's BehaviorBuilder.create.
Parameters
name
string
Returns
BehaviorBuilder<readonly []>
blockContaining()
blockContaining(
position):BlockPos
Defined in: world.ts:434
Java's BlockPos.containing: the block a position falls inside.
Parameters
position
Returns
blockPosTracker()
blockPosTracker(
pos):PositionTracker
Defined in: world.ts:444
A PositionTracker over a fixed block. Java's BlockPosTracker.
Parameters
pos
Returns
blockPositionsInManhattanOrder()
blockPositionsInManhattanOrder(
center,xzRange,yRange):Generator<BlockPos>
Defined in: world.ts:413
Java's BlockPos.withinBoxByManhattanDistance position order.
Each Manhattan shell visits x from negative to positive, then y from negative to positive, and z positive before its negative mirror. Callers can stop the iterator at the first matching block without allocating the whole search box.
Parameters
center
The block at the center of the search.
xzRange
number
The horizontal extent in both x and z.
yRange
number
The vertical extent.
Returns
Generator<BlockPos>
bottomCenterOf()
bottomCenterOf(
pos):Vec3
Defined in: world.ts:439
Java's Vec3.atBottomCenterOf: the center of a block's bottom face.
Parameters
pos
Returns
breezeActivities()
breezeActivities(): readonly
ActivityData[]
Defined in: mobs/breeze.ts:252
The breeze's three activities: the core package, idle and fight.
Returns
readonly ActivityData[]
camelActivities()
camelActivities(): readonly
ActivityData[]
Defined in: mobs/camel.ts:134
The camel's two activities: the core package and idle. Its goals run everything else.
Returns
readonly ActivityData[]
canAdmire()
canAdmire(
body,offered):boolean
Defined in: mobs/piglin.ts:163
Java's PiglinAi.canAdmire: an adult that is not already admiring, offered a gold ingot.
Parameters
body
offered
Returns
boolean
conditions()
conditions(...
entries):MemoryConditions
Defined in: behavior/control.ts:20
Builds a MemoryConditions from pairs, which reads closer to Java's ImmutableMap.of.
Parameters
entries
...readonly (readonly [MemoryModuleType<unknown>, MemoryStatus])[]
Returns
copperGolemActivities()
copperGolemActivities(): readonly
ActivityData[]
Defined in: mobs/copperGolem.ts:118
The copper golem's two activities: the core package and idle. It never fights.
Returns
readonly ActivityData[]
copyMemoryWithExpiry()
copyMemoryWithExpiry<
Value>(copyIf,source,target,duration):OneShot
Defined in: behavior/common.ts:659
Java's CopyMemoryWithExpiry: the piglin's two avoidance behaviors are both this.
Type Parameters
Value
Value
Parameters
copyIf
(body) => boolean
source
MemoryModuleType<Value>
target
MemoryModuleType<Value>
duration
Returns
corePackage()
corePackage(
profession,speedModifier): readonlyPrioritizedBehavior[]
Defined in: mobs/villager.ts:559
Java's getCorePackage, the one package every villager always runs.
Parameters
profession
speedModifier
number
Returns
readonly PrioritizedBehavior[]
countDownCooldownTicks()
countDownCooldownTicks(
cooldown):BehaviorControl
Defined in: behavior/builder.ts:216
Java's CountDownCooldownTicks: decrements an integer memory once per tick and erases it at zero. It overrides timedOut to false, so it runs until the memory runs out rather than for a drawn duration, and it is in almost every mob's core activity.
Parameters
cooldown
MemoryModuleType<number>
Returns
creakingActivities()
creakingActivities(): readonly
ActivityData[]
Defined in: mobs/creaking.ts:93
The creaking's three activities: the core package, idle and fight.
Returns
readonly ActivityData[]
distanceManhattan()
distanceManhattan(
a,b):number
Defined in: world.ts:398
Java's BlockPos::distManhattan, which is what decides a walk target is close enough.
Parameters
a
b
Returns
number
distanceSquared()
distanceSquared(
a,b):number
Defined in: world.ts:390
Squared distance between two positions.
Parameters
a
b
Returns
number
entityIntersectsBounds()
entityIntersectsBounds(
position,dimensions,bounds):boolean
Defined in: world.ts:50
Whether an entity's box strictly intersects a query box, as Java's AABB.intersects does.
Parameters
position
dimensions
bounds
Returns
boolean
entityTracker()
entityTracker(
entity):PositionTracker
Defined in: world.ts:453
A PositionTracker that follows an entity. Java's EntityTracker.
Parameters
entity
Returns
eraseMemoryIf()
eraseMemoryIf(
predicate,memory):OneShot
Defined in: behavior/common.ts:643
Java's EraseMemoryIf.
Parameters
predicate
(body, context) => boolean
memory
MemoryModuleType<unknown>
Returns
farmTask()
farmTask(
name,task,farmer):BehaviorControl
Defined in: mobs/villager.ts:283
Java's HarvestFarmland and UseBonemeal: a farmer walks to a spot the host picked and works it. Anyone who is not a farmer never starts either.
Parameters
name
string
task
"harvest_farmland" | "use_bonemeal"
farmer
boolean
Returns
findNautilusAttackTarget()
findNautilusAttackTarget(
context):BrainEntity|undefined
Defined in: mobs/nautilus.ts:80
Java's NautilusAi.findNautilusAttackTarget, shared by both nautilus kinds.
The order matters and is worth stating: an ANGRY_AT target in water wins outright; otherwise, while ATTACK_TARGET_COOLDOWN holds, nothing is chosen; and when the cooldown expires the nautilus redraws it and declines half the time, so an unprovoked nautilus attacks rarely.
Parameters
context
Returns
BrainEntity | undefined
findNearbyAdultPiglins()
findNearbyAdultPiglins(
context): readonlyBrainEntity[]
Defined in: sensing/sensors.ts:680
Java's PiglinAi.findNearbyAdultPiglins: adults in the unfiltered nearby list.
Parameters
context
Returns
readonly BrainEntity[]
findPiglinAttackTarget()
findPiglinAttackTarget(
context):BrainEntity|undefined
Defined in: mobs/piglin.ts:212
Java's PiglinAi.findPiglinAttackTarget.
The order is the whole of a piglin's hostility: nothing while near a zombified piglin, then the grudge, then a player only when universal anger is on, then the nemesis, then a player not wearing gold.
Parameters
context
Returns
BrainEntity | undefined
findPiglinBruteAttackTarget()
findPiglinBruteAttackTarget(
context):BrainEntity|undefined
Defined in: mobs/piglinBrute.ts:65
Java's PiglinBruteAi.findPiglinBruteAttackTarget.
Shorter than the piglin's: the grudge, then any attackable player, then the nemesis. A brute has no gold-armor exemption, which is why gold does not protect a player inside a bastion's throne room.
Parameters
context
Returns
BrainEntity | undefined
followTemptation()
followTemptation(
speedModifier,closeEnough?):BehaviorControl
Defined in: behavior/common.ts:740
Java's FollowTemptation: walks towards the player holding the mob's food.
TEMPTING_PLAYER comes from one of the four tempting sensors; this behavior only moves and sets the cooldown that keeps a tempted mob from re-tempting the instant it stops.
Parameters
speedModifier
(body) => number
closeEnough?
(body) => number
Returns
frogActivities()
frogActivities(): readonly
ActivityData[]
Defined in: mobs/frog.ts:322
The frog's six activities: the core package, idle, swim, lay_spawn, tongue and long_jump.
Returns
readonly ActivityData[]
gatedBy()
gatedBy(
predicate,child):BehaviorControl
Defined in: behavior/builder.ts:193
Wraps a behavior so it only starts while the predicate holds, which is what BehaviorBuilder.triggerIf(predicate, behavior) produces for a non-OneShot child.
Parameters
predicate
(body, context) => boolean
child
Returns
giveGiftToHero()
giveGiftToHero():
BehaviorControl
Defined in: mobs/villager.ts:384
Java's GiveGiftToHero: a villager thanks the hero of its village, every so often.
Returns
goToTargetLocation()
goToTargetLocation(
locationMemory,closeEnoughDist,speedModifier):OneShot
Defined in: behavior/common.ts:893
Java's GoToTargetLocation: walks to a block memory, scattered by up to one block.
Parameters
locationMemory
MemoryModuleType<{ x: number; y: number; z: number; }>
closeEnoughDist
number
speedModifier
number
Returns
goToWantedItem()
goToWantedItem(
speedModifier,interruptOngoingWalk,maxDistToWalk,predicate?):OneShot
Defined in: behavior/common.ts:861
Java's GoToWantedItem: walks to the item NearestItemSensor picked out.
Parameters
speedModifier
number
interruptOngoingWalk
boolean
maxDistToWalk
number
predicate?
(body) => boolean
Returns
goatActivities()
goatActivities(): readonly
ActivityData[]
Defined in: mobs/goat.ts:261
The goat's four activities: the core package, idle, long_jump and ram.
Returns
readonly ActivityData[]
happyGhastActivities()
happyGhastActivities(): readonly
ActivityData[]
Defined in: mobs/happyGhast.ts:112
The happy ghast's three activities: the core package, idle, and the empty panic that suppresses idling.
Returns
readonly ActivityData[]
has()
has(
entity,condition):boolean
Defined in: behavior/common.ts:46
Whether the mob carries a condition flag.
Parameters
entity
condition
string
Returns
boolean
hearNoteblock()
hearNoteblock(
context,pos):void
Defined in: mobs/allay.ts:46
Java's AllayAi.hearNoteblock: remembers the block and refreshes the 600-tick cooldown.
Parameters
context
pos
x
number
y
number
z
number
Returns
void
hidePackage()
hidePackage(
speedModifier): readonlyPrioritizedBehavior[]
Defined in: mobs/villager.ts:837
Java's getHidePackage.
Parameters
speedModifier
number
Returns
readonly PrioritizedBehavior[]
hoglinActivities()
hoglinActivities(): readonly
ActivityData[]
Defined in: mobs/hoglin.ts:171
The hoglin's four activities: the core package, idle, fight and the avoid retreat.
Returns
readonly ActivityData[]
idlePackage()
idlePackage(
speedModifier): readonlyPrioritizedBehavior[]
Defined in: mobs/villager.ts:741
Java's getIdlePackage.
Parameters
speedModifier
number
Returns
readonly PrioritizedBehavior[]
inflatedEntityBounds()
inflatedEntityBounds(
position,dimensions,amount):EntityBounds
Defined in: world.ts:36
Java's Entity.getBoundingBox().inflate(amount).
Parameters
position
dimensions
amount
number
Returns
interactWith()
interactWith(
type,interactionRange,memory,speedModifier,closeEnough):OneShot
Defined in: behavior/common.ts:989
Java's InteractWith: walks up to a nearby mob of a type and remembers it as an interaction.
Parameters
type
string
interactionRange
number
memory
speedModifier
number
closeEnough
number
Returns
interactWithDoor()
interactWithDoor():
OneShot
Defined in: behavior/common.ts:1048
Java's InteractWithDoor: opens the doors on the current path and closes them behind.
The door state itself is the host's; what the brain owns is DOORS_TO_CLOSE, and that is what this keeps. The behavior is in the core activity of the villager, the piglin, the piglin brute and the copper golem.
Returns
isBarterCurrency()
isBarterCurrency(
item):boolean
Defined in: mobs/piglin.ts:106
Java's PiglinAi.isBarterCurrency: exactly one item, the gold ingot.
Parameters
item
Returns
boolean
isBreeding()
isBreeding(
body):boolean
Defined in: behavior/common.ts:51
Java's BehaviorUtils.isBreeding: the mob is courting or has a breed target.
Parameters
body
Returns
boolean
isLovedItem()
isLovedItem(
item):boolean
Defined in: mobs/piglin.ts:101
Java's PiglinAi.isLovedItem.
Parameters
item
Returns
boolean
isNearZombified()
isNearZombified(
body):boolean
Defined in: mobs/piglin.ts:197
Java's PiglinAi.isNearZombified: a zombified piglin within six blocks pacifies a piglin.
Parameters
body
Returns
boolean
isNotHoldingLovedItemInOffHand()
isNotHoldingLovedItemInOffHand(
body):boolean
Defined in: mobs/piglin.ts:158
Java's PiglinAi.isNotHoldingLovedItemInOffHand.
Parameters
body
Returns
boolean
isPlayerHoldingLovedItem()
isPlayerHoldingLovedItem(
player):boolean
Defined in: mobs/piglin.ts:111
Java's PiglinAi.isPlayerHoldingLovedItem.
Parameters
player
Returns
boolean
isRamTarget()
isRamTarget(
entity,mobGriefing):boolean
Defined in: mobs/goat.ts:66
Java's RAM_TARGET_CONDITIONS: anything but another goat, and an armor stand only while mobGriefing is on.
Parameters
entity
type
string
mobGriefing
boolean
Returns
boolean
isWearingGoldArmor()
isWearingGoldArmor(
player):boolean
Defined in: mobs/piglin.ts:119
Java's PiglinAi.isWearingSafeArmor: any piece of gold armor makes a player safe.
Parameters
player
Returns
boolean
itemDepositPosition()
itemDepositPosition(
context):PositionTracker|undefined
Defined in: mobs/allay.ts:68
Java's AllayAi.getItemDepositPosition: the block above the liked note block, or the liked player, and nothing when neither is valid. The note block memory is erased when the block is gone, out of range or the cooldown ran out.
Parameters
context
Returns
PositionTracker | undefined
lookAtTargetSink()
lookAtTargetSink(
minDuration,maxDuration):BehaviorControl
Defined in: behavior/common.ts:177
Java's LookAtTargetSink: turns the head towards LOOK_TARGET and erases it when done.
Every brain mob has it in its core activity, always as new LookAtTargetSink(45, 90).
Parameters
minDuration
number
maxDuration
number
Returns
makePiglinBrain()
makePiglinBrain(
onBarter?):Brain
Defined in: mobs/piglin.ts:758
Builds a piglin brain, with the host's barter hook wired into the core activity.
Parameters
onBarter?
(context) => void
Returns
makeVillagerBrain()
makeVillagerBrain(
profession,baby):Brain
Defined in: mobs/villager.ts:880
Builds a villager brain for a profession and an age.
Parameters
profession
baby
boolean
Returns
makeWardenBrain()
makeWardenBrain(
anger,canTargetEntity):Brain
Defined in: mobs/warden.ts:636
Builds a warden brain over an anger model the caller owns.
WARDEN_BRAIN's own makeBrain creates a private AngerManagement that targets everything, which is enough to run the activity table; a server that wants the real anger rules builds the manager itself and calls this, because the anger outlives any one brain.
Parameters
anger
canTargetEntity
(entity) => boolean
Returns
meetPackage()
meetPackage(
speedModifier): readonlyPrioritizedBehavior[]
Defined in: mobs/villager.ts:699
Java's getMeetPackage.
Parameters
speedModifier
number
Returns
readonly PrioritizedBehavior[]
meleeAttack()
meleeAttack(
cooldownBetweenAttacks,canAttack?):OneShot
Defined in: behavior/common.ts:617
Java's MeleeAttack: swings when the target is in reach and visible, then holds ATTACK_COOLING_DOWN for the cooldown.
Parameters
cooldownBetweenAttacks
number
canAttack?
(body) => boolean
Returns
moveToTargetSink()
moveToTargetSink(
options?):BehaviorControl
Defined in: behavior/common.ts:214
Java's MoveToTargetSink: the only behavior that drives navigation.
It owns WALK_TARGET, PATH and CANT_REACH_WALK_TARGET_SINCE. A walk target it cannot reach stamps the game time into CANT_REACH_WALK_TARGET_SINCE, which is what stopAttackingIfTargetInvalid reads to give up after 200 ticks.
Parameters
options?
Returns
nautilusActivities()
nautilusActivities(): readonly
ActivityData[]
Defined in: mobs/nautilus.ts:245
The nautilus's three activities: the core package, idle and the dash fight.
Returns
readonly ActivityData[]
ofType()
ofType(
type):EntityPredicate
Defined in: behavior/common.ts:302
Matches by entity type id, the form SetEntityLookTarget.create(EntityType, dist) takes.
Parameters
type
string
Returns
panicPackage()
panicPackage(
speedModifier): readonlyPrioritizedBehavior[]
Defined in: mobs/villager.ts:776
Java's getPanicPackage: the runaway speed is the base speed times 1.5.
Parameters
speedModifier
number
Returns
readonly PrioritizedBehavior[]
piglinActivities()
piglinActivities(
onBarter?): readonlyActivityData[]
Defined in: mobs/piglin.ts:745
The piglin's seven activities: the core package, idle, admire_item, fight, celebrate, the avoid retreat and ride.
Parameters
onBarter?
(context) => void
Called once the piglin stops holding the gold it was admiring, so the host can roll the barter loot table and drop the result.
Returns
readonly ActivityData[]
piglinBruteActivities()
piglinBruteActivities(): readonly
ActivityData[]
Defined in: mobs/piglinBrute.ts:193
The piglin brute's three activities: the core package, idle and fight.
Returns
readonly ActivityData[]
piglinsOutnumberHoglins()
piglinsOutnumberHoglins(
context):boolean
Defined in: mobs/hoglin.ts:83
Java's HoglinAi.piglinsOutnumberHoglins, which decides whether a hoglin flees after a hit.
The comparison is strict: ties favour the hoglin, which is why a one-on-one hoglin stands its ground against a piglin.
Parameters
context
Returns
boolean
playPackage()
playPackage(
speedModifier): readonlyPrioritizedBehavior[]
Defined in: mobs/villager.ts:652
Java's getPlayPackage, the baby villager's whole day.
Parameters
speedModifier
number
Returns
readonly PrioritizedBehavior[]
preRaidPackage()
preRaidPackage(
speedModifier): readonlyPrioritizedBehavior[]
Defined in: mobs/villager.ts:800
Java's getPreRaidPackage.
Parameters
speedModifier
number
Returns
readonly PrioritizedBehavior[]
prioritized()
prioritized(
first,behaviors): readonlyPrioritizedBehavior[]
Defined in: brain.ts:39
Java's ActivityData.createPriorityPairs: numbers a behavior list from first upward.
Parameters
first
number
behaviors
readonly BehaviorControl[]
Returns
readonly PrioritizedBehavior[]
raidPackage()
raidPackage(
speedModifier): readonlyPrioritizedBehavior[]
Defined in: mobs/villager.ts:826
Java's getRaidPackage.
Parameters
speedModifier
number
Returns
readonly PrioritizedBehavior[]
randomLookAround()
randomLookAround(
interval,maxYaw,minPitch,maxPitch):BehaviorControl
Defined in: behavior/common.ts:374
Java's RandomLookAround: picks a direction and writes it as a look target, then holds GAZE_COOLDOWN_TICKS so it does not fire again until the interval elapses.
Parameters
interval
maxYaw
number
minPitch
number
maxPitch
number
Returns
randomStroll()
randomStroll(
speedModifier,medium?,range?,mayStrollFromWater?):OneShot
Defined in: behavior/common.ts:417
Java's RandomStroll.stroll, fly and swim, which differ only in the draw and the guard.
Parameters
speedModifier
number
medium?
"land" | "air" | "water" = 'land'
range?
xzRange
number
yRange
number
mayStrollFromWater?
boolean = true
Returns
rangeOfSeconds()
rangeOfSeconds(
min,max):UniformInt
Defined in: behavior/common.ts:36
Java's TimeUtil.rangeOfSeconds.
Parameters
min
number
max
number
Returns
registerBrainMobs()
registerBrainMobs(
registry):void
Defined in: mobs/index.ts:64
Registers all twenty brain mobs. This is the whole entry point a server needs.
Parameters
registry
Returns
void
resetSniffing()
resetSniffing(
context):void
Defined in: mobs/sniffer.ts:55
Java's SnifferAi.resetSniffing: drops both dig memories and returns the sniffer to idling.
Parameters
context
Returns
void
restPackage()
restPackage(
speedModifier): readonlyPrioritizedBehavior[]
Defined in: mobs/villager.ts:676
Java's getRestPackage.
Parameters
speedModifier
number
Returns
readonly PrioritizedBehavior[]
sample()
sample(
range,randomInt):number
Defined in: behavior/common.ts:41
Draws from a UniformInt.
Parameters
range
randomInt
(bound) => number
Returns
number
scheduledActivity()
scheduledActivity(
schedule,dayTime):Activity
Defined in: brain.ts:85
The activity a Schedule selects for a time of day.
Parameters
schedule
dayTime
number
Returns
sequence()
sequence(
first,second):OneShot
Defined in: behavior/builder.ts:183
Java's BehaviorBuilder.sequence: runs second only when first fired this tick.
Java also unions the two behaviors' required memories, which matters because the brain registers memories from that list.
Parameters
first
second
Returns
setActivity()
setActivity(
activity):OneShot
Defined in: behavior/common.ts:1078
Java's SetActivity-style helper used by the warden and the sniffer to force one activity.
Parameters
activity
Returns
setDigCooldown()
setDigCooldown(
context):void
Defined in: mobs/warden.ts:228
Java's WardenAi.setDigCooldown, and the body of DIG_COOLDOWN_SETTER.
Both check that the memory is already registered before writing it, which is the difference between refreshing a cooldown and creating one.
Parameters
context
Returns
void
setDisturbanceLocation()
setDisturbanceLocation(
context,position):void
Defined in: mobs/warden.ts:206
Java's WardenAi.setDisturbanceLocation: what a heard vibration does to the brain.
It only fires while the warden has neither an angry-at entity nor an attack target, so a warden mid-fight ignores distractions, and it writes four memories with the same 100-tick expiry.
Parameters
context
position
x
number
y
number
z
number
Returns
void
setEntityLookTarget()
setEntityLookTarget(
predicate,maxDist):OneShot
Defined in: behavior/common.ts:307
Java's SetEntityLookTarget: looks at the nearest visible entity matching the predicate.
Parameters
predicate
maxDist
number
Returns
setEntityLookTargetSometimes()
setEntityLookTargetSometimes(
maxDist,interval,predicate?):OneShot
Defined in: behavior/common.ts:334
Java's SetEntityLookTargetSometimes: the same, behind a countdown redrawn from interval.
Java's Ticker refuses an interval whose minimum is 1 or less, and returns false on the tick that reloads the countdown, so the first look happens at the end of the first interval.
Parameters
maxDist
number
interval
predicate?
EntityPredicate = ...
Returns
setLookAndInteract()
setLookAndInteract(
type,interactionRange):OneShot
Defined in: behavior/common.ts:1019
Java's SetLookAndInteract: faces a nearby entity of a type and marks it as the interaction.
Parameters
type
string
interactionRange
number
Returns
setNautilusAngerTarget()
setNautilusAngerTarget(
context,target):void
Defined in: mobs/nautilus.ts:114
Java's NautilusAi.setNautilusAngerTarget: a 400-tick grudge keyed by the attacker's identity.
Parameters
context
target
Returns
void
setPiglinAngerTarget()
setPiglinAngerTarget(
context,target):void
Defined in: mobs/piglin.ts:188
Java's PiglinAi.setPiglinAngerTarget: a 600-tick grudge, keyed by identity.
Parameters
context
target
Returns
void
setPiglinBruteAngerTarget()
setPiglinBruteAngerTarget(
context,target):void
Defined in: mobs/piglinBrute.ts:81
Java's PiglinBruteAi.setPiglinBruteAngerTarget: a 600-tick grudge, as the piglin's is.
Parameters
context
target
Returns
void
setWalkAndLookTargets()
setWalkAndLookTargets(
body,target,speedModifier,closeEnoughDist):void
Defined in: behavior/common.ts:56
Java's BehaviorUtils.setWalkAndLookTargetMemories.
Parameters
body
target
speedModifier
number
closeEnoughDist
number
Returns
void
setWalkTargetAwayFrom()
setWalkTargetAwayFrom<
Value>(memory,toPosition,speedModifier,desiredDistance,interruptCurrentWalk):OneShot
Defined in: behavior/common.ts:463
Java's SetWalkTargetAwayFrom.pos and .entity, which differ only in how they read a position.
Type Parameters
Value
Value
Parameters
memory
MemoryModuleType<Value>
toPosition
(value) => Vec3
speedModifier
number
desiredDistance
number
interruptCurrentWalk
boolean
Returns
setWalkTargetFromAttackTargetIfTargetOutOfReach()
setWalkTargetFromAttackTargetIfTargetOutOfReach(
speedModifier):OneShot
Defined in: behavior/common.ts:588
Java's SetWalkTargetFromAttackTargetIfTargetOutOfReach: closes on the attack target.
Parameters
speedModifier
number | ((body) => number)
Returns
setWalkTargetFromLookTarget()
setWalkTargetFromLookTarget(
speedModifier,closeEnoughDistance,canSet?):OneShot
Defined in: behavior/common.ts:441
Java's SetWalkTargetFromLookTarget: walks to wherever the mob is already looking.
Parameters
speedModifier
number | ((body) => number)
closeEnoughDistance
number
canSet?
(body, context) => boolean
Returns
showTradesToPlayer()
showTradesToPlayer(
minDuration,maxDuration):BehaviorControl
Defined in: mobs/villager.ts:332
Java's ShowTradesToPlayer: a grown villager talking to a player within about four blocks holds up the items of its trades, one after the other, and empties its hand when it stops.
Parameters
minDuration
number
maxDuration
number
Returns
snifferActivities()
snifferActivities(): readonly
ActivityData[]
Defined in: mobs/sniffer.ts:338
The sniffer's four activities: the core package, idle, sniff and dig.
Returns
readonly ActivityData[]
startAttacking()
startAttacking(
find,canAttack?):OneShot
Defined in: behavior/common.ts:522
Java's StartAttacking: writes ATTACK_TARGET and clears the unreachable stamp.
The entry condition is ATTACK_TARGET absent, so a mob already fighting never re-targets through this behavior; that is what stopAttackingIfTargetInvalid is for.
Parameters
find
canAttack?
(context) => boolean
Returns
startEmerging()
startEmerging(
context):void
Defined in: mobs/warden.ts:622
Java's Warden.finalizeSpawn branch for a warden summoned by a sculk shrieker: it poses as emerging and holds IS_EMERGING for the emerge animation.
Parameters
context
Returns
void
stopAttackingIfTargetInvalid()
stopAttackingIfTargetInvalid(
options?):OneShot
Defined in: behavior/common.ts:559
Java's StopAttackingIfTargetInvalid: erases ATTACK_TARGET when it died, left, became un-attackable, or has been unreachable for 200 ticks.
Parameters
options?
StopAttackingOptions = {}
Returns
strollAroundPoi()
strollAroundPoi(
memory,speedModifier,maxDistanceFromPoi):OneShot
Defined in: behavior/common.ts:952
Java's StrollAroundPoi: wanders near a point of interest, at most once every 180 ticks.
Parameters
memory
MemoryModuleType<{ dimension: string; pos: { x: number; y: number; z: number; }; }>
speedModifier
number
maxDistanceFromPoi
number
Returns
strollToPoi()
strollToPoi(
memory,speedModifier,closeEnoughDist,maxDistanceFromPoi):OneShot
Defined in: behavior/common.ts:920
Java's StrollToPoi: walks to a point-of-interest memory, at most once every 80 ticks.
Parameters
memory
MemoryModuleType<{ dimension: string; pos: { x: number; y: number; z: number; }; }>
speedModifier
number
closeEnoughDist
number
maxDistanceFromPoi
number
Returns
swim()
swim(
chance):BehaviorControl
Defined in: behavior/common.ts:75
Java's Swim: jumps with probability chance each tick while the mob is in a floatable fluid.
Every mob that can drown has it at priority 0 of its core activity.
Parameters
chance
number
Returns
tadpoleActivities()
tadpoleActivities(): readonly
ActivityData[]
Defined in: mobs/tadpole.ts:66
The tadpole's two activities: the core package and idle.
Returns
readonly ActivityData[]
timedState()
timedState(
name,duration,options?):BehaviorControl
Defined in: behavior/common.ts:1092
A behavior whose body is a memory state machine on a timer: start writes the memory, the body runs for duration ticks and the end erases it.
Java spells these out one class each (Emerging, Digging, Roar, Sniffing, PlayDead), and they differ only in the memory, the duration, the pose and the sound.
Parameters
name
string
duration
number
options?
condition?
string
entryCondition?
eraseOnStop?
readonly MemoryModuleType<unknown>[]
onStart?
(context) => void
onStop?
(context) => void
startSound?
string
Returns
toPositionTracker()
toPositionTracker(
target):PositionTracker
Defined in: world.ts:471
Coerces the three shapes Java's WalkTarget constructors accept into a tracker.
Parameters
target
Vec3 | PositionTracker | BrainEntity
Returns
tradeWithVillager()
tradeWithVillager():
BehaviorControl
Defined in: mobs/villager.ts:374
Java's TradeWithVillager: food and seeds change hands between two villagers who meet.
Returns
triggerGate()
triggerGate(
behaviors,orderPolicy,runningPolicy):OneShot
Defined in: behavior/gate.ts:179
Java's TriggerGate.triggerGate: a gate over plain triggers.
The difference from GateBehavior is that the result is a single OneShot: the triggers fire inside one tick and nothing stays running, so the gate never occupies a priority slot across ticks.
Parameters
behaviors
readonly WeightedTrigger[]
orderPolicy
runningPolicy
Returns
triggerIf()
triggerIf(
name,predicate):OneShot
Defined in: behavior/builder.ts:173
Java's BehaviorBuilder.triggerIf(Predicate): runs when the body satisfies the predicate.
Parameters
name
string
predicate
(body, context) => boolean
Returns
triggerOneShuffled()
triggerOneShuffled(
behaviors):OneShot
Defined in: behavior/gate.ts:202
Java's TriggerGate.triggerOneShuffled.
Parameters
behaviors
readonly WeightedTrigger[]
Returns
uniformInt()
uniformInt(
min,max):UniformInt
Defined in: behavior/common.ts:31
Builds a UniformInt. Java's UniformInt.of.
Parameters
min
number
max
number
Returns
updateActivityFromSchedule()
updateActivityFromSchedule():
OneShot
Defined in: behavior/common.ts:1070
Java's UpdateActivityFromSchedule: the behavior at priority 99 of every villager activity.
It is how a villager leaves work for meet on its own rather than waiting for a tick hook.
Returns
villagerActivities()
villagerActivities(
profession,baby): readonlyActivityData[]
Defined in: mobs/villager.ts:852
Java's Villager.BRAIN_PROVIDER activity supplier.
work needs a job site and meet needs a meeting point, which is what keeps the schedule from sending an unemployed villager to a workplace it does not have; both fall back to idle through setActiveActivityIfPossible.
Parameters
profession
baby
boolean
Returns
readonly ActivityData[]
villagerMakeLove()
villagerMakeLove():
BehaviorControl
Defined in: mobs/villager.ts:404
Java's VillagerMakeLove: the two walk to each other, and when they have stayed a while the host decides whether a child comes.
Returns
visibleEntities()
visibleEntities(
entities):NearestVisibleLivingEntities
Defined in: memory.ts:66
Builds a NearestVisibleLivingEntities over an already-sorted, already-visible list.
Parameters
entities
readonly BrainEntity[]
Returns
walkTarget()
walkTarget(
target,speedModifier,closeEnoughDist):WalkTarget
Defined in: world.ts:462
Builds a WalkTarget over a block, a position, an entity or a tracker.
Parameters
target
Vec3 | PositionTracker | BrainEntity
speedModifier
number
closeEnoughDist
number
Returns
wantsToPickUp()
wantsToPickUp(
item,context):boolean
Defined in: mobs/piglin.ts:131
Java's PiglinAi.wantsToPickup, the rule that decides what a piglin picks off the ground.
Reading it in order is the clearest statement of the gold-armor economy: repellents are never picked up, a baby skips the items in #minecraft:ignored_by_piglin_babies, a gold ingot is taken only when the off hand is free, food is taken only when the piglin has not eaten, and anything else goes by whether it beats what the piglin already holds.
Parameters
item
context
Returns
boolean
wardenActivities()
wardenActivities(
anger,followRange): readonlyActivityData[]
Defined in: mobs/warden.ts:594
The warden's eight activities: the core package, emerge, dig, idle, roar, fight, investigate and sniff.
Parameters
anger
The anger model the roar, the fight and the sniff read and write.
followRange
number
Blocks the warden will chase a target over before giving up.
Returns
readonly ActivityData[]
workPackage()
workPackage(
profession,speedModifier): readonlyPrioritizedBehavior[]
Defined in: mobs/villager.ts:619
Java's getWorkPackage. The farmer's two farming weights differ from everyone else's.
Parameters
profession
speedModifier
number
Returns
readonly PrioritizedBehavior[]
zoglinActivities()
zoglinActivities(): readonly
ActivityData[]
Defined in: mobs/zoglin.ts:98
The zoglin's three activities: the core package, idle and fight.
Returns
readonly ActivityData[]
zombieNautilusActivities()
zombieNautilusActivities(): readonly
ActivityData[]
Defined in: mobs/nautilus.ts:311
The zombie nautilus's three activities. Same shape as the nautilus's, with its own dash speed and sound.
Returns
readonly ActivityData[]