Skip to content

API reference / @jsprismarine/client / BreakBehavior

Class: BreakBehavior ​

Defined in: client/src/bot/behavior/BreakBehavior.ts:23

Repeatedly starts and finishes breaking the block underfoot.

Aimed under the bot rather than at anything in particular, because the client has no terrain model yet - it does not know what is where, only where it is. The server resolves the position itself, so the traffic and the work it causes are real even when the block turns out to be air.

The three-step sequence is what a real client sends, and sending only the last step is the shortcut worth not taking: a server that tracks break progress would see a destroy for a block nobody had started on, which is a rejection path rather than the one being measured.

Implements ​

Constructors ​

Constructor ​

new BreakBehavior(): BreakBehavior

Returns ​

BreakBehavior

Properties ​

name ​

readonly name: "break" = 'break'

Defined in: client/src/bot/behavior/BreakBehavior.ts:24

Implementation of ​

Behavior.name

Methods ​

tick() ​

tick(context): Promise<void>

Defined in: client/src/bot/behavior/BreakBehavior.ts:26

Called on every tick of the bot that owns it.

Parameters ​

context ​

BehaviorContext

Returns ​

Promise<void>

Implementation of ​

Behavior.tick