Skip to content

API reference / @jsprismarine/entity-brains

@jsprismarine/entity-brains ​

Join the Discord Servernpm

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.

typescript
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 ​

RegistryNoteMeasuredWhere
minecraft:memory_module_type115115MemoryModuleType.<clinit>
minecraft:sensor_type2424SensorType.<clinit>
minecraft:activity2626Activity.<clinit>
Mobs with a brain2020brainProvider 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.

typescript
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.

MobActivitiesGated bySensors
allaycore (0), idle (0)4
armadillocore (0), idle (0 to 4), panic (0)panic: DANGER_DETECTED_RECENTLY present and IS_PANICKING absent5
axolotlcore (0), idle (0 to 4), fight (0), play_dead (0)fight: ATTACK_TARGET; play_dead: PLAY_DEAD_TICKS5
breezecore (0), idle (0 to 3), fight (0 to 4)fight: ATTACK_TARGET present, WALK_TARGET absent4
camelcore (0), idle (0 to 4)4
copper golemcore (0), idle (0 to 2)2
creakingcore (0), idle (10), fight (10)fight: ATTACK_TARGET2
frogcore (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_JUMP5
goatcore (0), idle (0 to 3), long_jump (0 to 1), ram (0 to 1)idle needs both cooldowns present6
happy ghastcore (0), idle (1 to 4), panic (no behaviors)panic: IS_PANICKING5
hoglincore (0), idle (10), fight (10), avoid (10)fight: ATTACK_TARGET; avoid: AVOID_TARGET4
nautiluscore (0), idle (1 to 4), fight (0)fight: four memory conditions5
piglincore (0), idle (10), admire_item (10), fight (10), celebrate (10), avoid (10), ride (10)one memory each5
piglin brutecore (0), idle (10), fight (10)fight: ATTACK_TARGET5
sniffercore (0), idle (0 to 4), sniff (0), dig (0)sniff and dig: three memories each4
tadpolecore (0), idle (0 to 2)4
villagercore (0 to 10), work, play, rest, meet, idle, panic, pre_raid, raid, hidework: JOB_SITE; meet: MEETING_POINT9
wardencore (0), emerge (5), dig (0 to 1), idle (10), roar (10), fight (10), investigate (5), sniff (5)one memory each2
zoglincore (0), idle (10), fight (10)fight: ATTACK_TARGET2
zombie nautiluscore (0), idle (1 to 3), fight (0)fight: four memory conditions5

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.

TickAdultBaby
10idleidle
2000work
3000play
6000idle
9000meet
10000play
11000idle
12000restrest

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.

typescript
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's onBarter hook so the host can roll the active minecraft:barter table; the allay and copper golem write their memories and leave the item move to the host.
  • Block effects. The frog's TryLaySpawnOnFluidNearLand leaves block placement to the host. The sniffer checks minecraft: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_boom damage, 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. VillagerProfession carries 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 through BrainWorld.villagerTask: baking bread and composting at a composter (WorkAtComposter, as a WorkAtPoi at a composter block), harvesting, sowing and bone-mealing crops (HarvestFarmland, UseBonemeal, farmers only, through villagerWorkSpot), sharing food and wheat (TradeWithVillager), thanking a hero (GiveGiftToHero) and having a child (VillagerMakeLove). WorkAtPoi also asks the host to restock the villager's trades. The trades themselves belong to @jsprismarine/trading. ShowTradesToPlayer cycles the items of its trades in the villager's hand through villagerShowTrade.
  • 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 EntityCondition here 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.

sh
pnpm --filter @jsprismarine/entity-brains exec vitest run

Classes ​

Interfaces ​

Activity ​

Defined in: activity.ts:9

An activity. Equality is by name, as Java's Activity.equals is.

Properties ​

name ​

readonly name: 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 ​

readonly activity: Activity

Defined in: brain.ts:31

behaviors ​

readonly behaviors: readonly PrioritizedBehavior[]

Defined in: brain.ts:32

conditions ​

readonly conditions: readonly ActivityCondition[]

Defined in: brain.ts:33

memoriesToEraseWhenStopped ​

readonly memoriesToEraseWhenStopped: readonly MemoryModuleType<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? ​

readonly optional conditions?: readonly ActivityCondition[]

Defined in: brain.ts:45

gatedBy? ​

readonly optional gatedBy?: 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? ​

readonly optional memoriesToEraseWhenStopped?: readonly MemoryModuleType<unknown>[]

Defined in: brain.ts:46


AnimalPanicOptions ​

Defined in: behavior/common.ts:95

Options for animalPanic.

Properties ​

extraStartConditions? ​

readonly optional extraStartConditions?: (context) => boolean

Defined in: behavior/common.ts:100

Parameters ​
context ​

BrainContext

Returns ​

boolean

flyHeight? ​

readonly optional flyHeight?: 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? ​

readonly optional onStart?: (context) => void

Defined in: behavior/common.ts:101

Parameters ​
context ​

BrainContext

Returns ​

void

panicCausingDamageTypes? ​

readonly optional panicCausingDamageTypes?: 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 ​

readonly name: string

Defined in: behavior/control.ts:35

The Java class name, which is what a debug read-out shows.

requiredMemories ​

readonly requiredMemories: readonly MemoryModuleType<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 ​

readonly status: 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 ​

BrainContext

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 ​

BrainContext

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 ​

BrainContext

timestamp ​

number

Returns ​

boolean


BehaviorDuration ​

Defined in: behavior/control.ts:64

How long a Behavior may run before it times out.

Properties ​

maxDuration ​

readonly maxDuration: number

Defined in: behavior/control.ts:66

minDuration ​

readonly minDuration: number

Defined in: behavior/control.ts:65


BehaviorHooks ​

Defined in: behavior/control.ts:51

The hooks a Behavior subclass overrides.

Methods ​

canStillUse()? ​

optional canStillUse(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 ​

BrainContext

timestamp ​

number

Returns ​

boolean

checkExtraStartConditions()? ​

optional checkExtraStartConditions(context): boolean

Defined in: behavior/control.ts:53

Java's checkExtraStartConditions, run after the memory conditions pass.

Parameters ​
context ​

BrainContext

Returns ​

boolean

start()? ​

optional start(context, timestamp): void

Defined in: behavior/control.ts:54

Parameters ​
context ​

BrainContext

timestamp ​

number

Returns ​

void

stop()? ​

optional stop(context, timestamp): void

Defined in: behavior/control.ts:56

Parameters ​
context ​

BrainContext

timestamp ​

number

Returns ​

void

tick()? ​

optional tick(context, timestamp): void

Defined in: behavior/control.ts:55

Parameters ​
context ​

BrainContext

timestamp ​

number

Returns ​

void

timedOut()? ​

optional timedOut(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 ​

readonly x: number

Defined in: world.ts:64

y ​

readonly y: number

Defined in: world.ts:65

z ​

readonly z: 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 ​

readonly body: BrainMob

Defined in: world.ts:386

world ​

readonly world: 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? ​

readonly optional entity?: BrainEntity

Defined in: memory.ts:37

The entity that caused the damage, when there was one.

tags ​

readonly tags: ReadonlySet<string>

Defined in: memory.ts:35

Every damage type tag, such as minecraft:panic_environmental_causes.

type ​

readonly type: 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 ​

readonly activities: readonly ActivityData[]

Defined in: brain.ts:104

coreActivities? ​

readonly optional coreActivities?: readonly Activity[]

Defined in: brain.ts:107

Defaults to core, which is what every vanilla brain uses.

defaultActivity? ​

readonly optional defaultActivity?: Activity

Defined in: brain.ts:109

Defaults to idle, as Java's field initializer does.

memories? ​

readonly optional memories?: readonly MemoryModuleType<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? ​

readonly optional schedule?: Schedule

Defined in: brain.ts:105

sensors ​

readonly sensors: readonly Sensor[]

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 ​

readonly alive: boolean

Defined in: world.ts:212

armorItems? ​

readonly optional armorItems?: readonly BrainItem[]

Defined in: world.ts:221

baby ​

readonly baby: boolean

Defined in: world.ts:213

conditions ​

readonly conditions: EntityConditions

Defined in: world.ts:218

See EntityConditions.

dimensions? ​

readonly optional dimensions?: EntityDimensions

Defined in: world.ts:209

Its Java collision box, when the host can provide it.

eyePosition? ​

readonly optional eyePosition?: Vec3

Defined in: world.ts:211

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

id ​

readonly id: string

Defined in: world.ts:202

A stable identity, used wherever Java stores a UUID in a memory.

mainHandItem? ​

readonly optional mainHandItem?: BrainItem

Defined in: world.ts:219

offHandItem? ​

readonly optional offHandItem?: BrainItem

Defined in: world.ts:220

position ​

readonly position: Vec3

Defined in: world.ts:207

spectator ​

readonly spectator: boolean

Defined in: world.ts:214

type ​

readonly type: string

Defined in: world.ts:204

The entity type id, such as minecraft:piglin.

typeTags ​

readonly typeTags: ReadonlySet<string>

Defined in: world.ts:206

The entity type tags, such as minecraft:axolotl_hunt_targets.

Methods ​

canBeTargeted()? ​

optional canBeTargeted(): 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 ​

readonly id: string

Defined in: world.ts:127

The item id, such as minecraft:gold_ingot.

tags ​

readonly tags: 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 ​

readonly alive: boolean

Defined in: world.ts:212

Inherited from ​

BrainEntity.alive

armorItems? ​

readonly optional armorItems?: readonly BrainItem[]

Defined in: world.ts:221

Inherited from ​

BrainEntity.armorItems

baby ​

readonly baby: boolean

Defined in: world.ts:213

Inherited from ​

BrainEntity.baby

conditions ​

readonly conditions: EntityConditions

Defined in: world.ts:218

See EntityConditions.

Inherited from ​

BrainEntity.conditions

count ​

readonly count: number

Defined in: world.ts:135

dimensions? ​

readonly optional dimensions?: EntityDimensions

Defined in: world.ts:209

Its Java collision box, when the host can provide it.

Inherited from ​

BrainEntity.dimensions

eyePosition? ​

readonly optional eyePosition?: Vec3

Defined in: world.ts:211

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

Inherited from ​

BrainEntity.eyePosition

id ​

readonly id: string

Defined in: world.ts:202

A stable identity, used wherever Java stores a UUID in a memory.

Inherited from ​

BrainEntity.id

item ​

readonly item: BrainItem

Defined in: world.ts:134

mainHandItem? ​

readonly optional mainHandItem?: BrainItem

Defined in: world.ts:219

Inherited from ​

BrainEntity.mainHandItem

offHandItem? ​

readonly optional offHandItem?: BrainItem

Defined in: world.ts:220

Inherited from ​

BrainEntity.offHandItem

position ​

readonly position: Vec3

Defined in: world.ts:207

Inherited from ​

BrainEntity.position

spectator ​

readonly spectator: boolean

Defined in: world.ts:214

Inherited from ​

BrainEntity.spectator

type ​

readonly type: string

Defined in: world.ts:204

The entity type id, such as minecraft:piglin.

Inherited from ​

BrainEntity.type

typeTags ​

readonly typeTags: ReadonlySet<string>

Defined in: world.ts:206

The entity type tags, such as minecraft:axolotl_hunt_targets.

Inherited from ​

BrainEntity.typeTags

Methods ​

canBeTargeted()? ​

optional canBeTargeted(): boolean

Defined in: world.ts:216

A live check for whether combat AI may choose this entity as a target.

Returns ​

boolean

Inherited from ​

BrainEntity.canBeTargeted


BrainMob ​

Defined in: world.ts:241

The body a brain drives.

Extends ​

Properties ​

alive ​

readonly alive: boolean

Defined in: world.ts:212

Inherited from ​

BrainEntity.alive

armorItems? ​

readonly optional armorItems?: readonly BrainItem[]

Defined in: world.ts:221

Inherited from ​

BrainEntity.armorItems

baby ​

readonly baby: boolean

Defined in: world.ts:213

Inherited from ​

BrainEntity.baby

brain ​

readonly brain: Brain

Defined in: world.ts:242

conditions ​

readonly conditions: EntityConditions

Defined in: world.ts:218

See EntityConditions.

Inherited from ​

BrainEntity.conditions

dimensions? ​

readonly optional dimensions?: EntityDimensions

Defined in: world.ts:209

Its Java collision box, when the host can provide it.

Inherited from ​

BrainEntity.dimensions

eyePosition? ​

readonly optional eyePosition?: Vec3

Defined in: world.ts:211

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

Inherited from ​

BrainEntity.eyePosition

id ​

readonly id: string

Defined in: world.ts:202

A stable identity, used wherever Java stores a UUID in a memory.

Inherited from ​

BrainEntity.id

mainHandItem? ​

readonly optional mainHandItem?: BrainItem

Defined in: world.ts:219

Inherited from ​

BrainEntity.mainHandItem

readonly navigation: BrainNavigation

Defined in: world.ts:243

offHandItem? ​

readonly optional offHandItem?: BrainItem

Defined in: world.ts:220

Inherited from ​

BrainEntity.offHandItem

position ​

readonly position: Vec3

Defined in: world.ts:207

Inherited from ​

BrainEntity.position

spectator ​

readonly spectator: boolean

Defined in: world.ts:214

Inherited from ​

BrainEntity.spectator

type ​

readonly type: string

Defined in: world.ts:204

The entity type id, such as minecraft:piglin.

Inherited from ​

BrainEntity.type

typeTags ​

readonly typeTags: ReadonlySet<string>

Defined in: world.ts:206

The entity type tags, such as minecraft:axolotl_hunt_targets.

Inherited from ​

BrainEntity.typeTags

Methods ​

attack() ​

attack(target): void

Defined in: world.ts:251

Java's Mob::doHurtTarget, with the swing.

Parameters ​
target ​

BrainEntity

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()? ​

optional canBeTargeted(): boolean

Defined in: world.ts:216

A live check for whether combat AI may choose this entity as a target.

Returns ​

boolean

Inherited from ​

BrainEntity.canBeTargeted

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 ​

Vec3

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 ​

readonly alsoRunsGoals: 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 ​

readonly id: string

Defined in: registry.ts:29

The entity type id, such as minecraft:piglin.

memories ​

readonly memories: readonly MemoryModuleType<unknown>[]

Defined in: registry.ts:31

The memory types the mob declares beyond the ones its sensors and behaviors require.

sensorTypes ​

readonly sensorTypes: 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()? ​

optional initMemories(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 ​

BrainContext

Returns ​

void

makeBrain() ​

makeBrain(options?): Brain

Defined in: registry.ts:42

Builds the brain. Java's Brain.Provider.makeBrain.

Parameters ​
options? ​

BrainMobOptions

Returns ​

Brain

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 ​

BrainContext

Returns ​

void


BrainMobOptions ​

Defined in: registry.ts:14

What a host knows about a body before its brain exists.

Properties ​

baby? ​

readonly optional baby?: boolean

Defined in: registry.ts:16

A baby villager gets the play activity and the baby schedule instead of work.

onBarter? ​

readonly optional onBarter?: (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 ​

BrainContext

Returns ​

void

variant? ​

readonly optional variant?: 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 ​

Vec3

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 ​

Vec3

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 ​

readonly target: 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 ​

readonly dimension: 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 ​

BlockPos

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 ​

BlockPos

Returns ​

ReadonlySet<string>

canSee() ​

canSee(body, target): boolean

Defined in: world.ts:309

Whether body can see target, Java's Mob::hasLineOfSight.

Parameters ​
body ​

BrainEntity

target ​

BrainEntity

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 ​

BlockPos

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 ​

BlockPos

claimant ​

BrainEntity

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 ​

BrainMob

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 ​

Vec3

source? ​

BrainEntity

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 ​

BlockPos

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 ​

BrainEntity

target ​

BrainEntity

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 ​

BrainEntity

target ​

BrainEntity

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 ​

BrainEntity

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 ​

BlockPos

Returns ​

boolean

isWithinMeleeRange() ​

isWithinMeleeRange(body, target): boolean

Defined in: world.ts:321

Java's Mob::isWithinMeleeAttackRange.

Parameters ​
body ​

BrainEntity

target ​

BrainEntity

Returns ​

boolean

itemEntitiesNear() ​

itemEntitiesNear(center, xzRange, yRange): readonly BrainItemEntity[]

Defined in: world.ts:307

Every dropped item within the given box half-extents of center.

Parameters ​
center ​

Vec3

xzRange ​

number

yRange ​

number

Returns ​

readonly BrainItemEntity[]

livingEntitiesNear() ​

livingEntitiesNear(center, radius, exclude, excludeDimensions?): readonly BrainEntity[]

Defined in: world.ts:298

Every living entity whose box intersects exclude's box inflated by radius, nearest first.

Parameters ​
center ​

Vec3

radius ​

number

exclude ​

BrainEntity

excludeDimensions? ​

EntityDimensions

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 ​

Vec3

Returns ​

void

pointsOfInterest() ​

pointsOfInterest(center, radius, type): readonly PoiRecord[]

Defined in: world.ts:343

Java's PoiManager::findAll: points of interest of a type within radius of center.

Parameters ​
center ​

BlockPos

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 ​

BrainEntity

request ​

RandomPosRequest

Returns ​

Vec3 | undefined

releasePoi() ​

releasePoi(pos, claimant): void

Defined in: world.ts:347

Releases a ticket taken by BrainWorld.claimPoi.

Parameters ​
pos ​

BlockPos

claimant ​

BrainEntity

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 ​

BrainMob

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 ​

BrainMob

target ​

BrainEntity

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 ​

BrainMob

partner ​

BrainEntity

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 ​

BrainMob

effect ​

VillagerRaidEffect

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 ​

BrainMob

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 ​

BrainMob

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 ​

BrainMob

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 ​

BrainMob

task ​

VillagerTask

target? ​

BlockPos | BrainEntity

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 ​

BrainMob

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 ​

readonly max: Vec3

Defined in: world.ts:32

min ​

readonly min: 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 ​

readonly height: number

Defined in: world.ts:26

The height above the entity's position.

width ​

readonly width: number

Defined in: world.ts:24

The width across both horizontal axes.


GateOptions ​

Defined in: behavior/gate.ts:55

Options for GateBehavior.

Properties ​

entryCondition? ​

readonly optional entryCondition?: MemoryConditions

Defined in: behavior/gate.ts:57

exitErasedMemories? ​

readonly optional exitErasedMemories?: readonly MemoryModuleType<unknown>[]

Defined in: behavior/gate.ts:59

Erased when the gate stops. Java's exitErasedMemories.

name? ​

readonly optional name?: 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 ​

readonly dimension: string

Defined in: world.ts:71

pos ​

readonly pos: 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 ​

readonly name: string

Defined in: memory.ts:80

The registered name without its namespace, such as attack_target.

valueType? ​

readonly optional valueType?: 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? ​

readonly optional extraStartConditions?: (context) => boolean

Defined in: behavior/common.ts:202

Parameters ​
context ​

BrainContext

Returns ​

boolean

maxDuration? ​

readonly optional maxDuration?: number

Defined in: behavior/common.ts:201

minDuration? ​

readonly optional minDuration?: number

Defined in: behavior/common.ts:200

Java's default is (150, 250); the sniffer uses (500, 700) and the breeze (20, 40).

onStart? ​

readonly optional onStart?: (context) => void

Defined in: behavior/common.ts:203

Parameters ​
context ​

BrainContext

Returns ​

void

onStop? ​

readonly optional onStop?: (context) => void

Defined in: behavior/common.ts:204

Parameters ​
context ​

BrainContext

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 ​

BrainEntity

Returns ​

boolean

findAll() ​

findAll(predicate): readonly BrainEntity[]

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 ​

readonly hasSpace: boolean

Defined in: world.ts:282

Whether the point of interest still has a free ticket.

pos ​

readonly pos: BlockPos

Defined in: world.ts:278

type ​

readonly type: 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? ​

readonly optional entity?: 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 ​

BlockPos

currentPosition() ​

currentPosition(): Vec3

Defined in: world.ts:107

The position to aim at this tick.

Returns ​

Vec3


PresentMemory ​

Defined in: behavior/builder.ts:42

An accessor for a memory the behavior required to be present.

Extends ​

Type Parameters ​

Value ​

Value

Methods ​

erase() ​

erase(): void

Defined in: behavior/builder.ts:38

Returns ​

void

Inherited from ​

MemoryWriter.erase

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 ​

MemoryWriter.set

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 ​

MemoryWriter.setOrErase

setWithExpiry() ​

setWithExpiry(value, timeToLive): void

Defined in: behavior/builder.ts:35

Parameters ​
value ​

Value

timeToLive ​

number

Returns ​

void

Inherited from ​

MemoryWriter.setWithExpiry


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? ​

readonly optional away?: Vec3

Defined in: world.ts:271

Bias the draw away from this position. Java's getPosAway.

medium ​

readonly medium: "land" | "air" | "water"

Defined in: world.ts:269

land is LandRandomPos, air is AirRandomPos, water is the swimmable draw.

towards? ​

readonly optional towards?: Vec3

Defined in: world.ts:273

Bias the draw towards this position. Java's getPosTowards.

xzRange ​

readonly xzRange: number

Defined in: world.ts:266

yRange ​

readonly yRange: 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 ​

Type Parameters ​

Value ​

Value

Methods ​

erase() ​

erase(): void

Defined in: behavior/builder.ts:38

Returns ​

void

Inherited from ​

MemoryWriter.erase

set() ​

set(value): void

Defined in: behavior/builder.ts:34

Parameters ​
value ​

Value

Returns ​

void

Inherited from ​

MemoryWriter.set

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 ​

MemoryWriter.setOrErase

setWithExpiry() ​

setWithExpiry(value, timeToLive): void

Defined in: behavior/builder.ts:35

Parameters ​
value ​

Value

timeToLive ​

number

Returns ​

void

Inherited from ​

MemoryWriter.setWithExpiry

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 ​

readonly keyframes: readonly (readonly [number, Activity])[]

Defined in: brain.ts:81

periodTicks ​

readonly periodTicks: number

Defined in: brain.ts:80


StopAttackingOptions ​

Defined in: behavior/common.ts:547

Options for stopAttackingIfTargetInvalid.

Properties ​

canGrowTired? ​

readonly optional canGrowTired?: boolean

Defined in: behavior/common.ts:552

Java's canGrowTiredOfTryingToReachTarget, true for every use but the warden's.

onTargetErased? ​

readonly optional onTargetErased?: (context, target) => void

Defined in: behavior/common.ts:550

Parameters ​
context ​

BrainContext

target ​

BrainEntity

Returns ​

void

stopAttackingWhen? ​

readonly optional stopAttackingWhen?: (context, target) => boolean

Defined in: behavior/common.ts:549

An extra reason to drop the target.

Parameters ​
context ​

BrainContext

target ​

BrainEntity

Returns ​

boolean


TestEntityOptions ​

Defined in: testWorld.ts:47

What a test says about an entity it places.

Properties ​

alive? ​

readonly optional alive?: boolean

Defined in: testWorld.ts:51

armorItems? ​

readonly optional armorItems?: readonly BrainItem[]

Defined in: testWorld.ts:59

attributes? ​

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

Defined in: testWorld.ts:60

baby? ​

readonly optional baby?: boolean

Defined in: testWorld.ts:52

conditions? ​

readonly optional conditions?: readonly string[]

Defined in: testWorld.ts:56

creative? ​

readonly optional creative?: boolean

Defined in: testWorld.ts:54

dimensions? ​

readonly optional dimensions?: EntityDimensions

Defined in: testWorld.ts:50

id? ​

readonly optional id?: string

Defined in: testWorld.ts:48

mainHandItem? ​

readonly optional mainHandItem?: BrainItem

Defined in: testWorld.ts:57

offHandItem? ​

readonly optional offHandItem?: BrainItem

Defined in: testWorld.ts:58

position? ​

readonly optional position?: Vec3

Defined in: testWorld.ts:49

spectator? ​

readonly optional spectator?: boolean

Defined in: testWorld.ts:53

typeTags? ​

readonly optional typeTags?: readonly string[]

Defined in: testWorld.ts:55


TestWorldOptions ​

Defined in: testWorld.ts:243

How a test sets up its world.

Properties ​

attackable? ​

readonly optional attackable?: (body, target) => boolean

Defined in: testWorld.ts:255

Whether a target is attackable. Defaults to anything alive that is not the body.

Parameters ​
body ​

BrainEntity

target ​

BrainEntity

Returns ​

boolean

dayTime? ​

readonly optional dayTime?: number

Defined in: testWorld.ts:246

dimension? ​

readonly optional dimension?: string

Defined in: testWorld.ts:244

gameTime? ​

readonly optional gameTime?: number

Defined in: testWorld.ts:245

lineOfSight? ​

readonly optional lineOfSight?: (body, target) => boolean

Defined in: testWorld.ts:253

Whether an entity can see another. Defaults to always.

Parameters ​
body ​

BrainEntity

target ​

BrainEntity

Returns ​

boolean

meleeRange? ​

readonly optional meleeRange?: number

Defined in: testWorld.ts:257

The melee reach, in blocks. Defaults to 2.

randomValues? ​

readonly optional randomValues?: readonly number[]

Defined in: testWorld.ts:251

The values BrainWorld.random returns, consumed in order and then repeating the last. Defaults to always returning 0.

villagerRaidState? ​

readonly optional villagerRaidState?: 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 ​

readonly max: number

Defined in: behavior/common.ts:27

min ​

readonly min: number

Defined in: behavior/common.ts:26


Vec3 ​

Defined in: world.ts:15

A position in world space. Java's Vec3.

Properties ​

x ​

readonly x: number

Defined in: world.ts:16

y ​

readonly y: number

Defined in: world.ts:17

z ​

readonly z: 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 ​

readonly id: string

Defined in: mobs/villager.ts:114

The profession id, such as minecraft:farmer.

jobSitePoi ​

readonly jobSitePoi: string

Defined in: mobs/villager.ts:116

The point-of-interest type the profession works at, such as minecraft:farmer.

secondaryPoiBlocks ​

readonly secondaryPoiBlocks: 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 ​

readonly betweenWaves: boolean

Defined in: world.ts:80

The raid is between waves and its villagers should prepare for the next one.

hasStarted ​

readonly hasStarted: boolean

Defined in: world.ts:78

At least one wave has spawned.

victory ​

readonly victory: 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 ​

readonly closeEnoughDist: number

Defined in: world.ts:118

speedModifier ​

readonly speedModifier: number

Defined in: world.ts:117

target ​

readonly target: 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 ​

BrainContext

entity ​

BrainEntity

Returns ​

boolean

clearAnger() ​

clearAnger(context, entity): void

Defined in: mobs/warden.ts:564

Java's Warden::clearAnger.

Parameters ​
context ​

BrainContext

entity ​

BrainEntity

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 ​

BrainContext

Returns ​

BrainEntity | undefined

increaseAngerAt()? ​

optional increaseAngerAt(context, entity, amount): void

Defined in: mobs/warden.ts:566

Java's Warden::increaseAngerAt, which Roar calls with 20 and no sound.

Parameters ​
context ​

BrainContext

entity ​

BrainEntity

amount ​

number

Returns ​

void

isAngry() ​

isAngry(context): boolean

Defined in: mobs/warden.ts:560

Java's Warden::getAngerLevel().isAngry().

Parameters ​
context ​

BrainContext

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 typeof EntityCondition]

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 ​

BrainEntity

context ​

BrainContext

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 ​

BrainContext

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 ​

BrainContext

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 ​

BrainItem

context ​

BrainContext

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 ​

const ALLAY: object

Defined in: mobs/allay.ts:28

The named constants of AllayAi.

Type Declaration ​

closeEnoughToTarget ​

readonly closeEnoughToTarget: 4 = 4

distanceToWantedItem ​

readonly distanceToWantedItem: 32 = 32

giveItemTimeoutDuration ​

readonly giveItemTimeoutDuration: 20 = 20

itemPickupCooldownDuration ​

readonly itemPickupCooldownDuration: 60 = 60

maxLookDistance ​

readonly maxLookDistance: 6 = 6

noteblockRememberDistance ​

readonly noteblockRememberDistance: 1024 = 1024

The horizontal reach of GlobalPos::isCloseEnough for the liked note block.

speedWhenFollowingDepositTarget ​

readonly speedWhenFollowingDepositTarget: 2.25 = 2.25

speedWhenIdling ​

readonly speedWhenIdling: 1 = 1

speedWhenPanicking ​

readonly speedWhenPanicking: 2.5 = 2.5

speedWhenRetrievingItem ​

readonly speedWhenRetrievingItem: 1.75 = 1.75

timeToForgetNoteblock ​

readonly timeToForgetNoteblock: 600 = 600

tooFarFromTarget ​

readonly tooFarFromTarget: 16 = 16

waitDuration ​

readonly waitDuration: UniformInt


ALLAY_BRAIN ​

const ALLAY_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 ​

const ALL_ACTIVITIES: readonly Activity[]

Defined in: activity.ts:50

Every registered activity, in registration order.


ALL_MEMORY_MODULE_TYPES ​

const ALL_MEMORY_MODULE_TYPES: readonly MemoryModuleType<unknown>[]

Defined in: memory.ts:409

Every registered memory module type, in registration order.


ANGER_LEVELS ​

const ANGER_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 ​

const ANGER_MANAGEMENT: object

Defined in: mobs/warden.ts:106

Java's AngerManagement.MAX_ANGER, CONVERSION_DELAY and DEFAULT_ANGER_DECREASE.

Type Declaration ​

conversionDelay ​

readonly conversionDelay: 2 = 2

defaultAngerDecrease ​

readonly defaultAngerDecrease: 1 = 1

maxAnger ​

readonly maxAnger: 150 = 150


ANIMAL_MAKE_LOVE ​

const ANIMAL_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 ​

const ARMADILLO: object

Defined in: mobs/armadillo.ts:39

The named constants of ArmadilloAi and ArmadilloAi.ArmadilloBallUp.

Type Declaration ​

adultFollowRange ​

readonly adultFollowRange: UniformInt

babyCloseEnoughDist ​

readonly babyCloseEnoughDist: 1 = 1

ballUpStayInState ​

readonly ballUpStayInState: number

5 * TimeUtil.SECONDS_PER_MINUTE * 20, five minutes of staying balled up.

dangerDetectedRecentlyDangerThreshold ​

readonly dangerDetectedRecentlyDangerThreshold: 75 = 75

Below this much time left on DANGER_DETECTED_RECENTLY, the armadillo unrolls.

defaultCloseEnoughDist ​

readonly defaultCloseEnoughDist: 2 = 2

peekTimer ​

readonly peekTimer: UniformInt

scareMemoryTimeToLive ​

readonly scareMemoryTimeToLive: number = ARMADILLO_SCARE_SENSOR.memoryTimeToLive

scareScanRate ​

readonly scareScanRate: number = ARMADILLO_SCARE_SENSOR.scanRate

Java's SensorType.ARMADILLO_SCARE_DETECTED arguments.

speedWhenFollowingAdult ​

readonly speedWhenFollowingAdult: 1.25 = 1.25

speedWhenIdling ​

readonly speedWhenIdling: 1 = 1

speedWhenMakingLove ​

readonly speedWhenMakingLove: 1 = 1

speedWhenPanicking ​

readonly speedWhenPanicking: 2 = 2

speedWhenTempted ​

readonly speedWhenTempted: 1.25 = 1.25

ticksDelayToDetermineIfDangerIsStillAround ​

readonly ticksDelayToDetermineIfDangerIsStillAround: 5 = 5


ARMADILLO_BRAIN ​

const ARMADILLO_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 ​

const ARMADILLO_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 ​

const AXOLOTL: object

Defined in: mobs/axolotl.ts:41

The named constants of AxolotlAi.

Type Declaration ​

adultFollowRange ​

readonly adultFollowRange: UniformInt

huntingCooldown ​

readonly huntingCooldown: 2400 = 2400

AxolotlAi.updateActivity sets this after a fight ends.

meleeAttackCooldown ​

readonly meleeAttackCooldown: 20 = 20

playDeadTicks ​

readonly playDeadTicks: 200 = 200

Axolotl.PLAY_DEAD_TICKS is set by the host when the axolotl is hurt in water.

speedOnLand ​

readonly speedOnLand: 0.15 = 0.15

speedWhenChasingInWater ​

readonly speedWhenChasingInWater: 0.6 = 0.6

speedWhenFollowingAdultInWater ​

readonly speedWhenFollowingAdultInWater: 0.6 = 0.6

speedWhenIdlingInWater ​

readonly speedWhenIdlingInWater: 0.5 = 0.5

speedWhenMakingLove ​

readonly speedWhenMakingLove: 0.2 = 0.2


AXOLOTL_BRAIN ​

const AXOLOTL_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 ​

const AXOLOTL_TARGET_DETECTION_DISTANCE: 8 = 8

Defined in: sensing/sensors.ts:301

Java's AxolotlAttackablesSensor.TARGET_DETECTION_DISTANCE, and its squared form.


Activities ​

const Activities: 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 ​

readonly ADMIRE_ITEM: Activity

AVOID ​

readonly AVOID: Activity

CELEBRATE ​

readonly CELEBRATE: Activity

CORE ​

readonly CORE: Activity

Always active alongside the current activity; never chosen by itself.

DIG ​

readonly DIG: Activity

EMERGE ​

readonly EMERGE: Activity

FIGHT ​

readonly FIGHT: Activity

HIDE ​

readonly HIDE: Activity

IDLE ​

readonly IDLE: Activity

INVESTIGATE ​

readonly INVESTIGATE: Activity

LAY_SPAWN ​

readonly LAY_SPAWN: Activity

LONG_JUMP ​

readonly LONG_JUMP: Activity

MEET ​

readonly MEET: Activity

PANIC ​

readonly PANIC: Activity

PLAY ​

readonly PLAY: Activity

PLAY_DEAD ​

readonly PLAY_DEAD: Activity

PRE_RAID ​

readonly PRE_RAID: Activity

RAID ​

readonly RAID: Activity

RAM ​

readonly RAM: Activity

REST ​

readonly REST: Activity

RIDE ​

readonly RIDE: Activity

ROAR ​

readonly ROAR: Activity

SNIFF ​

readonly SNIFF: Activity

SWIM ​

readonly SWIM: Activity

TONGUE ​

readonly TONGUE: Activity

WORK ​

readonly WORK: Activity


BABY_VILLAGER_SCHEDULE ​

const BABY_VILLAGER_SCHEDULE: Schedule

Defined in: mobs/villager.ts:100

The baby track of the same timeline: play instead of work and meet.


BRAIN_MOBS ​

const BRAIN_MOBS: readonly BrainMobDefinition[]

Defined in: mobs/index.ts:32

Every brain mob, in the order the research note lists them.


BREEZE ​

const BREEZE: object

Defined in: mobs/breeze.ts:33

The named constants of BreezeAi and the behaviors it composes.

Type Declaration ​

jumpCircleInnerRadius ​

readonly jumpCircleInnerRadius: 4 = 4

jumpCircleMiddleRadius ​

readonly jumpCircleMiddleRadius: 8 = 8

jumpCircleOuterRadius ​

readonly jumpCircleOuterRadius: 24 = 24

jumpInhalingTicks ​

readonly jumpInhalingTicks: 10 = 10

shootAfterSlideTicks ​

readonly shootAfterSlideTicks: 60 = 60

SlideToTargetSink.stop holds BREEZE_SHOOT for 60 ticks once a slide lands.

shootChargingTicks ​

readonly shootChargingTicks: 10 = 10

Shoot's three phases, in ticks.

shootCooldownTicks ​

readonly shootCooldownTicks: 20 = 20

shootRecoveringTicks ​

readonly shootRecoveringTicks: 5 = 5

shootTicks ​

readonly shootTicks: 5 = 5

slideTimeout ​

readonly slideTimeout: object

new BreezeAi.SlideToTargetSink(20, 40): a much shorter sink than the usual (150, 250).

slideTimeout.maxDuration ​

readonly maxDuration: 40 = 40

slideTimeout.minDuration ​

readonly minDuration: 20 = 20

speedWhenSliding ​

readonly speedWhenSliding: 0.6 = 0.6

ticksToRememberSeenTarget ​

readonly ticksToRememberSeenTarget: 100 = 100


BREEZE_BRAIN ​

const BREEZE_BRAIN: BrainMobDefinition

Defined in: mobs/breeze.ts:257

The breeze's registry entry. BreezeAttackEntitySensor picks the target that fight shoots at.


CAMEL ​

const CAMEL: object

Defined in: mobs/camel.ts:37

The named constants of CamelAi.

Type Declaration ​

adultFollowRange ​

readonly adultFollowRange: UniformInt

minimalPoseSeconds ​

readonly minimalPoseSeconds: 20 = 20

new CamelAi.RandomSitting(20): twenty seconds in the current pose before it may change.

speedWhenFollowingAdult ​

readonly speedWhenFollowingAdult: 2.5 = 2.5

speedWhenIdling ​

readonly speedWhenIdling: 2 = 2

speedWhenMakingLove ​

readonly speedWhenMakingLove: 1 = 1

speedWhenPanicking ​

readonly speedWhenPanicking: 4 = 4

speedWhenTempted ​

readonly speedWhenTempted: 2.5 = 2.5

temptedCloseEnoughAdult ​

readonly temptedCloseEnoughAdult: 3.5 = 3.5

temptedCloseEnoughBaby ​

readonly temptedCloseEnoughBaby: 2.5 = 2.5


CAMEL_BRAIN ​

const CAMEL_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 ​

const COPPER_GOLEM: object

Defined in: mobs/copperGolem.ts:25

The named constants of CopperGolemAi.

Type Declaration ​

destinationBlocks ​

readonly destinationBlocks: Set<string>

gazeInterval ​

readonly gazeInterval: UniformInt

sourceBlockTag ​

readonly sourceBlockTag: "minecraft:copper_chests" = 'minecraft:copper_chests'

The source is #minecraft:copper_chests; the destination is a chest or a trapped chest.

speedWhenIdling ​

readonly speedWhenIdling: 1 = 1

speedWhenPanicking ​

readonly speedWhenPanicking: 1.5 = 1.5

tickToCloseContainer ​

readonly tickToCloseContainer: 60 = 60

The tick at which TransportItemsBetweenContainers closes the chest again.

tickToPlayOnReachedSound ​

readonly tickToPlayOnReachedSound: 9 = 9

tickToStartOnReachedInteraction ​

readonly tickToStartOnReachedInteraction: 1 = 1

transportItemHorizontalSearchRadius ​

readonly transportItemHorizontalSearchRadius: 32 = 32

transportItemVerticalSearchRadius ​

readonly transportItemVerticalSearchRadius: 8 = 8


COPPER_GOLEM_BRAIN ​

const COPPER_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 ​

const CREAKING: object

Defined in: mobs/creaking.ts:34

The named constants of CreakingAi.

Type Declaration ​

activityBasePriority ​

readonly activityBasePriority: 10 = 10

Both non-core activities start at priority 10, unusually for a brain mob.

gazeInterval ​

readonly gazeInterval: UniformInt

maxLookDistance ​

readonly maxLookDistance: 8 = 8

meleeAttackCooldown ​

readonly meleeAttackCooldown: 40 = 40

speedWhenFighting ​

readonly speedWhenFighting: 1 = 1

speedWhenIdling ​

readonly speedWhenIdling: 0.3 = 0.3


CREAKING_BRAIN ​

const CREAKING_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 ​

const DEFAULT_BEHAVIOR_DURATION: 60 = 60

Defined in: behavior/control.ts:70

Java's Behavior.DEFAULT_DURATION.


DEFAULT_SCAN_RATE ​

const DEFAULT_SCAN_RATE: 20 = 20

Defined in: sensing/sensor.ts:13

Java's Sensor.DEFAULT_SCAN_RATE.


DEFAULT_TARGETING_RANGE ​

const DEFAULT_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 ​

const DUAL_SYSTEM_MOBS: readonly string[]

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 ​

const EntityCondition: object

Defined in: world.ts:150

The EntityConditions members this package reads, with the Java accessor each mirrors.

Type Declaration ​

ACTIVE ​

readonly ACTIVE: "active" = 'active'

Creaking::isActive.

ADULT ​

readonly ADULT: "adult" = 'adult'

Piglin::isAdult negated, and AgeableMob::isBaby for the mobs that read it as a flag.

AGGRESSIVE ​

readonly AGGRESSIVE: "aggressive" = 'aggressive'

Mob::isAggressive.

CAN_BE_HUNTED ​

readonly CAN_BE_HUNTED: "can_be_hunted" = 'can_be_hunted'

Hoglin::canBeHunted.

CAN_BREED ​

readonly CAN_BREED: "can_breed" = 'can_breed'

AgeableMob::canBreed.

CAN_DIG ​

readonly CAN_DIG: "can_dig" = 'can_dig'

Sniffer::canDig.

CAN_MOVE ​

readonly CAN_MOVE: "can_move" = 'can_move'

Creaking::canMove.

CAN_SNIFF ​

readonly CAN_SNIFF: "can_sniff" = 'can_sniff'

Sniffer::canSniff.

DANCING ​

readonly DANCING: "dancing" = 'dancing'

Piglin::isDancing.

IN_LOVE ​

readonly IN_LOVE: "in_love" = 'in_love'

Animal::isInLove.

IN_WATER ​

readonly IN_WATER: "in_water" = 'in_water'

Entity::isInWater.

LEASHED ​

readonly LEASHED: "leashed" = 'leashed'

LivingEntity::isLeashed.

ON_FIRE ​

readonly ON_FIRE: "on_fire" = 'on_fire'

Entity::isOnFire, which is what makes a panicking animal look for water.

ON_GROUND ​

readonly ON_GROUND: "on_ground" = 'on_ground'

Entity::onGround.

PASSENGER ​

readonly PASSENGER: "passenger" = 'passenger'

Entity::isPassenger.

REFUSE_TO_MOVE ​

readonly REFUSE_TO_MOVE: "refuse_to_move" = 'refuse_to_move'

Camel::refuseToMove.

SCARED ​

readonly SCARED: "scared" = 'scared'

Armadillo::isScared.

SCREAMING ​

readonly SCREAMING: "screaming" = 'screaming'

Goat::isScreamingGoat.

SITTING ​

readonly SITTING: "sitting" = 'sitting'

Camel::isCamelSitting.

TAME ​

readonly TAME: "tame" = 'tame'

TamableAnimal::isTame, and AbstractNautilus::isTame.


FOLLOW_RANGE_ATTRIBUTE ​

const FOLLOW_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 ​

const FROG: object

Defined in: mobs/frog.ts:47

The named constants of FrogAi.

Type Declaration ​

findLandIdle ​

readonly findLandIdle: object

TryFindLand.create(6, 1.0F) in idle and TryFindLand.create(8, 1.5F) in swim.

findLandIdle.range ​

readonly range: 6 = 6

findLandIdle.speed ​

readonly speed: 1 = 1

findLandNearLiquid ​

readonly findLandNearLiquid: object

findLandNearLiquid.range ​

readonly range: 8 = 8

findLandNearLiquid.speed ​

readonly speed: 1 = 1

findLandSwim ​

readonly findLandSwim: object

findLandSwim.range ​

readonly range: 8 = 8

findLandSwim.speed ​

readonly speed: 1.5 = 1.5

frogspawn ​

readonly frogspawn: "minecraft:frogspawn" = 'minecraft:frogspawn'

maxJumpVelocityMultiplier ​

readonly maxJumpVelocityMultiplier: 3.5714288 = 3.5714288

maxLongJumpHeight ​

readonly maxLongJumpHeight: 2 = 2

maxLongJumpWidth ​

readonly maxLongJumpWidth: 4 = 4

preferJumpToTag ​

readonly preferJumpToTag: "minecraft:frog_prefer_jump_to" = 'minecraft:frog_prefer_jump_to'

preferredBlockChance ​

readonly preferredBlockChance: 0.5 = 0.5

The LongJumpToPreferredBlock bias towards a preferred landing block.

speedInWater ​

readonly speedInWater: 0.75 = 0.75

speedOnLand ​

readonly speedOnLand: 1 = 1

speedWhenIdling ​

readonly speedWhenIdling: 1 = 1

speedWhenPanicking ​

readonly speedWhenPanicking: 2 = 2

speedWhenTempted ​

readonly speedWhenTempted: 1.25 = 1.25

temptationTag ​

readonly temptationTag: "minecraft:frog_food" = 'minecraft:frog_food'

FrogAi.getTemptations() is #minecraft:frog_food.

timeBetweenLongJumps ​

readonly timeBetweenLongJumps: UniformInt


FROG_BRAIN ​

const FROG_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 ​

const FROG_TARGET_DETECTION_DISTANCE: 10 = 10

Defined in: sensing/sensors.ts:331

Java's FrogAttackablesSensor.TARGET_DETECTION_DISTANCE.


GOAT ​

const GOAT: object

Defined in: mobs/goat.ts:38

The named constants of GoatAi.

Type Declaration ​

adultFollowRange ​

readonly adultFollowRange: UniformInt

adultRamKnockbackForce ​

readonly adultRamKnockbackForce: 2.5 = 2.5

babyRamKnockbackForce ​

readonly babyRamKnockbackForce: 1 = 1

maxJumpVelocityMultiplier ​

readonly maxJumpVelocityMultiplier: 3.5714288 = 3.5714288

maxLongJumpHeight ​

readonly maxLongJumpHeight: 5 = 5

maxLongJumpWidth ​

readonly maxLongJumpWidth: 5 = 5

ramMaxDistance ​

readonly ramMaxDistance: 7 = 7

ramMinDistance ​

readonly ramMinDistance: 4 = 4

ramPrepareTime ​

readonly ramPrepareTime: 20 = 20

speedWhenFollowingAdult ​

readonly speedWhenFollowingAdult: 1.25 = 1.25

speedWhenIdling ​

readonly speedWhenIdling: 1 = 1

speedWhenPanicking ​

readonly speedWhenPanicking: 2 = 2

speedWhenPreparingToRam ​

readonly speedWhenPreparingToRam: 1.25 = 1.25

speedWhenRamming ​

readonly speedWhenRamming: 3 = 3

speedWhenTempted ​

readonly speedWhenTempted: 1.25 = 1.25

timeBetweenLongJumps ​

readonly timeBetweenLongJumps: UniformInt

timeBetweenRams ​

readonly timeBetweenRams: UniformInt

timeBetweenRamsScreamer ​

readonly timeBetweenRamsScreamer: UniformInt


GOAT_BRAIN ​

const GOAT_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 ​

const GOLEM_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 ​

const HAPPY_GHAST: object

Defined in: mobs/happyGhast.ts:38

The named constants of HappyGhastAi.

Type Declaration ​

adultFollowRange ​

readonly adultFollowRange: UniformInt

babyCloseEnoughDist ​

readonly babyCloseEnoughDist: 3 = 3

panicFlyHeight ​

readonly panicFlyHeight: 0 = 0

speedWhenFollowingAdult ​

readonly speedWhenFollowingAdult: 1.1 = 1.1

speedWhenIdling ​

readonly speedWhenIdling: 1 = 1

speedWhenPanicking ​

readonly speedWhenPanicking: 2 = 2

new AnimalPanic(2.0F, 0): the second argument is the fly height offset.

speedWhenTempted ​

readonly speedWhenTempted: 1.25 = 1.25


HAPPY_GHAST_BRAIN ​

const HAPPY_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 ​

const HOGLIN: object

Defined in: mobs/hoglin.ts:35

The named constants of HoglinAi.

Type Declaration ​

activityBasePriority ​

readonly activityBasePriority: 10 = 10

Both non-core activities start at priority 10.

adultFollowRange ​

readonly adultFollowRange: UniformInt

attackDuration ​

readonly attackDuration: 200 = 200

attackInterval ​

readonly attackInterval: 40 = 40

babyAttackInterval ​

readonly babyAttackInterval: 15 = 15

desiredDistanceFromPiglinWhenIdling ​

readonly desiredDistanceFromPiglinWhenIdling: 8 = 8

desiredDistanceFromPiglinWhenRetreating ​

readonly desiredDistanceFromPiglinWhenRetreating: 15 = 15

repellentDetectionRangeHorizontal ​

readonly repellentDetectionRangeHorizontal: 8 = 8

repellentDetectionRangeVertical ​

readonly repellentDetectionRangeVertical: 4 = 4

repellentPacifyTime ​

readonly repellentPacifyTime: 200 = 200

retreatDuration ​

readonly retreatDuration: UniformInt

speedWhenAvoidingRepellent ​

readonly speedWhenAvoidingRepellent: 1 = 1

speedWhenFollowingAdult ​

readonly speedWhenFollowingAdult: 0.6 = 0.6

speedWhenIdling ​

readonly speedWhenIdling: 0.4 = 0.4

speedWhenMakingLove ​

readonly speedWhenMakingLove: 0.6 = 0.6

speedWhenRetreating ​

readonly speedWhenRetreating: 1.3 = 1.3


HOGLIN_BRAIN ​

const HOGLIN_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 ​

const MOVE_TO_TARGET_SINK_MAX_RETRY_COOLDOWN: 40 = 40

Defined in: behavior/common.ts:195

Java's MoveToTargetSink.MAX_COOLDOWN_BEFORE_RETRYING.


MemoryModuleTypes ​

const MemoryModuleTypes: 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 ​

readonly ADMIRING_DISABLED: MemoryModuleType<boolean>

minecraft:admiring_disabled, Java Boolean.

ADMIRING_ITEM ​

readonly ADMIRING_ITEM: MemoryModuleType<boolean>

minecraft:admiring_item, Java Boolean.

ANGRY_AT ​

readonly ANGRY_AT: MemoryModuleType<string>

minecraft:angry_at, Java UUID.

ATE_RECENTLY ​

readonly ATE_RECENTLY: MemoryModuleType<boolean>

minecraft:ate_recently, Java Boolean.

ATTACK_COOLING_DOWN ​

readonly ATTACK_COOLING_DOWN: MemoryModuleType<boolean>

minecraft:attack_cooling_down, Java Boolean.

ATTACK_TARGET ​

readonly ATTACK_TARGET: MemoryModuleType<BrainEntity>

minecraft:attack_target, Java LivingEntity.

ATTACK_TARGET_COOLDOWN ​

readonly ATTACK_TARGET_COOLDOWN: MemoryModuleType<number>

minecraft:attack_target_cooldown, Java Integer.

AVOID_TARGET ​

readonly AVOID_TARGET: MemoryModuleType<BrainEntity>

minecraft:avoid_target, Java LivingEntity.

BREED_TARGET ​

readonly BREED_TARGET: MemoryModuleType<BrainEntity>

minecraft:breed_target, Java AgeableMob.

BREEZE_JUMP_COOLDOWN ​

readonly BREEZE_JUMP_COOLDOWN: MemoryModuleType<typeof UNIT>

minecraft:breeze_jump_cooldown, Java Unit.

BREEZE_JUMP_INHALING ​

readonly BREEZE_JUMP_INHALING: MemoryModuleType<typeof UNIT>

minecraft:breeze_jump_inhaling, Java Unit.

BREEZE_JUMP_TARGET ​

readonly BREEZE_JUMP_TARGET: MemoryModuleType<BlockPos>

minecraft:breeze_jump_target, Java BlockPos.

BREEZE_LEAVING_WATER ​

readonly BREEZE_LEAVING_WATER: MemoryModuleType<typeof UNIT>

minecraft:breeze_leaving_water, Java Unit.

BREEZE_SHOOT ​

readonly BREEZE_SHOOT: MemoryModuleType<typeof UNIT>

minecraft:breeze_shoot, Java Unit.

BREEZE_SHOOT_CHARGING ​

readonly BREEZE_SHOOT_CHARGING: MemoryModuleType<typeof UNIT>

minecraft:breeze_shoot_charging, Java Unit.

BREEZE_SHOOT_COOLDOWN ​

readonly BREEZE_SHOOT_COOLDOWN: MemoryModuleType<typeof UNIT>

minecraft:breeze_shoot_cooldown, Java Unit.

BREEZE_SHOOT_RECOVERING ​

readonly BREEZE_SHOOT_RECOVERING: MemoryModuleType<typeof UNIT>

minecraft:breeze_shoot_recover, Java Unit.

CANT_REACH_WALK_TARGET_SINCE ​

readonly CANT_REACH_WALK_TARGET_SINCE: MemoryModuleType<number>

minecraft:cant_reach_walk_target_since, Java Long.

CELEBRATE_LOCATION ​

readonly CELEBRATE_LOCATION: MemoryModuleType<BlockPos>

minecraft:celebrate_location, Java BlockPos.

CHARGE_COOLDOWN_TICKS ​

readonly CHARGE_COOLDOWN_TICKS: MemoryModuleType<number>

minecraft:charge_cooldown_ticks, Java Integer.

DANCING ​

readonly DANCING: MemoryModuleType<boolean>

minecraft:dancing, Java Boolean.

DANGER_DETECTED_RECENTLY ​

readonly DANGER_DETECTED_RECENTLY: MemoryModuleType<boolean>

minecraft:danger_detected_recently, Java Boolean.

DIG_COOLDOWN ​

readonly DIG_COOLDOWN: MemoryModuleType<typeof UNIT>

minecraft:dig_cooldown, Java Unit.

DISABLE_WALK_TO_ADMIRE_ITEM ​

readonly DISABLE_WALK_TO_ADMIRE_ITEM: MemoryModuleType<boolean>

minecraft:disable_walk_to_admire_item, Java Boolean.

DISTURBANCE_LOCATION ​

readonly DISTURBANCE_LOCATION: MemoryModuleType<BlockPos>

minecraft:disturbance_location, Java BlockPos.

DOORS_TO_CLOSE ​

readonly DOORS_TO_CLOSE: MemoryModuleType<readonly GlobalPos[]>

minecraft:doors_to_close, Java Set<GlobalPos>.

DUMMY ​

readonly DUMMY: MemoryModuleType<never>

minecraft:dummy, Java Void.

GAZE_COOLDOWN_TICKS ​

readonly GAZE_COOLDOWN_TICKS: MemoryModuleType<number>

minecraft:gaze_cooldown_ticks, Java Integer.

GOLEM_DETECTED_RECENTLY ​

readonly GOLEM_DETECTED_RECENTLY: MemoryModuleType<boolean>

minecraft:golem_detected_recently, Java Boolean.

HAS_HUNTING_COOLDOWN ​

readonly HAS_HUNTING_COOLDOWN: MemoryModuleType<boolean>

minecraft:has_hunting_cooldown, Java Boolean.

HEARD_BELL_TIME ​

readonly HEARD_BELL_TIME: MemoryModuleType<number>

minecraft:heard_bell_time, Java Long.

HIDING_PLACE ​

readonly HIDING_PLACE: MemoryModuleType<GlobalPos>

minecraft:hiding_place, Java GlobalPos.

HOME ​

readonly HOME: MemoryModuleType<GlobalPos>

minecraft:home, Java GlobalPos.

HUNTED_RECENTLY ​

readonly HUNTED_RECENTLY: MemoryModuleType<boolean>

minecraft:hunted_recently, Java Boolean.

HURT_BY ​

readonly HURT_BY: MemoryModuleType<BrainDamageSource>

minecraft:hurt_by, Java DamageSource.

HURT_BY_ENTITY ​

readonly HURT_BY_ENTITY: MemoryModuleType<BrainEntity>

minecraft:hurt_by_entity, Java LivingEntity.

INTERACTION_TARGET ​

readonly INTERACTION_TARGET: MemoryModuleType<BrainEntity>

minecraft:interaction_target, Java LivingEntity.

IS_EMERGING ​

readonly IS_EMERGING: MemoryModuleType<typeof UNIT>

minecraft:is_emerging, Java Unit.

IS_IN_WATER ​

readonly IS_IN_WATER: MemoryModuleType<typeof UNIT>

minecraft:is_in_water, Java Unit.

IS_PANICKING ​

readonly IS_PANICKING: MemoryModuleType<boolean>

minecraft:is_panicking, Java Boolean.

IS_PREGNANT ​

readonly IS_PREGNANT: MemoryModuleType<typeof UNIT>

minecraft:is_pregnant, Java Unit.

IS_SNIFFING ​

readonly IS_SNIFFING: MemoryModuleType<typeof UNIT>

minecraft:is_sniffing, Java Unit.

ITEM_PICKUP_COOLDOWN_TICKS ​

readonly ITEM_PICKUP_COOLDOWN_TICKS: MemoryModuleType<number>

minecraft:item_pickup_cooldown_ticks, Java Integer.

JOB_SITE ​

readonly JOB_SITE: MemoryModuleType<GlobalPos>

minecraft:job_site, Java GlobalPos.

LAST_SLEPT ​

readonly LAST_SLEPT: MemoryModuleType<number>

minecraft:last_slept, Java Long.

LAST_WOKEN ​

readonly LAST_WOKEN: MemoryModuleType<number>

minecraft:last_woken, Java Long.

LAST_WORKED_AT_POI ​

readonly LAST_WORKED_AT_POI: MemoryModuleType<number>

minecraft:last_worked_at_poi, Java Long.

LIKED_NOTEBLOCK_COOLDOWN_TICKS ​

readonly LIKED_NOTEBLOCK_COOLDOWN_TICKS: MemoryModuleType<number>

minecraft:liked_noteblock_cooldown_ticks, Java Integer.

LIKED_NOTEBLOCK_POSITION ​

readonly LIKED_NOTEBLOCK_POSITION: MemoryModuleType<GlobalPos>

minecraft:liked_noteblock, Java GlobalPos.

LIKED_PLAYER ​

readonly LIKED_PLAYER: MemoryModuleType<string>

minecraft:liked_player, Java UUID.

LONG_JUMP_COOLDOWN_TICKS ​

readonly LONG_JUMP_COOLDOWN_TICKS: MemoryModuleType<number>

minecraft:long_jump_cooling_down, Java Integer.

LONG_JUMP_MID_JUMP ​

readonly LONG_JUMP_MID_JUMP: MemoryModuleType<boolean>

minecraft:long_jump_mid_jump, Java Boolean.

LOOK_TARGET ​

readonly LOOK_TARGET: MemoryModuleType<PositionTracker>

minecraft:look_target, Java PositionTracker.

MEETING_POINT ​

readonly MEETING_POINT: MemoryModuleType<GlobalPos>

minecraft:meeting_point, Java GlobalPos.

NEARBY_ADULT_PIGLINS ​

readonly NEARBY_ADULT_PIGLINS: MemoryModuleType<readonly BrainEntity[]>

minecraft:nearby_adult_piglins, Java List<AbstractPiglin>.

NEAREST_ATTACKABLE ​

readonly NEAREST_ATTACKABLE: MemoryModuleType<BrainEntity>

minecraft:nearest_attackable, Java LivingEntity.

NEAREST_BED ​

readonly NEAREST_BED: MemoryModuleType<BlockPos>

minecraft:nearest_bed, Java BlockPos.

NEAREST_HOSTILE ​

readonly NEAREST_HOSTILE: MemoryModuleType<BrainEntity>

minecraft:nearest_hostile, Java LivingEntity.

NEAREST_LIVING_ENTITIES ​

readonly NEAREST_LIVING_ENTITIES: MemoryModuleType<readonly BrainEntity[]>

minecraft:mobs, Java List<LivingEntity>.

NEAREST_PLAYER_HOLDING_WANTED_ITEM ​

readonly NEAREST_PLAYER_HOLDING_WANTED_ITEM: MemoryModuleType<BrainEntity>

minecraft:nearest_player_holding_wanted_item, Java Player.

NEAREST_PLAYERS ​

readonly NEAREST_PLAYERS: MemoryModuleType<readonly BrainEntity[]>

minecraft:nearest_players, Java List<Player>.

NEAREST_REPELLENT ​

readonly NEAREST_REPELLENT: MemoryModuleType<BlockPos>

minecraft:nearest_repellent, Java BlockPos.

NEAREST_TARGETABLE_PLAYER_NOT_WEARING_GOLD ​

readonly NEAREST_TARGETABLE_PLAYER_NOT_WEARING_GOLD: MemoryModuleType<BrainEntity>

minecraft:nearest_targetable_player_not_wearing_gold, Java Player.

NEAREST_VISIBLE_ADULT ​

readonly NEAREST_VISIBLE_ADULT: MemoryModuleType<BrainEntity>

minecraft:nearest_visible_adult, Java LivingEntity.

NEAREST_VISIBLE_ADULT_HOGLINS ​

readonly NEAREST_VISIBLE_ADULT_HOGLINS: MemoryModuleType<readonly BrainEntity[]>

minecraft:nearest_visible_adult_hoglins, Java List<Hoglin>.

NEAREST_VISIBLE_ADULT_PIGLIN ​

readonly NEAREST_VISIBLE_ADULT_PIGLIN: MemoryModuleType<BrainEntity>

minecraft:nearest_visible_adult_piglin, Java AbstractPiglin.

NEAREST_VISIBLE_ADULT_PIGLINS ​

readonly NEAREST_VISIBLE_ADULT_PIGLINS: MemoryModuleType<readonly BrainEntity[]>

minecraft:nearest_visible_adult_piglins, Java List<AbstractPiglin>.

NEAREST_VISIBLE_ATTACKABLE_PLAYER ​

readonly NEAREST_VISIBLE_ATTACKABLE_PLAYER: MemoryModuleType<BrainEntity>

minecraft:nearest_visible_targetable_player, Java Player.

NEAREST_VISIBLE_ATTACKABLE_PLAYERS ​

readonly NEAREST_VISIBLE_ATTACKABLE_PLAYERS: MemoryModuleType<readonly BrainEntity[]>

minecraft:nearest_visible_targetable_players, Java List<Player>.

NEAREST_VISIBLE_BABY_HOGLIN ​

readonly NEAREST_VISIBLE_BABY_HOGLIN: MemoryModuleType<BrainEntity>

minecraft:nearest_visible_baby_hoglin, Java Hoglin.

NEAREST_VISIBLE_HUNTABLE_HOGLIN ​

readonly NEAREST_VISIBLE_HUNTABLE_HOGLIN: MemoryModuleType<BrainEntity>

minecraft:nearest_visible_huntable_hoglin, Java Hoglin.

NEAREST_VISIBLE_LIVING_ENTITIES ​

readonly NEAREST_VISIBLE_LIVING_ENTITIES: MemoryModuleType<NearestVisibleLivingEntities>

minecraft:visible_mobs, Java NearestVisibleLivingEntities.

NEAREST_VISIBLE_NEMESIS ​

readonly NEAREST_VISIBLE_NEMESIS: MemoryModuleType<BrainEntity>

minecraft:nearest_visible_nemesis, Java Mob.

NEAREST_VISIBLE_PLAYER ​

readonly NEAREST_VISIBLE_PLAYER: MemoryModuleType<BrainEntity>

minecraft:nearest_visible_player, Java Player.

NEAREST_VISIBLE_WANTED_ITEM ​

readonly NEAREST_VISIBLE_WANTED_ITEM: MemoryModuleType<BrainItemEntity>

minecraft:nearest_visible_wanted_item, Java ItemEntity.

NEAREST_VISIBLE_ZOMBIFIED ​

readonly NEAREST_VISIBLE_ZOMBIFIED: MemoryModuleType<BrainEntity>

minecraft:nearest_visible_zombified, Java LivingEntity.

PACIFIED ​

readonly PACIFIED: MemoryModuleType<boolean>

minecraft:pacified, Java Boolean.

PATH ​

readonly PATH: MemoryModuleType<BrainPath>

minecraft:path, Java Path.

PLAY_DEAD_TICKS ​

readonly PLAY_DEAD_TICKS: MemoryModuleType<number>

minecraft:play_dead_ticks, Java Integer.

POTENTIAL_JOB_SITE ​

readonly POTENTIAL_JOB_SITE: MemoryModuleType<GlobalPos>

minecraft:potential_job_site, Java GlobalPos.

RAM_COOLDOWN_TICKS ​

readonly RAM_COOLDOWN_TICKS: MemoryModuleType<number>

minecraft:ram_cooldown_ticks, Java Integer.

RAM_TARGET ​

readonly RAM_TARGET: MemoryModuleType<Vec3>

minecraft:ram_target, Java Vec3.

RECENT_PROJECTILE ​

readonly RECENT_PROJECTILE: MemoryModuleType<typeof UNIT>

minecraft:recent_projectile, Java Unit.

RIDE_TARGET ​

readonly RIDE_TARGET: MemoryModuleType<BrainEntity>

minecraft:ride_target, Java Entity.

ROAR_SOUND_COOLDOWN ​

readonly ROAR_SOUND_COOLDOWN: MemoryModuleType<typeof UNIT>

minecraft:roar_sound_cooldown, Java Unit.

ROAR_SOUND_DELAY ​

readonly ROAR_SOUND_DELAY: MemoryModuleType<typeof UNIT>

minecraft:roar_sound_delay, Java Unit.

ROAR_TARGET ​

readonly ROAR_TARGET: MemoryModuleType<BrainEntity>

minecraft:roar_target, Java LivingEntity.

SECONDARY_JOB_SITE ​

readonly SECONDARY_JOB_SITE: MemoryModuleType<readonly GlobalPos[]>

minecraft:secondary_job_site, Java List<GlobalPos>.

SNIFF_COOLDOWN ​

readonly SNIFF_COOLDOWN: MemoryModuleType<typeof UNIT>

minecraft:sniff_cooldown, Java Unit.

SNIFFER_DIGGING ​

readonly SNIFFER_DIGGING: MemoryModuleType<boolean>

minecraft:sniffer_digging, Java Boolean.

SNIFFER_EXPLORED_POSITIONS ​

readonly SNIFFER_EXPLORED_POSITIONS: MemoryModuleType<readonly GlobalPos[]>

minecraft:sniffer_explored_positions, Java List<GlobalPos>.

SNIFFER_HAPPY ​

readonly SNIFFER_HAPPY: MemoryModuleType<boolean>

minecraft:sniffer_happy, Java Boolean.

SNIFFER_SNIFFING_TARGET ​

readonly SNIFFER_SNIFFING_TARGET: MemoryModuleType<BlockPos>

minecraft:sniffer_sniffing_target, Java BlockPos.

SONIC_BOOM_COOLDOWN ​

readonly SONIC_BOOM_COOLDOWN: MemoryModuleType<typeof UNIT>

minecraft:sonic_boom_cooldown, Java Unit.

SONIC_BOOM_SOUND_COOLDOWN ​

readonly SONIC_BOOM_SOUND_COOLDOWN: MemoryModuleType<typeof UNIT>

minecraft:sonic_boom_sound_cooldown, Java Unit.

SONIC_BOOM_SOUND_DELAY ​

readonly SONIC_BOOM_SOUND_DELAY: MemoryModuleType<typeof UNIT>

minecraft:sonic_boom_sound_delay, Java Unit.

SPEAR_CHARGE_POSITION ​

readonly SPEAR_CHARGE_POSITION: MemoryModuleType<Vec3>

minecraft:spear_charge_position, Java Vec3.

SPEAR_ENGAGE_TIME ​

readonly SPEAR_ENGAGE_TIME: MemoryModuleType<number>

minecraft:spear_engage_time, Java Integer.

SPEAR_FLEEING_POSITION ​

readonly SPEAR_FLEEING_POSITION: MemoryModuleType<Vec3>

minecraft:spear_fleeing_position, Java Vec3.

SPEAR_FLEEING_TIME ​

readonly SPEAR_FLEEING_TIME: MemoryModuleType<number>

minecraft:spear_fleeing_time, Java Integer.

SPEAR_STATUS ​

readonly SPEAR_STATUS: MemoryModuleType<SpearStatus>

minecraft:spear_status, Java SpearAttack$SpearStatus.

TEMPTATION_COOLDOWN_TICKS ​

readonly TEMPTATION_COOLDOWN_TICKS: MemoryModuleType<number>

minecraft:temptation_cooldown_ticks, Java Integer.

TEMPTING_PLAYER ​

readonly TEMPTING_PLAYER: MemoryModuleType<BrainEntity>

minecraft:tempting_player, Java Player.

TIME_TRYING_TO_REACH_ADMIRE_ITEM ​

readonly TIME_TRYING_TO_REACH_ADMIRE_ITEM: MemoryModuleType<number>

minecraft:time_trying_to_reach_admire_item, Java Integer.

TOUCH_COOLDOWN ​

readonly TOUCH_COOLDOWN: MemoryModuleType<typeof UNIT>

minecraft:touch_cooldown, Java Unit.

TRANSPORT_ITEMS_COOLDOWN_TICKS ​

readonly TRANSPORT_ITEMS_COOLDOWN_TICKS: MemoryModuleType<number>

minecraft:transport_items_cooldown_ticks, Java Integer.

UNIVERSAL_ANGER ​

readonly UNIVERSAL_ANGER: MemoryModuleType<boolean>

minecraft:universal_anger, Java Boolean.

UNREACHABLE_TONGUE_TARGETS ​

readonly UNREACHABLE_TONGUE_TARGETS: MemoryModuleType<readonly string[]>

minecraft:unreachable_tongue_targets, Java List<UUID>.

UNREACHABLE_TRANSPORT_BLOCK_POSITIONS ​

readonly UNREACHABLE_TRANSPORT_BLOCK_POSITIONS: MemoryModuleType<readonly GlobalPos[]>

minecraft:unreachable_transport_block_positions, Java Set<GlobalPos>.

VIBRATION_COOLDOWN ​

readonly VIBRATION_COOLDOWN: MemoryModuleType<typeof UNIT>

minecraft:vibration_cooldown, Java Unit.

VISIBLE_ADULT_HOGLIN_COUNT ​

readonly VISIBLE_ADULT_HOGLIN_COUNT: MemoryModuleType<number>

minecraft:visible_adult_hoglin_count, Java Integer.

VISIBLE_ADULT_PIGLIN_COUNT ​

readonly VISIBLE_ADULT_PIGLIN_COUNT: MemoryModuleType<number>

minecraft:visible_adult_piglin_count, Java Integer.

VISIBLE_VILLAGER_BABIES ​

readonly VISIBLE_VILLAGER_BABIES: MemoryModuleType<readonly BrainEntity[]>

minecraft:visible_villager_babies, Java List<LivingEntity>.

VISITED_BLOCK_POSITIONS ​

readonly VISITED_BLOCK_POSITIONS: MemoryModuleType<readonly GlobalPos[]>

minecraft:visited_block_positions, Java Set<GlobalPos>.

WALK_TARGET ​

readonly WALK_TARGET: MemoryModuleType<WalkTarget>

minecraft:walk_target, Java WalkTarget.


NAUTILUS ​

const NAUTILUS: object

Defined in: mobs/nautilus.ts:44

The named constants of NautilusAi.

Type Declaration ​

angerDuration ​

readonly angerDuration: 400 = 400

attackKnockbackForce ​

readonly attackKnockbackForce: 2 = 2

declineTargetChance ​

readonly declineTargetChance: 0.5 = 0.5

The chance a nautilus declines to pick a non-player target when its cooldown expires.

hostilesTag ​

readonly hostilesTag: "minecraft:nautilus_hostiles" = 'minecraft:nautilus_hostiles'

maxChargeDistance ​

readonly maxChargeDistance: 12 = 12

maxTargetDetectionDistance ​

readonly maxTargetDetectionDistance: 11 = 11

speedWhenAttacking ​

readonly speedWhenAttacking: 0.6 = 0.6

speedWhenIdlingInWater ​

readonly speedWhenIdlingInWater: 1 = 1

speedWhenMakingLove ​

readonly speedWhenMakingLove: 0.4 = 0.4

speedWhenPanicking ​

readonly speedWhenPanicking: 1.6 = 1.6

speedWhenTempted ​

readonly speedWhenTempted: 1.3 = 1.3

temptationTag ​

readonly temptationTag: "minecraft:nautilus_food" = 'minecraft:nautilus_food'

timeBetweenAttacks ​

readonly timeBetweenAttacks: 80 = 80

timeBetweenNonPlayerAttacks ​

readonly timeBetweenNonPlayerAttacks: UniformInt


NAUTILUS_BRAIN ​

const NAUTILUS_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 ​

const NEAREST_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 ​

const NEAREST_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 ​

const NEVER_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 ​

const NO_PROFESSION: VillagerProfession

Defined in: mobs/villager.ts:122

Java's VillagerProfession.NONE, the profession an unemployed villager carries.


NO_VISIBLE_ENTITIES ​

const NO_VISIBLE_ENTITIES: NearestVisibleLivingEntities

Defined in: memory.ts:59

An empty NearestVisibleLivingEntities, Java's NearestVisibleLivingEntities.empty().


PANIC_DISTANCE ​

const PANIC_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 ​

const PANIC_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 ​

const PIGLIN: object

Defined in: mobs/piglin.ts:54

The named constants of PiglinAi.

Type Declaration ​

activityBasePriority ​

readonly activityBasePriority: 10 = 10

Both non-core activities start at priority 10.

admireDuration ​

readonly admireDuration: 119 = 119

angerDuration ​

readonly angerDuration: 600 = 600

avoidZombifiedDuration ​

readonly avoidZombifiedDuration: UniformInt

babyAvoidNemesisDuration ​

readonly babyAvoidNemesisDuration: UniformInt

babyFleeDurationAfterGettingHit ​

readonly babyFleeDurationAfterGettingHit: 100 = 100

barterCurrency ​

readonly barterCurrency: "minecraft:gold_ingot" = 'minecraft:gold_ingot'

barteringItem ​

readonly barteringItem: "minecraft:gold_ingot" = 'minecraft:gold_ingot'

celebrationTime ​

readonly celebrationTime: 300 = 300

desiredDistanceFromEntityWhenAvoiding ​

readonly desiredDistanceFromEntityWhenAvoiding: 12 = 12

desiredDistanceFromZombified ​

readonly desiredDistanceFromZombified: 6 = 6

eatCooldown ​

readonly eatCooldown: 200 = 200

hitByPlayerMemoryTimeout ​

readonly hitByPlayerMemoryTimeout: 400 = 400

howLongToDisableAdmireWalkingIfCantReachItem ​

readonly howLongToDisableAdmireWalkingIfCantReachItem: 200 = 200

ignoredByBabiesTag ​

readonly ignoredByBabiesTag: "minecraft:ignored_by_piglin_babies" = 'minecraft:ignored_by_piglin_babies'

interactionRange ​

readonly interactionRange: 8 = 8

lovedItemTag ​

readonly lovedItemTag: "minecraft:piglin_loved" = 'minecraft:piglin_loved'

maxDistanceToWalkToItem ​

readonly maxDistanceToWalkToItem: 9 = 9

maxLookDist ​

readonly maxLookDist: 8 = 8

maxLookDistForPlayerHoldingLovedItem ​

readonly maxLookDistForPlayerHoldingLovedItem: 14 = 14

maxTimeBetweenHunts ​

readonly maxTimeBetweenHunts: 120 = 120

maxTimeToWalkToItem ​

readonly maxTimeToWalkToItem: 200 = 200

maxWalkDistanceToStartRiding ​

readonly maxWalkDistanceToStartRiding: 8 = 8

meleeAttackCooldown ​

readonly meleeAttackCooldown: 20 = 20

minDesiredDistFromTargetWhenHoldingCrossbow ​

readonly minDesiredDistFromTargetWhenHoldingCrossbow: 5 = 5

playerAngerRange ​

readonly playerAngerRange: 16 = 16

probabilityOfCelebrationDance ​

readonly probabilityOfCelebrationDance: 0.1 = 0.1

repellentDetectionRangeHorizontal ​

readonly repellentDetectionRangeHorizontal: 8 = 8

repellentDetectionRangeVertical ​

readonly repellentDetectionRangeVertical: 4 = 4

repellentItemTag ​

readonly repellentItemTag: "minecraft:piglin_repellents" = 'minecraft:piglin_repellents'

retreatDuration ​

readonly retreatDuration: UniformInt

rideDuration ​

readonly rideDuration: UniformInt

rideStartInterval ​

readonly rideStartInterval: UniformInt

speedWhenAvoiding ​

readonly speedWhenAvoiding: 1 = 1

speedWhenDancing ​

readonly speedWhenDancing: 0.6 = 0.6

speedWhenGoingToCelebrateLocation ​

readonly speedWhenGoingToCelebrateLocation: 1 = 1

speedWhenGoingToWantedItem ​

readonly speedWhenGoingToWantedItem: 1 = 1

speedWhenIdling ​

readonly speedWhenIdling: 0.6 = 0.6

speedWhenMounting ​

readonly speedWhenMounting: 0.8 = 0.8

speedWhenRetreating ​

readonly speedWhenRetreating: 1 = 1

speedWhenStrafingBackFromTarget ​

readonly speedWhenStrafingBackFromTarget: 0.75 = 0.75

timeBetweenHunts ​

readonly timeBetweenHunts: UniformInt


PIGLIN_BRAIN ​

const PIGLIN_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 ​

const PIGLIN_BRUTE: object

Defined in: mobs/piglinBrute.ts:45

The named constants of PiglinBruteAi.

Type Declaration ​

activityBasePriority ​

readonly activityBasePriority: 10 = 10

activitySoundLikelihoodPerTick ​

readonly activitySoundLikelihoodPerTick: 0.0125 = 0.0125

angerDuration ​

readonly angerDuration: 600 = 600

homeCloseEnoughDistance ​

readonly homeCloseEnoughDistance: 2 = 2

homeStrollAroundDistance ​

readonly homeStrollAroundDistance: 5 = 5

homeTooFarDistance ​

readonly homeTooFarDistance: 100 = 100

interactionRange ​

readonly interactionRange: 8 = 8

maxLookDist ​

readonly maxLookDist: 8 = 8

meleeAttackCooldown ​

readonly meleeAttackCooldown: 20 = 20

speedWhenIdling ​

readonly speedWhenIdling: 0.6 = 0.6


PIGLIN_BRUTE_BRAIN ​

const PIGLIN_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 ​

const PROJECTILE_ATTACK_RANGE_BUFFER: 1 = 1

Defined in: behavior/common.ts:585

Java's SetWalkTargetFromAttackTargetIfTargetOutOfReach.PROJECTILE_ATTACK_RANGE_BUFFER.


RANDOM_STROLL_RANGE ​

const RANDOM_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 ​

const REPELLENT_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 ​

const SECONDARY_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 ​

const SENSOR_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 ​

const SNIFFER: object

Defined in: mobs/sniffer.ts:37

The named constants of SnifferAi and its five inner behaviors.

Type Declaration ​

diggingDuration ​

readonly diggingDuration: object

diggingDuration.max ​

readonly max: 180 = 180

diggingDuration.min ​

readonly min: 160 = 160

feelingHappyDuration ​

readonly feelingHappyDuration: object

feelingHappyDuration.max ​

readonly max: 100 = 100

feelingHappyDuration.min ​

readonly min: 40 = 40

finishedDiggingDuration ​

readonly finishedDiggingDuration: 40 = 40

maxLookDistance ​

readonly maxLookDistance: 6 = 6

moveToTargetSink ​

readonly moveToTargetSink: object

new MoveToTargetSink(500, 700): by far the longest sink timeout of the twenty mobs.

moveToTargetSink.maxDuration ​

readonly maxDuration: 700 = 700

moveToTargetSink.minDuration ​

readonly minDuration: 500 = 500

scentingDuration ​

readonly scentingDuration: object

scentingDuration.max ​

readonly max: 80 = 80

scentingDuration.min ​

readonly min: 40 = 40

searchingDuration ​

readonly searchingDuration: 600 = 600

sniffingCooldownTicks ​

readonly sniffingCooldownTicks: 9600 = 9600

sniffingDuration ​

readonly sniffingDuration: object

sniffingDuration.max ​

readonly max: 80 = 80

sniffingDuration.min ​

readonly min: 40 = 40

speedWhenIdling ​

readonly speedWhenIdling: 1 = 1

speedWhenPanicking ​

readonly speedWhenPanicking: 2 = 2

speedWhenSniffing ​

readonly speedWhenSniffing: 1.25 = 1.25

speedWhenTempted ​

readonly speedWhenTempted: 1.25 = 1.25


SNIFFER_BRAIN ​

const SNIFFER_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 ​

const STROLL_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 ​

const TADPOLE: object

Defined in: mobs/tadpole.ts:27

The named constants of TadpoleAi.

Type Declaration ​

speedWhenIdlingInWater ​

readonly speedWhenIdlingInWater: 0.5 = 0.5

speedWhenPanicking ​

readonly speedWhenPanicking: 2 = 2

speedWhenTempted ​

readonly speedWhenTempted: 1.25 = 1.25


TADPOLE_BRAIN ​

const TADPOLE_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 ​

const TEMPTATION_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 ​

const TEMPTATION_COOLDOWN: 100 = 100

Defined in: behavior/common.ts:730

Java's FollowTemptation.TEMPTATION_COOLDOWN.


TEMPT_RANGE_ATTRIBUTE ​

const TEMPT_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 ​

const TIMEOUT_TO_GET_WITHIN_ATTACK_RANGE: 200 = 200

Defined in: behavior/common.ts:544

Java's StopAttackingIfTargetInvalid.TIMEOUT_TO_GET_WITHIN_ATTACK_RANGE.


UNIT ​

const UNIT: typeof UNIT

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 ​

const VILLAGER: object

Defined in: mobs/villager.ts:56

The named constants of VillagerGoalPackages.

Type Declaration ​

baseSpeedModifier ​

readonly baseSpeedModifier: 0.5 = 0.5

Every package is built with 0.5F, the villager's base speed modifier.

giveGiftDuration ​

readonly giveGiftDuration: 100 = 100

new GiveGiftToHero(100).

hiddenState ​

readonly hiddenState: object

SetHiddenState.create(15, 3): fifteen seconds hidden, three blocks close enough.

hiddenState.closeEnough ​

readonly closeEnough: 3 = 3

hiddenState.seconds ​

readonly seconds: 15 = 15

hideSearchDistance ​

readonly hideSearchDistance: 32 = 32

homeWalkRange ​

readonly homeWalkRange: 1 = 1

interactDistSqr ​

readonly interactDistSqr: 5 = 5

interactSpeedModifier ​

readonly interactSpeedModifier: 0.5 = 0.5

interactWalkupDist ​

readonly interactWalkupDist: 2 = 2

jobSiteWalkRange ​

readonly jobSiteWalkRange: 9 = 9

meetingWalkRange ​

readonly meetingWalkRange: 6 = 6

panicSpeedMultiplier ​

readonly panicSpeedMultiplier: 1.5 = 1.5

The panic package multiplies the base speed by 1.5.

poiAcquireRange ​

readonly poiAcquireRange: 14 = 14

AcquirePoi.create(..., Optional.of((byte)14)): the home and meeting acquisition range.

raidHideSearchDistance ​

readonly raidHideSearchDistance: 24 = 24

showTradesDuration ​

readonly showTradesDuration: object

new ShowTradesToPlayer(400, 1600).

showTradesDuration.max ​

readonly max: 1600 = 1600

showTradesDuration.min ​

readonly min: 400 = 400

strollSpeedModifier ​

readonly strollSpeedModifier: 0.4 = 0.4


VILLAGER_BRAIN ​

const VILLAGER_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 ​

const VILLAGER_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 ​

const VILLAGER_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 ​

const WARDEN: 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 ​

readonly angerFromSniffingDistance: object

Sniffing.ANGER_FROM_SNIFFING_MAX_DISTANCE_XZ and _Y.

angerFromSniffingDistance.xz ​

readonly xz: 6 = 6

angerFromSniffingDistance.y ​

readonly y: 20 = 20

angerManagementTickDelay ​

readonly angerManagementTickDelay: 20 = 20

Warden.ANGERMANAGEMENT_TICK_DELAY, how often the anger map is aged.

defaultAnger ​

readonly defaultAnger: 35 = 35

Warden.DEFAULT_ANGER, the anger a plain disturbance adds.

diggingCooldown ​

readonly diggingCooldown: 1200 = 1200

diggingDuration ​

readonly diggingDuration: number

disturbanceLocationExpiryTime ​

readonly disturbanceLocationExpiryTime: 100 = 100

emergeDuration ​

readonly emergeDuration: number

meleeAttackCooldown ​

readonly meleeAttackCooldown: 18 = 18

onHurtAngerBoost ​

readonly onHurtAngerBoost: 20 = 20

Warden.ON_HURT_ANGER_BOOST, added on top of ANGRY's minimum when the warden is hit.

projectileAnger ​

readonly projectileAnger: 10 = 10

Warden.PROJECTILE_ANGER, added for the shooter of an arrow that lands nearby.

projectileAngerDistance ​

readonly projectileAngerDistance: 30 = 30

roarAngerIncrease ​

readonly roarAngerIncrease: 20 = 20

roarDuration ​

readonly roarDuration: number

roarSoundDelay ​

readonly roarSoundDelay: 25 = 25

Roar.TICKS_BEFORE_PLAYING_ROAR_SOUND and Roar.ROAR_ANGER_INCREASE.

sniffCooldown ​

readonly sniffCooldown: object

TryToSniff.SNIFF_COOLDOWN, UniformInt.of(100, 200).

sniffCooldown.max ​

readonly max: 200 = 200

sniffCooldown.min ​

readonly min: 100 = 100

sniffingDuration ​

readonly sniffingDuration: number

sonicBoom ​

readonly sonicBoom: object

SonicBoom.DISTANCE_XZ, DISTANCE_Y, COOLDOWN, DURATION and TICKS_BEFORE_PLAYING_SOUND.

sonicBoom.cooldown ​

readonly cooldown: 40 = 40

sonicBoom.damage ​

readonly damage: 10 = 10

sonicBoom.distanceXz ​

readonly distanceXz: 15 = 15

sonicBoom.distanceY ​

readonly distanceY: 20 = 20

sonicBoom.duration ​

readonly duration: number

sonicBoom.knockbackHorizontal ​

readonly knockbackHorizontal: 2.5 = 2.5

sonicBoom.knockbackVertical ​

readonly knockbackVertical: 0.5 = 0.5

sonicBoom.ticksBeforePlayingSound ​

readonly ticksBeforePlayingSound: number

speedWhenFighting ​

readonly speedWhenFighting: 1.2 = 1.2

speedWhenIdling ​

readonly speedWhenIdling: 0.5 = 0.5

speedWhenInvestigating ​

readonly speedWhenInvestigating: 0.7 = 0.7

vibrationCooldownTicks ​

readonly vibrationCooldownTicks: 40 = 40

Warden.VIBRATION_COOLDOWN_TICKS.


WARDEN_BRAIN ​

const WARDEN_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 ​

const WARDEN_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 ​

const ZOGLIN: object

Defined in: mobs/zoglin.ts:33

The named constants of Zoglin.

Type Declaration ​

activityBasePriority ​

readonly activityBasePriority: 10 = 10

attackDamage ​

readonly attackDamage: 6 = 6

attackDuration ​

readonly attackDuration: 200 = 200

attackInterval ​

readonly attackInterval: 40 = 40

attackKnockback ​

readonly attackKnockback: 1 = 1

babyAttackDamage ​

readonly babyAttackDamage: 0.5 = 0.5

babyAttackInterval ​

readonly babyAttackInterval: 15 = 15

knockbackResistance ​

readonly knockbackResistance: 0.6 = 0.6

maxHealth ​

readonly maxHealth: 40 = 40

movementSpeedWhenFighting ​

readonly movementSpeedWhenFighting: 0.3 = 0.3

speedWhenIdling ​

readonly speedWhenIdling: 0.4 = 0.4


ZOGLIN_BRAIN ​

const ZOGLIN_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 ​

const ZOMBIE_NAUTILUS: object

Defined in: mobs/nautilus.ts:63

The named constants of ZombieNautilusAi, which overrides four of the nautilus's.

Type Declaration ​

attackKnockbackForce ​

readonly attackKnockbackForce: 2 = 2

maxChargeDistance ​

readonly maxChargeDistance: 12 = 12

maxTargetDetectionDistance ​

readonly maxTargetDetectionDistance: 11 = 11

speedWhenAttacking ​

readonly speedWhenAttacking: 0.5 = 0.5

speedWhenIdlingInWater ​

readonly speedWhenIdlingInWater: 1 = 1

speedWhenTempted ​

readonly speedWhenTempted: 0.9 = 0.9

timeBetweenAttacks ​

readonly timeBetweenAttacks: 80 = 80


ZOMBIE_NAUTILUS_BRAIN ​

const ZOMBIE_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 ​

Activity

behaviors ​

readonly PrioritizedBehavior[]

options? ​

ActivityDataOptions = {}

Returns ​

ActivityData


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 ​

BrainContext

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 ​

AngerManagement

canTargetEntity ​

(entity) => boolean

Returns ​

WardenAnger


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 ​

BehaviorControl


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 ​

BehaviorControl


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 ​

UniformInt

speedModifier ​

number | ((body) => number)

nearestVisible? ​

MemoryModuleType<BrainEntity> = MemoryModuleTypes.NEAREST_VISIBLE_ADULT

Returns ​

OneShot


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 ​

OneShot


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 ​

Vec3

Returns ​

BlockPos


blockPosTracker() ​

blockPosTracker(pos): PositionTracker

Defined in: world.ts:444

A PositionTracker over a fixed block. Java's BlockPosTracker.

Parameters ​

pos ​

BlockPos

Returns ​

PositionTracker


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 ​

BlockPos

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 ​

BlockPos

Returns ​

Vec3


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 ​

BrainMob

offered ​

BrainItem

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 ​

MemoryConditions


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 ​

UniformInt

Returns ​

OneShot


corePackage() ​

corePackage(profession, speedModifier): readonly PrioritizedBehavior[]

Defined in: mobs/villager.ts:559

Java's getCorePackage, the one package every villager always runs.

Parameters ​

profession ​

VillagerProfession

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 ​

BehaviorControl


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 ​

BlockPos

b ​

BlockPos

Returns ​

number


distanceSquared() ​

distanceSquared(a, b): number

Defined in: world.ts:390

Squared distance between two positions.

Parameters ​

a ​

Vec3

b ​

Vec3

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 ​

Vec3

dimensions ​

EntityDimensions

bounds ​

EntityBounds

Returns ​

boolean


entityTracker() ​

entityTracker(entity): PositionTracker

Defined in: world.ts:453

A PositionTracker that follows an entity. Java's EntityTracker.

Parameters ​

entity ​

BrainEntity

Returns ​

PositionTracker


eraseMemoryIf() ​

eraseMemoryIf(predicate, memory): OneShot

Defined in: behavior/common.ts:643

Java's EraseMemoryIf.

Parameters ​

predicate ​

(body, context) => boolean

memory ​

MemoryModuleType<unknown>

Returns ​

OneShot


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 ​

BehaviorControl


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 ​

BrainContext

Returns ​

BrainEntity | undefined


findNearbyAdultPiglins() ​

findNearbyAdultPiglins(context): readonly BrainEntity[]

Defined in: sensing/sensors.ts:680

Java's PiglinAi.findNearbyAdultPiglins: adults in the unfiltered nearby list.

Parameters ​

context ​

BrainContext

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 ​

BrainContext

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 ​

BrainContext

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 ​

BehaviorControl


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 ​

BehaviorControl

Returns ​

BehaviorControl


giveGiftToHero() ​

giveGiftToHero(): BehaviorControl

Defined in: mobs/villager.ts:384

Java's GiveGiftToHero: a villager thanks the hero of its village, every so often.

Returns ​

BehaviorControl


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 ​

OneShot


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 ​

OneShot


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 ​

BrainEntity

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 ​

BrainContext

pos ​
x ​

number

y ​

number

z ​

number

Returns ​

void


hidePackage() ​

hidePackage(speedModifier): readonly PrioritizedBehavior[]

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): readonly PrioritizedBehavior[]

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 ​

Vec3

dimensions ​

EntityDimensions

amount ​

number

Returns ​

EntityBounds


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 ​

MemoryModuleType<BrainEntity>

speedModifier ​

number

closeEnough ​

number

Returns ​

OneShot


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 ​

OneShot


isBarterCurrency() ​

isBarterCurrency(item): boolean

Defined in: mobs/piglin.ts:106

Java's PiglinAi.isBarterCurrency: exactly one item, the gold ingot.

Parameters ​

item ​

BrainItem

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 ​

BrainMob

Returns ​

boolean


isLovedItem() ​

isLovedItem(item): boolean

Defined in: mobs/piglin.ts:101

Java's PiglinAi.isLovedItem.

Parameters ​

item ​

BrainItem

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 ​

BrainMob

Returns ​

boolean


isNotHoldingLovedItemInOffHand() ​

isNotHoldingLovedItemInOffHand(body): boolean

Defined in: mobs/piglin.ts:158

Java's PiglinAi.isNotHoldingLovedItemInOffHand.

Parameters ​

body ​

BrainMob

Returns ​

boolean


isPlayerHoldingLovedItem() ​

isPlayerHoldingLovedItem(player): boolean

Defined in: mobs/piglin.ts:111

Java's PiglinAi.isPlayerHoldingLovedItem.

Parameters ​

player ​

BrainEntity

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 ​

BrainEntity

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 ​

BrainContext

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 ​

BehaviorControl


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 ​

Brain


makeVillagerBrain() ​

makeVillagerBrain(profession, baby): Brain

Defined in: mobs/villager.ts:880

Builds a villager brain for a profession and an age.

Parameters ​

profession ​

VillagerProfession

baby ​

boolean

Returns ​

Brain


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 ​

AngerManagement

canTargetEntity ​

(entity) => boolean

Returns ​

Brain


meetPackage() ​

meetPackage(speedModifier): readonly PrioritizedBehavior[]

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 ​

OneShot


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? ​

MoveToTargetSinkOptions = {}

Returns ​

BehaviorControl


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 ​

EntityPredicate


panicPackage() ​

panicPackage(speedModifier): readonly PrioritizedBehavior[]

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?): readonly ActivityData[]

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 ​

BrainContext

Returns ​

boolean


playPackage() ​

playPackage(speedModifier): readonly PrioritizedBehavior[]

Defined in: mobs/villager.ts:652

Java's getPlayPackage, the baby villager's whole day.

Parameters ​

speedModifier ​

number

Returns ​

readonly PrioritizedBehavior[]


preRaidPackage() ​

preRaidPackage(speedModifier): readonly PrioritizedBehavior[]

Defined in: mobs/villager.ts:800

Java's getPreRaidPackage.

Parameters ​

speedModifier ​

number

Returns ​

readonly PrioritizedBehavior[]


prioritized() ​

prioritized(first, behaviors): readonly PrioritizedBehavior[]

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): readonly PrioritizedBehavior[]

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 ​

UniformInt

maxYaw ​

number

minPitch ​

number

maxPitch ​

number

Returns ​

BehaviorControl


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 ​

OneShot


rangeOfSeconds() ​

rangeOfSeconds(min, max): UniformInt

Defined in: behavior/common.ts:36

Java's TimeUtil.rangeOfSeconds.

Parameters ​

min ​

number

max ​

number

Returns ​

UniformInt


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 ​

BrainMobRegistry

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 ​

BrainContext

Returns ​

void


restPackage() ​

restPackage(speedModifier): readonly PrioritizedBehavior[]

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 ​

UniformInt

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 ​

Schedule

dayTime ​

number

Returns ​

Activity


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 ​

Trigger

second ​

OneShot

Returns ​

OneShot


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 ​

Activity

Returns ​

OneShot


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 ​

BrainContext

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 ​

BrainContext

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 ​

EntityPredicate

maxDist ​

number

Returns ​

OneShot


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 ​

UniformInt

predicate? ​

EntityPredicate = ...

Returns ​

OneShot


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 ​

OneShot


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 ​

BrainContext

target ​

BrainEntity

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 ​

BrainContext

target ​

BrainEntity

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 ​

BrainContext

target ​

BrainEntity

Returns ​

void


setWalkAndLookTargets() ​

setWalkAndLookTargets(body, target, speedModifier, closeEnoughDist): void

Defined in: behavior/common.ts:56

Java's BehaviorUtils.setWalkAndLookTargetMemories.

Parameters ​

body ​

BrainMob

target ​

PositionTracker

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 ​

OneShot


setWalkTargetFromAttackTargetIfTargetOutOfReach() ​

setWalkTargetFromAttackTargetIfTargetOutOfReach(speedModifier): OneShot

Defined in: behavior/common.ts:588

Java's SetWalkTargetFromAttackTargetIfTargetOutOfReach: closes on the attack target.

Parameters ​

speedModifier ​

number | ((body) => number)

Returns ​

OneShot


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 ​

OneShot


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 ​

BehaviorControl


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 ​

TargetFinder

canAttack? ​

(context) => boolean

Returns ​

OneShot


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 ​

BrainContext

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 ​

OneShot


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 ​

OneShot


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 ​

OneShot


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 ​

BehaviorControl


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? ​

MemoryConditions

eraseOnStop? ​

readonly MemoryModuleType<unknown>[]

onStart? ​

(context) => void

onStop? ​

(context) => void

startSound? ​

string

Returns ​

BehaviorControl


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 ​

PositionTracker


tradeWithVillager() ​

tradeWithVillager(): BehaviorControl

Defined in: mobs/villager.ts:374

Java's TradeWithVillager: food and seeds change hands between two villagers who meet.

Returns ​

BehaviorControl


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 ​

OrderPolicy

runningPolicy ​

RunningPolicy

Returns ​

OneShot


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 ​

OneShot


triggerOneShuffled() ​

triggerOneShuffled(behaviors): OneShot

Defined in: behavior/gate.ts:202

Java's TriggerGate.triggerOneShuffled.

Parameters ​

behaviors ​

readonly WeightedTrigger[]

Returns ​

OneShot


uniformInt() ​

uniformInt(min, max): UniformInt

Defined in: behavior/common.ts:31

Builds a UniformInt. Java's UniformInt.of.

Parameters ​

min ​

number

max ​

number

Returns ​

UniformInt


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 ​

OneShot


villagerActivities() ​

villagerActivities(profession, baby): readonly ActivityData[]

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 ​

VillagerProfession

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 ​

BehaviorControl


visibleEntities() ​

visibleEntities(entities): NearestVisibleLivingEntities

Defined in: memory.ts:66

Builds a NearestVisibleLivingEntities over an already-sorted, already-visible list.

Parameters ​

entities ​

readonly BrainEntity[]

Returns ​

NearestVisibleLivingEntities


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 ​

WalkTarget


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 ​

BrainItem

context ​

BrainContext

Returns ​

boolean


wardenActivities() ​

wardenActivities(anger, followRange): readonly ActivityData[]

Defined in: mobs/warden.ts:594

The warden's eight activities: the core package, emerge, dig, idle, roar, fight, investigate and sniff.

Parameters ​

anger ​

WardenAnger

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): readonly PrioritizedBehavior[]

Defined in: mobs/villager.ts:619

Java's getWorkPackage. The farmer's two farming weights differ from everyone else's.

Parameters ​

profession ​

VillagerProfession

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[]