API reference / @jsprismarine/entity-goals / RecordingActuator
Class: RecordingActuator
Defined in: harness.ts:26
An actuator that records what the goals asked it to do.
Implements
Constructors
Constructor
new RecordingActuator(
at?):RecordingActuator
Defined in: harness.ts:48
Parameters
at?
EntityPosition = ...
Returns
RecordingActuator
Properties
at
at:
EntityPosition
Defined in: harness.ts:31
Where the entity stands; a test moves it by assigning to this.
follow
follow:
boolean=true
Defined in: harness.ts:46
Whether a walk request moves the entity there at once.
A real server moves the entity over several ticks; the double jumps it, so a goal that waits for arrival finishes in the next tick instead of in forty. Set it to false to watch a goal that is going nowhere.
log
readonlylog:string[] =[]
Defined in: harness.ts:28
Every call, in order, as moveTo 1,2,3 @1.25 and the like.
player
player:
EntityPosition|undefined
Defined in: harness.ts:37
What RecordingActuator.nearestPlayer hands back.
wander
wander:
EntityPosition|undefined
Defined in: harness.ts:34
What RecordingActuator.randomTarget hands back, or undefined for none.
Methods
count()
count(
prefix):number
Defined in: harness.ts:89
How many times a call of this shape was made.
Parameters
prefix
string
Returns
number
jump()
jump():
void
Defined in: harness.ts:74
Records a jump.
Returns
void
Implementation of
lookAt()
lookAt(
position):void
Defined in: harness.ts:69
Records a look request.
Parameters
position
Returns
void
Implementation of
moveTo()
moveTo(
position,speedMultiplier):void
Defined in: harness.ts:58
Records a walk request.
Parameters
position
speedMultiplier
number
Returns
void
Implementation of
nearestPlayer()
nearestPlayer():
EntityPosition|undefined
Defined in: harness.ts:84
Hands back RecordingActuator.player.
Returns
EntityPosition | undefined
Implementation of
position()
position():
EntityPosition
Defined in: harness.ts:53
Where the entity is now.
Returns
Implementation of
randomTarget()
randomTarget():
EntityPosition|undefined
Defined in: harness.ts:79
Hands back RecordingActuator.wander.
Returns
EntityPosition | undefined
Implementation of
stopMoving()
stopMoving():
void
Defined in: harness.ts:64
Records that the path was abandoned.
Returns
void