Skip to content

API reference / @jsprismarine/prismarine / input/Intent

input/Intent ​

Interfaces ​

IntentDefinition ​

Defined in: packages/prismarine/src/input/Intent.ts:481

What the table declares about one intent.

Properties ​

lane ​

readonly lane: "read" | "input" | "connection"

Defined in: packages/prismarine/src/input/Intent.ts:483

When the intent's handler runs; see Lane.


IntentPayloads ​

Defined in: packages/prismarine/src/input/Intent.ts:82

What each intent carries beside its kind. Every field is plain data (ADR 0011), so an intent can be recorded, replayed and compared.

Properties ​

animate ​

readonly animate: object

Defined in: packages/prismarine/src/input/Intent.ts:91

The player animated itself. data is what the animation carries, zero for the ones that carry nothing, and swingSource names what caused a swing, or is null.

animation ​

readonly animation: "swing" | "wakeUp" | "criticalHit" | "magicCriticalHit"

data ​

readonly data: number

swingSource ​

readonly swingSource: string | null

answerForm ​

readonly answerForm: object

Defined in: packages/prismarine/src/input/Intent.ts:335

The player answered a form a script showed it, by form id: response is the answer's JSON, or null for a form closed without one, when cancelReason says why, as the Script API's FormCancelationReason numbers it.

cancelReason ​

readonly cancelReason: number | null

formId ​

readonly formId: number

response ​

readonly response: string | null

attackEntity ​

readonly attackEntity: object

Defined in: packages/prismarine/src/input/Intent.ts:271

The player hit an actor, by runtime id, with the item in hand.

target ​

readonly target: bigint

changeGameMode ​

readonly changeGameMode: object

Defined in: packages/prismarine/src/input/Intent.ts:143

The player picked a game mode for itself, as a Gametype id or any number a client sent.

gamemode ​

readonly gamemode: number

chat ​

readonly chat: object

Defined in: packages/prismarine/src/input/Intent.ts:134

The player typed a chat message, already cut to what a chat box could have produced, with its client's signature when it signed it.

message ​

readonly message: string

signature? ​

readonly optional signature?: ChatSignature

clickContainer ​

readonly clickContainer: ContainerClick & object

Defined in: packages/prismarine/src/input/Intent.ts:207

The player clicked a slot of a window, by window id: the slot, the button and how the click moves stacks, which the server works out the moves of as vanilla's container menu does.

Type Declaration ​
window ​

readonly window: number

closeContainer ​

readonly closeContainer: object

Defined in: packages/prismarine/src/input/Intent.ts:202

The player closed a container screen, by window id. containerType is the Bedrock container type the client sent, which the reply echoes until the presenter owns the reply.

containerType ​

readonly containerType: number

window ​

readonly window: number

closeLoadingScreen ​

readonly closeLoadingScreen: object

Defined in: packages/prismarine/src/input/Intent.ts:157

The client closed the loading screen of a world change, by the id the server gave it.

id ​

readonly id: number

completeCommand ​

readonly completeCommand: object

Defined in: packages/prismarine/src/input/Intent.ts:175

The player's client asked what the command line it is typing could go on with, numbering the request so the answer can name it. The line has its slash.

line ​

readonly line: string

request ​

readonly request: number

damageAnvil ​

readonly damageAnvil: object

Defined in: packages/prismarine/src/input/Intent.ts:313

The player's anvil screen asked for the anvil it worked at to wear down.

position ​

readonly position: object

position.x ​

readonly x: number

position.y ​

readonly y: number

position.z ​

readonly z: number

dropHeldItem ​

readonly dropHeldItem: object

Defined in: packages/prismarine/src/input/Intent.ts:392

The player pressed the drop key: one item of the stack in its hand, or with all the whole stack, which it throws ahead of itself.

all ​

readonly all: boolean

eat ​

readonly eat: object

Defined in: packages/prismarine/src/input/Intent.ts:102

The player started eating. item is the item's network id, as the Bedrock client reports it.

item ​

readonly item: number

editBook ​

readonly editBook: object

Defined in: packages/prismarine/src/input/Intent.ts:341

The player edited the book and quill in a slot of its inventory, the hotbar's 9 first.

edit ​

readonly edit: BookEditStep

slot ​

readonly slot: number

editCommandBlock ​

readonly editCommandBlock: object

Defined in: packages/prismarine/src/input/Intent.ts:346

The player set a command block's command and options on its screen. A field a client does not send, as Java's sends no name, tick delay or first-tick setting, is left as it was.

command ​

readonly command: string

conditional ​

readonly conditional: boolean

customName? ​

readonly optional customName?: string

executeOnFirstTick? ​

readonly optional executeOnFirstTick?: boolean

mode ​

readonly mode: "repeat" | "chain" | "impulse"

needsRedstone ​

readonly needsRedstone: boolean

Off is always active.

position ​

readonly position: object

position.x ​

readonly x: number

position.y ​

readonly y: number

position.z ​

readonly z: number

tickDelay? ​

readonly optional tickDelay?: number

trackOutput ​

readonly trackOutput: boolean

editCommandMinecart ​

readonly editCommandMinecart: object

Defined in: packages/prismarine/src/input/Intent.ts:382

The player set the command a command block minecart runs, naming the cart by runtime id.

command ​

readonly command: string

customName? ​

readonly optional customName?: string

target ​

readonly target: bigint

trackOutput ​

readonly trackOutput: boolean

editSign ​

readonly editSign: object

Defined in: packages/prismarine/src/input/Intent.ts:362

The player wrote a sign. A Bedrock client sends both faces each time and a Java client the face it edited, so a face left out keeps its text.

back? ​

readonly optional back?: string

front? ​

readonly optional front?: string

position ​

readonly position: object

position.x ​

readonly x: number

position.y ​

readonly y: number

position.z ​

readonly z: number

editStructureBlock ​

readonly editStructureBlock: object

Defined in: packages/prismarine/src/input/Intent.ts:368

The player left a structure block's screen with structure as the structure's name.

position ​

readonly position: object

position.x ​

readonly x: number

position.y ​

readonly y: number

position.z ​

readonly z: number

structure ​

readonly structure: string

emote ​

readonly emote: object

Defined in: packages/prismarine/src/input/Intent.ts:107

The player played an emote, by the emote piece's uuid, for lengthTicks. platformId and flags are what the client sent; the handler adds the server's own account id and flag.

emote ​

readonly emote: string

flags ​

readonly flags: number

lengthTicks ​

readonly lengthTicks: number

platformId ​

readonly platformId: string

finishCredits ​

readonly finishCredits: Record<never, never>

Defined in: packages/prismarine/src/input/Intent.ts:150

The player reported the end credits finished.

holdButtons ​

readonly holdButtons: object

Defined in: packages/prismarine/src/input/Intent.ts:439

Which of the buttons scripts hear of the player holds: the jump and sneak buttons.

jump ​

readonly jump: boolean

sneak ​

readonly sneak: boolean

holdMoveKeys ​

readonly holdMoveKeys: object

Defined in: packages/prismarine/src/input/Intent.ts:292

The movement keys the player holds, each time they change, which push a minecart the player sits in front of.

backward ​

readonly backward: boolean

forward ​

readonly forward: boolean

left ​

readonly left: boolean

readonly right: boolean

interactEntity ​

readonly interactEntity: object

Defined in: packages/prismarine/src/input/Intent.ts:273

The player used the item in hand on an actor, by runtime id, which is how a spawn egg or a lead works.

target ​

readonly target: bigint

jump ​

readonly jump: Record<never, never>

Defined in: packages/prismarine/src/input/Intent.ts:421

The player jumped.

leaveBed ​

readonly leaveBed: Record<never, never>

Defined in: packages/prismarine/src/input/Intent.ts:437

The player asked to get out of the bed it lies in. Lying down is the server's to decide, when the player uses a bed.

mineBlock ​

readonly mineBlock: object

Defined in: packages/prismarine/src/input/Intent.ts:243

The player mined a block, one step at a time. face is the face struck, 0 to 5 for down, up, north, south, west and east, which both editions number alike.

serverTimed says the server times the break and checks the client's finish against it, as it does for every Java client and for a Bedrock one under server-authoritative-block-breaking; otherwise the client times it and reports the break another way. breaksIfInstant is set for a client that starts mining a block that gives way at once and sends nothing more for it, as Java's does; Bedrock's reports it as a finish. serverBreaks is set for a client that cannot time the block at all and never reports the break, as a Java client mining a borrowed block state does: the server breaks the block itself once its time is up.

breaksIfInstant ​

readonly breaksIfInstant: boolean

face ​

readonly face: number

position ​

readonly position: object

position.x ​

readonly x: number

position.y ​

readonly y: number

position.z ​

readonly z: number

serverBreaks? ​

readonly optional serverBreaks?: boolean

serverTimed ​

readonly serverTimed: boolean

step ​

readonly step: "stop" | "start" | "continue" | "swing" | "abort" | "finish" | "instant"

move ​

readonly move: object

Defined in: packages/prismarine/src/input/Intent.ts:410

Where the client says its player is and which way it faces. The server does not simulate movement, so it takes the client's word, through the playerMove event.

handledTeleport ​

readonly handledTeleport: boolean

Whether the client says it handled the last teleport, so the move is from after it.

headYaw ​

readonly headYaw: number

onGround ​

readonly onGround: boolean

pitch ​

readonly pitch: number

position ​

readonly position: object

The player's eyes, as every client reports them.

position.x ​

readonly x: number

position.y ​

readonly y: number

position.z ​

readonly z: number

yaw ​

readonly yaw: number

moveStacks ​

readonly moveStacks: object

Defined in: packages/prismarine/src/input/Intent.ts:213

The player named moves of stacks between slots, as requests each applied all or nothing (inventory/stackRequest.ts). names says how the client knows the slots the server touches on its own, which the answers name them by.

names ​

readonly names: StackSlotNames

requests ​

readonly requests: readonly StackRequest[]

moveVehicle ​

readonly moveVehicle: object

Defined in: packages/prismarine/src/input/Intent.ts:280

The player's client moved the vehicle the player steers, which a client moves itself: where its feet went and which way it faces.

onGround ​

readonly onGround: boolean

pitch ​

readonly pitch: number

position ​

readonly position: object

position.x ​

readonly x: number

position.y ​

readonly y: number

position.z ​

readonly z: number

yaw ​

readonly yaw: number

openInventory ​

readonly openInventory: Record<never, never>

Defined in: packages/prismarine/src/input/Intent.ts:84

The player pressed the inventory button.

openLoadingScreen ​

readonly openLoadingScreen: object

Defined in: packages/prismarine/src/input/Intent.ts:155

The client opened the loading screen of a world change, by the id the server gave the screen when it sent the change.

id ​

readonly id: number

openMountInventory ​

readonly openMountInventory: Record<never, never>

Defined in: packages/prismarine/src/input/Intent.ts:306

The player asked for the inventory screen of the mount it rides.

openNpc ​

readonly openNpc: object

Defined in: packages/prismarine/src/input/Intent.ts:86

The player opened an NPC's dialogue, naming the actor by runtime id.

target ​

readonly target: bigint

paddleBoat ​

readonly paddleBoat: object

Defined in: packages/prismarine/src/input/Intent.ts:287

The player rows its boat with the left paddle, the right one, both or neither.

left ​

readonly left: boolean

right ​

readonly right: boolean

pickBlock ​

readonly pickBlock: object

Defined in: packages/prismarine/src/input/Intent.ts:444

The player middle-clicked a block to take its item into the hand, and with withData asked for the block's data on the item too.

position ​

readonly position: object

position.x ​

readonly x: number

position.y ​

readonly y: number

position.z ​

readonly z: number

withData ​

readonly withData: boolean

pickEntity ​

readonly pickEntity: object

Defined in: packages/prismarine/src/input/Intent.ts:452

The player middle-clicked an actor, by runtime id, to take its spawn egg into the hand, and with withData asked for the actor's data too.

target ​

readonly target: bigint

withData ​

readonly withData: boolean

placeRecipe ​

readonly placeRecipe: object

Defined in: packages/prismarine/src/input/Intent.ts:464

The player clicked a recipe in the book of an open window, by its Java recipe id: fill the window's grid with one craft's ingredients from the inventory, or with useMaxItems as many crafts as the inventory holds.

recipe ​

readonly recipe: string

useMaxItems ​

readonly useMaxItems: boolean

window ​

readonly window: number

playerInitialized ​

readonly playerInitialized: Record<never, never>

Defined in: packages/prismarine/src/input/Intent.ts:197

The client finished spawning and has a player to show.

playSound ​

readonly playSound: object

Defined in: packages/prismarine/src/input/Intent.ts:118

The player made a sound at a point, which the server relays to the players near it. The fields are the sound as the Bedrock client reports it: sound is the level sound id, type the actor identifier it attributes the sound to, and actor its unique id or -1.

actor ​

readonly actor: bigint

baby ​

readonly baby: boolean

data ​

readonly data: number

firedAt ​

readonly firedAt: { x: number; y: number; z: number; } | null

global ​

readonly global: boolean

sound ​

readonly sound: number

type ​

readonly type: string

x ​

readonly x: number

y ​

readonly y: number

z ​

readonly z: number

pressContainerButton ​

readonly pressContainerButton: object

Defined in: packages/prismarine/src/input/Intent.ts:227

The player pressed one of a window's buttons, by window id and the id the screen gives the button: an enchanting table's rows are 0 to 2.

button ​

readonly button: number

window ​

readonly window: number

pressRespawn ​

readonly pressRespawn: Record<never, never>

Defined in: packages/prismarine/src/input/Intent.ts:195

A dead player pressed the respawn button on its death screen.

queryBossBar ​

readonly queryBossBar: object

Defined in: packages/prismarine/src/input/Intent.ts:100

The player asked about a boss bar it has on screen. A Bedrock client names the bar's actor, which its decoder turns into the bar's id (ShownBossBar.id).

bar ​

readonly bar: number

releaseItem ​

readonly releaseItem: object

Defined in: packages/prismarine/src/input/Intent.ts:311

The player let go of the item it was using: release for a bow's arrow leaving or a meal cut short, consume for a client saying the use ran its course.

action ​

readonly action: "release" | "consume"

renameItem ​

readonly renameItem: object

Defined in: packages/prismarine/src/input/Intent.ts:217

The player typed a name into an open anvil's field: the whole field as it stands.

name ​

readonly name: string

requestAbility ​

readonly requestAbility: object

Defined in: packages/prismarine/src/input/Intent.ts:148

The player asked to change one of its own abilities, by the ability's name and the value it sent: a boolean, a number, or null when the request carried none.

ability ​

readonly ability: string

value ​

readonly value: number | boolean | null

requestGameRules ​

readonly requestGameRules: Record<never, never>

Defined in: packages/prismarine/src/input/Intent.ts:181

An operator's client opened its game rules screen, which lists the world's rules.

requestStatistics ​

readonly requestStatistics: Record<never, never>

Defined in: packages/prismarine/src/input/Intent.ts:179

The player opened its statistics screen, which lists its statistics.

respawn ​

readonly respawn: Record<never, never>

Defined in: packages/prismarine/src/input/Intent.ts:193

A dead player's client is ready to spawn and asks where it will come back, which Bedrock's death screen does before it offers the respawn button.

runCommand ​

readonly runCommand: object

Defined in: packages/prismarine/src/input/Intent.ts:170

The player issued a command line, with or without its leading slash. request is the request a client numbered the line with and waits on the answer to, as Bedrock's chat screen does; a line sent with none is answered by its messages alone.

command ​

readonly command: string

request? ​

readonly optional request?: CommandRequest

scriptMessage ​

readonly scriptMessage: object

Defined in: packages/prismarine/src/input/Intent.ts:188

The client's scripts sent the server's scripts a message.

id ​

readonly id: string

value ​

readonly value: string

seeRecipe ​

readonly seeRecipe: object

Defined in: packages/prismarine/src/input/Intent.ts:466

The player looked at a recipe its book highlighted, by its Java recipe id.

recipe ​

readonly recipe: string

selectAdvancementsTab ​

readonly selectAdvancementsTab: object

Defined in: packages/prismarine/src/input/Intent.ts:177

The player's advancements screen opened a tab, by its root's id.

tab ​

readonly tab: string

selectBundleItem ​

readonly selectBundleItem: object

Defined in: packages/prismarine/src/input/Intent.ts:477

The player picked a stack in a bundle's tooltip: the slot of its open window the bundle is in, numbered as the window numbers its slots, and the stack's place in the bundle, or -1 for none.

index ​

readonly index: number

slot ​

readonly slot: number

selectHotbarSlot ​

readonly selectHotbarSlot: object

Defined in: packages/prismarine/src/input/Intent.ts:229

The player moved its hand to a hotbar slot, 0 to 8.

slot ​

readonly slot: number

selectTrade ​

readonly selectTrade: object

Defined in: packages/prismarine/src/input/Intent.ts:215

The player picked an offer on an open trade screen, by its place in the offers.

index ​

readonly index: number

setBeaconEffects ​

readonly setBeaconEffects: object

Defined in: packages/prismarine/src/input/Intent.ts:222

The player chose an open beacon's effects, each by namespaced id, such as minecraft:speed, or null for none, and pays for them with the stack in the beacon's payment slot.

primary ​

readonly primary: string | null

secondary ​

readonly secondary: string | null

setCreativeSlot ​

readonly setCreativeSlot: object

Defined in: packages/prismarine/src/input/Intent.ts:401

A creative player put a stack in a slot of its own inventory, or emptied it, as a Java client says outright. container is the inventory's 36 slots (the hotbar's 9 first), armor (head first) or offhand; item names the stack by its Bedrock identifier, with what it changes from the item's defaults.

container ​

readonly container: "armor" | "offhand" | "inventory"

item ​

readonly item: ShownStack | null

slot ​

readonly slot: number

setDefaultGameMode ​

readonly setDefaultGameMode: object

Defined in: packages/prismarine/src/input/Intent.ts:159

The player picked a default game mode for the server, as a Gametype id or any number a client sent.

gamemode ​

readonly gamemode: number

setDifficulty ​

readonly setDifficulty: object

Defined in: packages/prismarine/src/input/Intent.ts:141

The player picked the server's difficulty, as a Difficulty id or any number a client sent.

difficulty ​

readonly difficulty: number

setFlying ​

readonly setFlying: object

Defined in: packages/prismarine/src/input/Intent.ts:427

The player started or stopped flying, which the server allows or refuses.

flying ​

readonly flying: boolean

setGameRules ​

readonly setGameRules: object

Defined in: packages/prismarine/src/input/Intent.ts:186

An operator changed game rules from its game rules screen, each by its 1.21.11 id with the value it chose, already read as the rule's type.

rules ​

readonly rules: readonly ShownGameRule[]

setGliding ​

readonly setGliding: object

Defined in: packages/prismarine/src/input/Intent.ts:432

The player started or stopped gliding on an elytra, which the server allows only off the ground, out of water and with something to glide on.

gliding ​

readonly gliding: boolean

setPlayerPermission ​

readonly setPlayerPermission: object

Defined in: packages/prismarine/src/input/Intent.ts:164

The player asked to set another player's permission level. level is a PlayerPermissionLevel, and customFlags the flag set a custom level carries.

customFlags ​

readonly customFlags: number

level ​

readonly level: number

target ​

readonly target: bigint

setRecipeBook ​

readonly setRecipeBook: object

Defined in: packages/prismarine/src/input/Intent.ts:329

The player changed a recipe book's settings: whether the book is open, or null when the client does not say, and whether it shows only the recipes the player can make.

book ​

readonly book: "crafting" | "furnace" | "smoker" | "blastFurnace"

filtering ​

readonly filtering: boolean

open ​

readonly open: boolean | null

setSneaking ​

readonly setSneaking: object

Defined in: packages/prismarine/src/input/Intent.ts:425

The player started or stopped sneaking.

sneaking ​

readonly sneaking: boolean

setSprinting ​

readonly setSprinting: object

Defined in: packages/prismarine/src/input/Intent.ts:423

The player started or stopped sprinting.

sprinting ​

readonly sprinting: boolean

setViewDistance ​

readonly setViewDistance: object

Defined in: packages/prismarine/src/input/Intent.ts:139

The player asked for a view distance in chunks. maxRadius is the most its client can render, or zero when it stated none.

maxRadius ​

readonly maxRadius: number

radius ​

readonly radius: number

stab ​

readonly stab: Record<never, never>

Defined in: packages/prismarine/src/input/Intent.ts:471

The player stabbed with the spear in its main hand, which hits every entity along the spear's reach.

startRidingJump ​

readonly startRidingJump: object

Defined in: packages/prismarine/src/input/Intent.ts:302

The player let go of jump on the mount it steers, which leaps with strength, from 1 to 100, as long as the jump key was held.

strength ​

readonly strength: number

stopRiding ​

readonly stopRiding: Record<never, never>

Defined in: packages/prismarine/src/input/Intent.ts:275

The player asked to get off what it rides.

stopRidingJump ​

readonly stopRidingJump: Record<never, never>

Defined in: packages/prismarine/src/input/Intent.ts:304

The player's mount landed from the leap it started.

swapHands ​

readonly swapHands: Record<never, never>

Defined in: packages/prismarine/src/input/Intent.ts:394

The player pressed the swap hands key: the stack in its hand and the one in its off hand trade places.

toggleCrafterSlot ​

readonly toggleCrafterSlot: object

Defined in: packages/prismarine/src/input/Intent.ts:315

The player turned one of a crafter's nine slots off, or on again, by index from 0.

disabled ​

readonly disabled: boolean

position ​

readonly position: object

position.x ​

readonly x: number

position.y ​

readonly y: number

position.z ​

readonly z: number

slot ​

readonly slot: number

turnLecternPage ​

readonly turnLecternPage: object

Defined in: packages/prismarine/src/input/Intent.ts:454

The player turned the book on a lectern to page, of the book's totalPages.

page ​

readonly page: number

position ​

readonly position: object

position.x ​

readonly x: number

position.y ​

readonly y: number

position.z ​

readonly z: number

totalPages ​

readonly totalPages: number

useItem ​

readonly useItem: object

Defined in: packages/prismarine/src/input/Intent.ts:269

The player used the item in hand at nothing. held says the client reports a button held down since an earlier tick rather than a new click, as Bedrock's does each tick of a draw.

held ​

readonly held: boolean

useItemOnBlock ​

readonly useItemOnBlock: object

Defined in: packages/prismarine/src/input/Intent.ts:255

The player used the item in hand on a block: face the face clicked, 0 to 5 as both editions number them, and faceLocation where on it, each coordinate from 0 to 1.

face ​

readonly face: number

faceLocation ​

readonly faceLocation: object

faceLocation.x ​

readonly x: number

faceLocation.y ​

readonly y: number

faceLocation.z ​

readonly z: number

position ​

readonly position: object

position.x ​

readonly x: number

position.y ​

readonly y: number

position.z ​

readonly z: number

rotation? ​

readonly optional rotation?: object

Which way the player faced when it clicked, as a Bedrock client reports it with the tick's input; absent, the player's own rotation, which a Java client's moves keep.

rotation.pitch ​

readonly pitch: number

rotation.yaw ​

readonly yaw: number

useLabTable ​

readonly useLabTable: object

Defined in: packages/prismarine/src/input/Intent.ts:321

An Education Edition player worked a lab table; action names the step, as the client does.

action ​

readonly action: string

position ​

readonly position: object

position.x ​

readonly x: number

position.y ​

readonly y: number

position.z ​

readonly z: number

useStructureBlock ​

readonly useStructureBlock: object

Defined in: packages/prismarine/src/input/Intent.ts:376

The player asked a structure block to act on its structure: save it, load it, scan the area for its corners, or query or export a saved one. operation names it as the client does.

operation ​

readonly operation: string

position ​

readonly position: object

position.x ​

readonly x: number

position.y ​

readonly y: number

position.z ​

readonly z: number

structure ​

readonly structure: string

Type Aliases ​

BookEditStep ​

BookEditStep = { kind: "replacePage" | "addPage"; page: number; text: string; } | { kind: "deletePage"; page: number; } | { kind: "swapPages"; other: number; page: number; } | { author: string; kind: "sign"; title: string; } | { kind: "setPages"; pages: readonly string[]; title: string | null; }

Defined in: packages/prismarine/src/input/Intent.ts:64

One edit of a book and quill. Bedrock's client sends one page operation at a time and Java's the whole book, so both shapes are here.

  • replacePage, addPage: a page's text, by index from 0.
  • deletePage: a page goes, and the ones after it move up.
  • swapPages: two pages trade places.
  • sign: the book is signed with title under author's name, and becomes a written book.
  • setPages: the book's pages are these, signed with title when there is one.

CommandBlockModeName ​

CommandBlockModeName = typeof COMMAND_BLOCK_MODES[number]

Defined in: packages/prismarine/src/input/Intent.ts:75

One of COMMAND_BLOCK_MODES.


Intent ​

Intent<K> = K extends IntentKind ? object & IntentPayloads[K] : never

Defined in: packages/prismarine/src/input/Intent.ts:639

One intent of kind K: its payload with the kind beside it. Written as a distributive conditional so that Intent<'a' | 'b'> is a union of two shapes, and a generic Intent<K> is assignable to Intent through its constraint.

Type Parameters ​

K ​

K extends IntentKind = IntentKind


IntentKind ​

IntentKind = keyof IntentPayloads

Defined in: packages/prismarine/src/input/Intent.ts:632

The name of an intent, as its kind field carries it.


IntentLane ​

IntentLane<K> = typeof Intents[K]["lane"]

Defined in: packages/prismarine/src/input/Intent.ts:644

The lane the table declares for intent kind K.

Type Parameters ​

K ​

K extends IntentKind


MiningStep ​

MiningStep = typeof MINING_STEPS[number]

Defined in: packages/prismarine/src/input/Intent.ts:46

One of MINING_STEPS.


PlayerAnimation ​

PlayerAnimation = typeof PLAYER_ANIMATIONS[number]

Defined in: packages/prismarine/src/input/Intent.ts:29

One of PLAYER_ANIMATIONS.


RecipeBook ​

RecipeBook = typeof RECIPE_BOOKS[number]

Defined in: packages/prismarine/src/input/Intent.ts:52

One of RECIPE_BOOKS.

Variables ​

COMMAND_BLOCK_MODES ​

const COMMAND_BLOCK_MODES: readonly ["impulse", "repeat", "chain"]

Defined in: packages/prismarine/src/input/Intent.ts:72

The command block modes, in the block behavior family's words.


INTENT_KINDS ​

const INTENT_KINDS: readonly (keyof IntentPayloads)[]

Defined in: packages/prismarine/src/input/Intent.ts:647

Every intent kind, in table order. Object.keys loses the key type, hence the cast.


Intents ​

const Intents: object

Defined in: packages/prismarine/src/input/Intent.ts:490

Every intent and its lane. Adding an intent means adding its payload to IntentPayloads and its row here; the satisfies fails the build when the two disagree.

Type Declaration ​

animate ​

readonly animate: object

animate.lane ​

readonly lane: "input" = 'input'

answerForm ​

readonly answerForm: object

answerForm.lane ​

readonly lane: "input" = 'input'

attackEntity ​

readonly attackEntity: object

attackEntity.lane ​

readonly lane: "input" = 'input'

changeGameMode ​

readonly changeGameMode: object

changeGameMode.lane ​

readonly lane: "input" = 'input'

chat ​

readonly chat: object

chat.lane ​

readonly lane: "input" = 'input'

clickContainer ​

readonly clickContainer: object

clickContainer.lane ​

readonly lane: "input" = 'input'

closeContainer ​

readonly closeContainer: object

closeContainer.lane ​

readonly lane: "input" = 'input'

closeLoadingScreen ​

readonly closeLoadingScreen: object

closeLoadingScreen.lane ​

readonly lane: "input" = 'input'

completeCommand ​

readonly completeCommand: object

completeCommand.lane ​

readonly lane: "read" = 'read'

damageAnvil ​

readonly damageAnvil: object

damageAnvil.lane ​

readonly lane: "read" = 'read'

dropHeldItem ​

readonly dropHeldItem: object

dropHeldItem.lane ​

readonly lane: "input" = 'input'

eat ​

readonly eat: object

eat.lane ​

readonly lane: "input" = 'input'

editBook ​

readonly editBook: object

editBook.lane ​

readonly lane: "read" = 'read'

editCommandBlock ​

readonly editCommandBlock: object

editCommandBlock.lane ​

readonly lane: "input" = 'input'

editCommandMinecart ​

readonly editCommandMinecart: object

editCommandMinecart.lane ​

readonly lane: "input" = 'input'

editSign ​

readonly editSign: object

editSign.lane ​

readonly lane: "input" = 'input'

editStructureBlock ​

readonly editStructureBlock: object

editStructureBlock.lane ​

readonly lane: "read" = 'read'

emote ​

readonly emote: object

emote.lane ​

readonly lane: "input" = 'input'

finishCredits ​

readonly finishCredits: object

finishCredits.lane ​

readonly lane: "input" = 'input'

holdButtons ​

readonly holdButtons: object

holdButtons.lane ​

readonly lane: "input" = 'input'

holdMoveKeys ​

readonly holdMoveKeys: object

holdMoveKeys.lane ​

readonly lane: "input" = 'input'

interactEntity ​

readonly interactEntity: object

interactEntity.lane ​

readonly lane: "input" = 'input'

jump ​

readonly jump: object

jump.lane ​

readonly lane: "input" = 'input'

leaveBed ​

readonly leaveBed: object

leaveBed.lane ​

readonly lane: "input" = 'input'

mineBlock ​

readonly mineBlock: object

mineBlock.lane ​

readonly lane: "input" = 'input'

move ​

readonly move: object

move.lane ​

readonly lane: "input" = 'input'

moveStacks ​

readonly moveStacks: object

moveStacks.lane ​

readonly lane: "input" = 'input'

moveVehicle ​

readonly moveVehicle: object

moveVehicle.lane ​

readonly lane: "input" = 'input'

openInventory ​

readonly openInventory: object

openInventory.lane ​

readonly lane: "input" = 'input'

openLoadingScreen ​

readonly openLoadingScreen: object

openLoadingScreen.lane ​

readonly lane: "input" = 'input'

openMountInventory ​

readonly openMountInventory: object

openMountInventory.lane ​

readonly lane: "input" = 'input'

openNpc ​

readonly openNpc: object

openNpc.lane ​

readonly lane: "input" = 'input'

paddleBoat ​

readonly paddleBoat: object

paddleBoat.lane ​

readonly lane: "input" = 'input'

pickBlock ​

readonly pickBlock: object

pickBlock.lane ​

readonly lane: "input" = 'input'

pickEntity ​

readonly pickEntity: object

pickEntity.lane ​

readonly lane: "input" = 'input'

placeRecipe ​

readonly placeRecipe: object

placeRecipe.lane ​

readonly lane: "input" = 'input'

playerInitialized ​

readonly playerInitialized: object

playerInitialized.lane ​

readonly lane: "input" = 'input'

playSound ​

readonly playSound: object

playSound.lane ​

readonly lane: "input" = 'input'

pressContainerButton ​

readonly pressContainerButton: object

pressContainerButton.lane ​

readonly lane: "input" = 'input'

pressRespawn ​

readonly pressRespawn: object

pressRespawn.lane ​

readonly lane: "input" = 'input'

queryBossBar ​

readonly queryBossBar: object

queryBossBar.lane ​

readonly lane: "read" = 'read'

releaseItem ​

readonly releaseItem: object

releaseItem.lane ​

readonly lane: "input" = 'input'

renameItem ​

readonly renameItem: object

renameItem.lane ​

readonly lane: "input" = 'input'

requestAbility ​

readonly requestAbility: object

requestAbility.lane ​

readonly lane: "input" = 'input'

requestGameRules ​

readonly requestGameRules: object

requestGameRules.lane ​

readonly lane: "read" = 'read'

requestStatistics ​

readonly requestStatistics: object

requestStatistics.lane ​

readonly lane: "read" = 'read'

respawn ​

readonly respawn: object

respawn.lane ​

readonly lane: "input" = 'input'

runCommand ​

readonly runCommand: object

runCommand.lane ​

readonly lane: "input" = 'input'

scriptMessage ​

readonly scriptMessage: object

scriptMessage.lane ​

readonly lane: "input" = 'input'

seeRecipe ​

readonly seeRecipe: object

seeRecipe.lane ​

readonly lane: "input" = 'input'

selectAdvancementsTab ​

readonly selectAdvancementsTab: object

selectAdvancementsTab.lane ​

readonly lane: "read" = 'read'

selectBundleItem ​

readonly selectBundleItem: object

selectBundleItem.lane ​

readonly lane: "input" = 'input'

selectHotbarSlot ​

readonly selectHotbarSlot: object

selectHotbarSlot.lane ​

readonly lane: "input" = 'input'

selectTrade ​

readonly selectTrade: object

selectTrade.lane ​

readonly lane: "input" = 'input'

setBeaconEffects ​

readonly setBeaconEffects: object

setBeaconEffects.lane ​

readonly lane: "input" = 'input'

setCreativeSlot ​

readonly setCreativeSlot: object

setCreativeSlot.lane ​

readonly lane: "input" = 'input'

setDefaultGameMode ​

readonly setDefaultGameMode: object

setDefaultGameMode.lane ​

readonly lane: "input" = 'input'

setDifficulty ​

readonly setDifficulty: object

setDifficulty.lane ​

readonly lane: "input" = 'input'

setFlying ​

readonly setFlying: object

setFlying.lane ​

readonly lane: "input" = 'input'

setGameRules ​

readonly setGameRules: object

setGameRules.lane ​

readonly lane: "input" = 'input'

setGliding ​

readonly setGliding: object

setGliding.lane ​

readonly lane: "input" = 'input'

setPlayerPermission ​

readonly setPlayerPermission: object

setPlayerPermission.lane ​

readonly lane: "input" = 'input'

setRecipeBook ​

readonly setRecipeBook: object

setRecipeBook.lane ​

readonly lane: "input" = 'input'

setSneaking ​

readonly setSneaking: object

setSneaking.lane ​

readonly lane: "input" = 'input'

setSprinting ​

readonly setSprinting: object

setSprinting.lane ​

readonly lane: "input" = 'input'

setViewDistance ​

readonly setViewDistance: object

setViewDistance.lane ​

readonly lane: "input" = 'input'

stab ​

readonly stab: object

stab.lane ​

readonly lane: "input" = 'input'

startRidingJump ​

readonly startRidingJump: object

startRidingJump.lane ​

readonly lane: "input" = 'input'

stopRiding ​

readonly stopRiding: object

stopRiding.lane ​

readonly lane: "input" = 'input'

stopRidingJump ​

readonly stopRidingJump: object

stopRidingJump.lane ​

readonly lane: "input" = 'input'

swapHands ​

readonly swapHands: object

swapHands.lane ​

readonly lane: "input" = 'input'

toggleCrafterSlot ​

readonly toggleCrafterSlot: object

toggleCrafterSlot.lane ​

readonly lane: "input" = 'input'

turnLecternPage ​

readonly turnLecternPage: object

turnLecternPage.lane ​

readonly lane: "read" = 'read'

useItem ​

readonly useItem: object

useItem.lane ​

readonly lane: "input" = 'input'

useItemOnBlock ​

readonly useItemOnBlock: object

useItemOnBlock.lane ​

readonly lane: "input" = 'input'

useLabTable ​

readonly useLabTable: object

useLabTable.lane ​

readonly lane: "read" = 'read'

useStructureBlock ​

readonly useStructureBlock: object

useStructureBlock.lane ​

readonly lane: "read" = 'read'


MINING_STEPS ​

const MINING_STEPS: readonly ["start", "continue", "abort", "stop", "swing", "finish", "instant"]

Defined in: packages/prismarine/src/input/Intent.ts:43

The steps of mining a block, which each edition's decoder maps its own actions onto.

  • start: mining began on the block.
  • continue: the player dragged onto another block without letting go, which starts it anew.
  • abort: the player let go before the block broke.
  • stop: the player let go after it broke, which changes nothing.
  • swing: another punch while mining, heard by the players near.
  • finish: the client says the block gave way. When the server times breaks it checks this against how long the block was mined; when the client times them, the block breaks.
  • instant: a creative break, at once.

PLAYER_ANIMATIONS ​

const PLAYER_ANIMATIONS: readonly ["swing", "wakeUp", "criticalHit", "magicCriticalHit"]

Defined in: packages/prismarine/src/input/Intent.ts:26

The animations a player plays on itself and asks the server to show everyone else, by name. Each edition's decoder maps its own codes onto these.


RECIPE_BOOKS ​

const RECIPE_BOOKS: readonly ["crafting", "furnace", "blastFurnace", "smoker"]

Defined in: packages/prismarine/src/input/Intent.ts:49

The recipe books a player keeps settings for, one per screen that shows one.

Functions ​

isIntentKind() ​

isIntentKind(kind): kind is keyof IntentPayloads

Defined in: packages/prismarine/src/input/Intent.ts:664

Whether a kind string names an intent in the table.

Parameters ​

kind ​

string

Any string, such as one read from a plugin or a trace.

Returns ​

kind is keyof IntentPayloads


laneOfIntents() ​

laneOfIntents(kinds): "read" | "input" | "connection"

Defined in: packages/prismarine/src/input/Intent.ts:656

The lane a handler that may produce any of kinds has to run in: the strictest of theirs, since running in a stricter lane is always safe and running in a looser one is not.

Parameters ​

kinds ​

readonly (keyof IntentPayloads)[]

The intent kinds, at least one.

Returns ​

"read" | "input" | "connection"

The strictest lane among them, or connection for none.