API reference / @jsprismarine/client / WalkBehavior
Class: WalkBehavior
Defined in: client/src/bot/behavior/WalkBehavior.ts:24
Walks, changing direction now and then.
A random walk rather than a path: the load this puts on a server is chunk streaming and entity tracking, and both care about where players are and how fast that changes, not about whether the route makes sense. Pathfinding would only make the traffic harder to reason about.
The bot keeps its own position because the client core has no game state layer yet. That means it can walk into a wall and the server will simply not agree - which is fine for measuring, and would not be fine for anything else.
Implements
Constructors
Constructor
new WalkBehavior():
WalkBehavior
Returns
WalkBehavior
Properties
name
readonlyname:"walk"='walk'
Defined in: client/src/bot/behavior/WalkBehavior.ts:25
Implementation of
Methods
tick()
tick(
context):Promise<void>
Defined in: client/src/bot/behavior/WalkBehavior.ts:30
Called on every tick of the bot that owns it.
Parameters
context
Returns
Promise<void>