Skip to content

API reference / @jsprismarine/entity-brains / TestMob

Class: TestMob ​

Defined in: testWorld.ts:162

A mob in the test world, with its brain and the calls behaviors made on it.

Extends ​

Implements ​

Constructors ​

Constructor ​

new TestMob(world, type, options?): TestMob

Defined in: testWorld.ts:175

Parameters ​

world ​

TestWorld

type ​

string

options? ​

TestEntityOptions = {}

Returns ​

TestMob

Overrides ​

TestEntity.constructor

Properties ​

alive ​

alive: boolean

Defined in: testWorld.ts:69

Implementation of ​

BrainMob.alive

Inherited from ​

TestEntity.alive


armorItems ​

armorItems: BrainItem[]

Defined in: testWorld.ts:77

Implementation of ​

BrainMob.armorItems

Inherited from ​

TestEntity.armorItems


attacks ​

readonly attacks: BrainEntity[] = []

Defined in: testWorld.ts:167

Every attack call, in order.


baby ​

baby: boolean

Defined in: testWorld.ts:70

Implementation of ​

BrainMob.baby

Inherited from ​

TestEntity.baby


conditions ​

conditions: Set<string>

Defined in: testWorld.ts:74

See EntityConditions.

Implementation of ​

BrainMob.conditions

Inherited from ​

TestEntity.conditions


creative ​

creative: boolean

Defined in: testWorld.ts:72

Inherited from ​

TestEntity.creative


dimensions ​

readonly dimensions: EntityDimensions

Defined in: testWorld.ts:68

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

Implementation of ​

BrainMob.dimensions

Inherited from ​

TestEntity.dimensions


id ​

readonly id: string

Defined in: testWorld.ts:65

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

Implementation of ​

BrainMob.id

Inherited from ​

TestEntity.id


jumps ​

jumps: number = 0

Defined in: testWorld.ts:170


looks ​

readonly looks: Vec3[] = []

Defined in: testWorld.ts:165

Every lookAt call, in order.


mainHandItem ​

mainHandItem: BrainItem | undefined

Defined in: testWorld.ts:75

Implementation of ​

BrainMob.mainHandItem

Inherited from ​

TestEntity.mainHandItem


readonly navigation: TestNavigation

Defined in: testWorld.ts:163

Implementation of ​

BrainMob.navigation


offHandItem ​

offHandItem: BrainItem | undefined

Defined in: testWorld.ts:76

Implementation of ​

BrainMob.offHandItem

Inherited from ​

TestEntity.offHandItem


position ​

position: Vec3

Defined in: testWorld.ts:67

Implementation of ​

BrainMob.position

Inherited from ​

TestEntity.position


sounds ​

readonly sounds: string[] = []

Defined in: testWorld.ts:169

Every playSound call, in order.


spectator ​

spectator: boolean

Defined in: testWorld.ts:71

Implementation of ​

BrainMob.spectator

Inherited from ​

TestEntity.spectator


type ​

readonly type: string

Defined in: testWorld.ts:66

The entity type id, such as minecraft:piglin.

Implementation of ​

BrainMob.type

Inherited from ​

TestEntity.type


typeTags ​

typeTags: Set<string>

Defined in: testWorld.ts:73

The entity type tags, such as minecraft:axolotl_hunt_targets.

Implementation of ​

BrainMob.typeTags

Inherited from ​

TestEntity.typeTags

Accessors ​

brain ​

Get Signature ​

get brain(): Brain

Defined in: testWorld.ts:190

Returns ​

Brain

Implementation of ​

BrainMob.brain


context ​

Get Signature ​

get context(): BrainContext

Defined in: testWorld.ts:198

The BrainContext for this mob in its world.

Returns ​

BrainContext

Methods ​

attach() ​

attach(brain): this

Defined in: testWorld.ts:185

Gives the mob its brain. Separate from the constructor because a brain needs a body.

Parameters ​

brain ​

Brain

Returns ​

this


attack() ​

attack(target): void

Defined in: testWorld.ts:222

Records the target in attacks. No damage is dealt; the double has no combat.

Parameters ​

target ​

BrainEntity

Returns ​

void

Implementation of ​

BrainMob.attack


attribute() ​

attribute(attribute): number

Defined in: testWorld.ts:232

The attribute a test passed in, or 0. Follow range and tempt range have defaults.

Parameters ​

attribute ​

string

Returns ​

number

Implementation of ​

BrainMob.attribute


canBeTargeted() ​

canBeTargeted(): boolean

Defined in: testWorld.ts:96

Whether combat AI may choose this test entity as a target.

Returns ​

boolean

Implementation of ​

BrainMob.canBeTargeted

Inherited from ​

TestEntity.canBeTargeted


jump() ​

jump(): void

Defined in: testWorld.ts:217

Counts the call in jumps.

Returns ​

void

Implementation of ​

BrainMob.jump


lookAt() ​

lookAt(position): void

Defined in: testWorld.ts:212

Records the call in looks. The double has no facing of its own.

Parameters ​

position ​

Vec3

Returns ​

void

Implementation of ​

BrainMob.lookAt


playSound() ​

playSound(sound): void

Defined in: testWorld.ts:227

Records the sound name in sounds.

Parameters ​

sound ​

string

Returns ​

void

Implementation of ​

BrainMob.playSound


setCondition() ​

setCondition(condition, value): void

Defined in: testWorld.ts:203

Adds or removes an entity condition, which is how a test watches flags such as aggressive.

Parameters ​

condition ​

string

value ​

boolean

Returns ​

void

Implementation of ​

BrainMob.setCondition


tickBrain() ​

tickBrain(): void

Defined in: testWorld.ts:237

One brain tick for this mob: updateActivity is the caller's, as it is in Java.

Returns ​

void