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
type
string
options?
TestEntityOptions = {}
Returns
TestMob
Overrides
Properties
alive
alive:
boolean
Defined in: testWorld.ts:69
Implementation of
Inherited from
armorItems
armorItems:
BrainItem[]
Defined in: testWorld.ts:77
Implementation of
Inherited from
attacks
readonlyattacks:BrainEntity[] =[]
Defined in: testWorld.ts:167
Every attack call, in order.
baby
baby:
boolean
Defined in: testWorld.ts:70
Implementation of
Inherited from
conditions
conditions:
Set<string>
Defined in: testWorld.ts:74
See EntityConditions.
Implementation of
Inherited from
creative
creative:
boolean
Defined in: testWorld.ts:72
Inherited from
dimensions
readonlydimensions:EntityDimensions
Defined in: testWorld.ts:68
Its Java collision box, when the host can provide it.
Implementation of
Inherited from
id
readonlyid:string
Defined in: testWorld.ts:65
A stable identity, used wherever Java stores a UUID in a memory.
Implementation of
Inherited from
jumps
jumps:
number=0
Defined in: testWorld.ts:170
looks
readonlylooks:Vec3[] =[]
Defined in: testWorld.ts:165
Every lookAt call, in order.
mainHandItem
mainHandItem:
BrainItem|undefined
Defined in: testWorld.ts:75
Implementation of
Inherited from
navigation
readonlynavigation:TestNavigation
Defined in: testWorld.ts:163
Implementation of
offHandItem
offHandItem:
BrainItem|undefined
Defined in: testWorld.ts:76
Implementation of
Inherited from
position
position:
Vec3
Defined in: testWorld.ts:67
Implementation of
Inherited from
sounds
readonlysounds:string[] =[]
Defined in: testWorld.ts:169
Every playSound call, in order.
spectator
spectator:
boolean
Defined in: testWorld.ts:71
Implementation of
Inherited from
type
readonlytype:string
Defined in: testWorld.ts:66
The entity type id, such as minecraft:piglin.
Implementation of
Inherited from
typeTags
typeTags:
Set<string>
Defined in: testWorld.ts:73
The entity type tags, such as minecraft:axolotl_hunt_targets.
Implementation of
Inherited from
Accessors
brain
Get Signature
get brain():
Brain
Defined in: testWorld.ts:190
Returns
Implementation of
context
Get Signature
get context():
BrainContext
Defined in: testWorld.ts:198
The BrainContext for this mob in its world.
Returns
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
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
Returns
void
Implementation of
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
canBeTargeted()
canBeTargeted():
boolean
Defined in: testWorld.ts:96
Whether combat AI may choose this test entity as a target.
Returns
boolean
Implementation of
Inherited from
jump()
jump():
void
Defined in: testWorld.ts:217
Counts the call in jumps.
Returns
void
Implementation of
lookAt()
lookAt(
position):void
Defined in: testWorld.ts:212
Records the call in looks. The double has no facing of its own.
Parameters
position
Returns
void
Implementation of
playSound()
playSound(
sound):void
Defined in: testWorld.ts:227
Records the sound name in sounds.
Parameters
sound
string
Returns
void
Implementation of
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
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