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
readonlylane:"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
readonlyanimate: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
readonlyanimation:"swing"|"wakeUp"|"criticalHit"|"magicCriticalHit"
data
readonlydata:number
swingSource
readonlyswingSource:string|null
answerForm
readonlyanswerForm: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
readonlycancelReason:number|null
formId
readonlyformId:number
response
readonlyresponse:string|null
attackEntity
readonlyattackEntity:object
Defined in: packages/prismarine/src/input/Intent.ts:271
The player hit an actor, by runtime id, with the item in hand.
target
readonlytarget:bigint
changeGameMode
readonlychangeGameMode: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
readonlygamemode:number
chat
readonlychat: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
readonlymessage:string
signature?
readonlyoptionalsignature?:ChatSignature
clickContainer
readonlyclickContainer: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
readonlywindow:number
closeContainer
readonlycloseContainer: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
readonlycontainerType:number
window
readonlywindow:number
closeLoadingScreen
readonlycloseLoadingScreen: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
readonlyid:number
completeCommand
readonlycompleteCommand: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
readonlyline:string
request
readonlyrequest:number
damageAnvil
readonlydamageAnvil: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
readonlyposition:object
position.x
readonlyx:number
position.y
readonlyy:number
position.z
readonlyz:number
dropHeldItem
readonlydropHeldItem: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
readonlyall:boolean
eat
readonlyeat: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
readonlyitem:number
editBook
readonlyeditBook: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
readonlyedit:BookEditStep
slot
readonlyslot:number
editCommandBlock
readonlyeditCommandBlock: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
readonlycommand:string
conditional
readonlyconditional:boolean
customName?
readonlyoptionalcustomName?:string
executeOnFirstTick?
readonlyoptionalexecuteOnFirstTick?:boolean
mode
readonlymode:"repeat"|"chain"|"impulse"
needsRedstone
readonlyneedsRedstone:boolean
Off is always active.
position
readonlyposition:object
position.x
readonlyx:number
position.y
readonlyy:number
position.z
readonlyz:number
tickDelay?
readonlyoptionaltickDelay?:number
trackOutput
readonlytrackOutput:boolean
editCommandMinecart
readonlyeditCommandMinecart: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
readonlycommand:string
customName?
readonlyoptionalcustomName?:string
target
readonlytarget:bigint
trackOutput
readonlytrackOutput:boolean
editSign
readonlyeditSign: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?
readonlyoptionalback?:string
front?
readonlyoptionalfront?:string
position
readonlyposition:object
position.x
readonlyx:number
position.y
readonlyy:number
position.z
readonlyz:number
editStructureBlock
readonlyeditStructureBlock: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
readonlyposition:object
position.x
readonlyx:number
position.y
readonlyy:number
position.z
readonlyz:number
structure
readonlystructure:string
emote
readonlyemote: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
readonlyemote:string
flags
readonlyflags:number
lengthTicks
readonlylengthTicks:number
platformId
readonlyplatformId:string
finishCredits
readonlyfinishCredits:Record<never,never>
Defined in: packages/prismarine/src/input/Intent.ts:150
The player reported the end credits finished.
holdButtons
readonlyholdButtons: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
readonlyjump:boolean
sneak
readonlysneak:boolean
holdMoveKeys
readonlyholdMoveKeys: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
readonlybackward:boolean
forward
readonlyforward:boolean
left
readonlyleft:boolean
right
readonlyright:boolean
interactEntity
readonlyinteractEntity: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
readonlytarget:bigint
jump
readonlyjump:Record<never,never>
Defined in: packages/prismarine/src/input/Intent.ts:421
The player jumped.
leaveBed
readonlyleaveBed: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
readonlymineBlock: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
readonlybreaksIfInstant:boolean
face
readonlyface:number
position
readonlyposition:object
position.x
readonlyx:number
position.y
readonlyy:number
position.z
readonlyz:number
serverBreaks?
readonlyoptionalserverBreaks?:boolean
serverTimed
readonlyserverTimed:boolean
step
readonlystep:"stop"|"start"|"continue"|"swing"|"abort"|"finish"|"instant"
move
readonlymove: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
readonlyhandledTeleport:boolean
Whether the client says it handled the last teleport, so the move is from after it.
headYaw
readonlyheadYaw:number
onGround
readonlyonGround:boolean
pitch
readonlypitch:number
position
readonlyposition:object
The player's eyes, as every client reports them.
position.x
readonlyx:number
position.y
readonlyy:number
position.z
readonlyz:number
yaw
readonlyyaw:number
moveStacks
readonlymoveStacks: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
readonlynames:StackSlotNames
requests
readonlyrequests: readonlyStackRequest[]
moveVehicle
readonlymoveVehicle: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
readonlyonGround:boolean
pitch
readonlypitch:number
position
readonlyposition:object
position.x
readonlyx:number
position.y
readonlyy:number
position.z
readonlyz:number
yaw
readonlyyaw:number
openInventory
readonlyopenInventory:Record<never,never>
Defined in: packages/prismarine/src/input/Intent.ts:84
The player pressed the inventory button.
openLoadingScreen
readonlyopenLoadingScreen: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
readonlyid:number
openMountInventory
readonlyopenMountInventory: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
readonlyopenNpc:object
Defined in: packages/prismarine/src/input/Intent.ts:86
The player opened an NPC's dialogue, naming the actor by runtime id.
target
readonlytarget:bigint
paddleBoat
readonlypaddleBoat: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
readonlyleft:boolean
right
readonlyright:boolean
pickBlock
readonlypickBlock: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
readonlyposition:object
position.x
readonlyx:number
position.y
readonlyy:number
position.z
readonlyz:number
withData
readonlywithData:boolean
pickEntity
readonlypickEntity: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
readonlytarget:bigint
withData
readonlywithData:boolean
placeRecipe
readonlyplaceRecipe: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
readonlyrecipe:string
useMaxItems
readonlyuseMaxItems:boolean
window
readonlywindow:number
playerInitialized
readonlyplayerInitialized:Record<never,never>
Defined in: packages/prismarine/src/input/Intent.ts:197
The client finished spawning and has a player to show.
playSound
readonlyplaySound: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
readonlyactor:bigint
baby
readonlybaby:boolean
data
readonlydata:number
firedAt
readonlyfiredAt: {x:number;y:number;z:number; } |null
global
readonlyglobal:boolean
sound
readonlysound:number
type
readonlytype:string
x
readonlyx:number
y
readonlyy:number
z
readonlyz:number
pressContainerButton
readonlypressContainerButton: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
readonlybutton:number
window
readonlywindow:number
pressRespawn
readonlypressRespawn:Record<never,never>
Defined in: packages/prismarine/src/input/Intent.ts:195
A dead player pressed the respawn button on its death screen.
queryBossBar
readonlyqueryBossBar: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
readonlybar:number
releaseItem
readonlyreleaseItem: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
readonlyaction:"release"|"consume"
renameItem
readonlyrenameItem: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
readonlyname:string
requestAbility
readonlyrequestAbility: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
readonlyability:string
value
readonlyvalue:number|boolean|null
requestGameRules
readonlyrequestGameRules: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
readonlyrequestStatistics:Record<never,never>
Defined in: packages/prismarine/src/input/Intent.ts:179
The player opened its statistics screen, which lists its statistics.
respawn
readonlyrespawn: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
readonlyrunCommand: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
readonlycommand:string
request?
readonlyoptionalrequest?:CommandRequest
scriptMessage
readonlyscriptMessage:object
Defined in: packages/prismarine/src/input/Intent.ts:188
The client's scripts sent the server's scripts a message.
id
readonlyid:string
value
readonlyvalue:string
seeRecipe
readonlyseeRecipe: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
readonlyrecipe:string
selectAdvancementsTab
readonlyselectAdvancementsTab:object
Defined in: packages/prismarine/src/input/Intent.ts:177
The player's advancements screen opened a tab, by its root's id.
tab
readonlytab:string
selectBundleItem
readonlyselectBundleItem: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
readonlyindex:number
slot
readonlyslot:number
selectHotbarSlot
readonlyselectHotbarSlot:object
Defined in: packages/prismarine/src/input/Intent.ts:229
The player moved its hand to a hotbar slot, 0 to 8.
slot
readonlyslot:number
selectTrade
readonlyselectTrade: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
readonlyindex:number
setBeaconEffects
readonlysetBeaconEffects: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
readonlyprimary:string|null
secondary
readonlysecondary:string|null
setCreativeSlot
readonlysetCreativeSlot: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
readonlycontainer:"armor"|"offhand"|"inventory"
item
readonlyitem:ShownStack|null
slot
readonlyslot:number
setDefaultGameMode
readonlysetDefaultGameMode: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
readonlygamemode:number
setDifficulty
readonlysetDifficulty: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
readonlydifficulty:number
setFlying
readonlysetFlying:object
Defined in: packages/prismarine/src/input/Intent.ts:427
The player started or stopped flying, which the server allows or refuses.
flying
readonlyflying:boolean
setGameRules
readonlysetGameRules: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
readonlyrules: readonlyShownGameRule[]
setGliding
readonlysetGliding: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
readonlygliding:boolean
setPlayerPermission
readonlysetPlayerPermission: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
readonlycustomFlags:number
level
readonlylevel:number
target
readonlytarget:bigint
setRecipeBook
readonlysetRecipeBook: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
readonlybook:"crafting"|"furnace"|"smoker"|"blastFurnace"
filtering
readonlyfiltering:boolean
open
readonlyopen:boolean|null
setSneaking
readonlysetSneaking:object
Defined in: packages/prismarine/src/input/Intent.ts:425
The player started or stopped sneaking.
sneaking
readonlysneaking:boolean
setSprinting
readonlysetSprinting:object
Defined in: packages/prismarine/src/input/Intent.ts:423
The player started or stopped sprinting.
sprinting
readonlysprinting:boolean
setViewDistance
readonlysetViewDistance: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
readonlymaxRadius:number
radius
readonlyradius:number
stab
readonlystab: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
readonlystartRidingJump: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
readonlystrength:number
stopRiding
readonlystopRiding:Record<never,never>
Defined in: packages/prismarine/src/input/Intent.ts:275
The player asked to get off what it rides.
stopRidingJump
readonlystopRidingJump:Record<never,never>
Defined in: packages/prismarine/src/input/Intent.ts:304
The player's mount landed from the leap it started.
swapHands
readonlyswapHands: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
readonlytoggleCrafterSlot: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
readonlydisabled:boolean
position
readonlyposition:object
position.x
readonlyx:number
position.y
readonlyy:number
position.z
readonlyz:number
slot
readonlyslot:number
turnLecternPage
readonlyturnLecternPage: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
readonlypage:number
position
readonlyposition:object
position.x
readonlyx:number
position.y
readonlyy:number
position.z
readonlyz:number
totalPages
readonlytotalPages:number
useItem
readonlyuseItem: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
readonlyheld:boolean
useItemOnBlock
readonlyuseItemOnBlock: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
readonlyface:number
faceLocation
readonlyfaceLocation:object
faceLocation.x
readonlyx:number
faceLocation.y
readonlyy:number
faceLocation.z
readonlyz:number
position
readonlyposition:object
position.x
readonlyx:number
position.y
readonlyy:number
position.z
readonlyz:number
rotation?
readonlyoptionalrotation?: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
readonlypitch:number
rotation.yaw
readonlyyaw:number
useLabTable
readonlyuseLabTable: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
readonlyaction:string
position
readonlyposition:object
position.x
readonlyx:number
position.y
readonlyy:number
position.z
readonlyz:number
useStructureBlock
readonlyuseStructureBlock: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
readonlyoperation:string
position
readonlyposition:object
position.x
readonlyx:number
position.y
readonlyy:number
position.z
readonlyz:number
structure
readonlystructure: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: readonlystring[];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 withtitleunderauthor's name, and becomes a written book.setPages: the book's pages are these, signed withtitlewhen 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> =KextendsIntentKind?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> = typeofIntents[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
constCOMMAND_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
constINTENT_KINDS: readonly (keyofIntentPayloads)[]
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
constIntents: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
readonlyanimate:object
animate.lane
readonlylane:"input"='input'
answerForm
readonlyanswerForm:object
answerForm.lane
readonlylane:"input"='input'
attackEntity
readonlyattackEntity:object
attackEntity.lane
readonlylane:"input"='input'
changeGameMode
readonlychangeGameMode:object
changeGameMode.lane
readonlylane:"input"='input'
chat
readonlychat:object
chat.lane
readonlylane:"input"='input'
clickContainer
readonlyclickContainer:object
clickContainer.lane
readonlylane:"input"='input'
closeContainer
readonlycloseContainer:object
closeContainer.lane
readonlylane:"input"='input'
closeLoadingScreen
readonlycloseLoadingScreen:object
closeLoadingScreen.lane
readonlylane:"input"='input'
completeCommand
readonlycompleteCommand:object
completeCommand.lane
readonlylane:"read"='read'
damageAnvil
readonlydamageAnvil:object
damageAnvil.lane
readonlylane:"read"='read'
dropHeldItem
readonlydropHeldItem:object
dropHeldItem.lane
readonlylane:"input"='input'
eat
readonlyeat:object
eat.lane
readonlylane:"input"='input'
editBook
readonlyeditBook:object
editBook.lane
readonlylane:"read"='read'
editCommandBlock
readonlyeditCommandBlock:object
editCommandBlock.lane
readonlylane:"input"='input'
editCommandMinecart
readonlyeditCommandMinecart:object
editCommandMinecart.lane
readonlylane:"input"='input'
editSign
readonlyeditSign:object
editSign.lane
readonlylane:"input"='input'
editStructureBlock
readonlyeditStructureBlock:object
editStructureBlock.lane
readonlylane:"read"='read'
emote
readonlyemote:object
emote.lane
readonlylane:"input"='input'
finishCredits
readonlyfinishCredits:object
finishCredits.lane
readonlylane:"input"='input'
holdButtons
readonlyholdButtons:object
holdButtons.lane
readonlylane:"input"='input'
holdMoveKeys
readonlyholdMoveKeys:object
holdMoveKeys.lane
readonlylane:"input"='input'
interactEntity
readonlyinteractEntity:object
interactEntity.lane
readonlylane:"input"='input'
jump
readonlyjump:object
jump.lane
readonlylane:"input"='input'
leaveBed
readonlyleaveBed:object
leaveBed.lane
readonlylane:"input"='input'
mineBlock
readonlymineBlock:object
mineBlock.lane
readonlylane:"input"='input'
move
readonlymove:object
move.lane
readonlylane:"input"='input'
moveStacks
readonlymoveStacks:object
moveStacks.lane
readonlylane:"input"='input'
moveVehicle
readonlymoveVehicle:object
moveVehicle.lane
readonlylane:"input"='input'
openInventory
readonlyopenInventory:object
openInventory.lane
readonlylane:"input"='input'
openLoadingScreen
readonlyopenLoadingScreen:object
openLoadingScreen.lane
readonlylane:"input"='input'
openMountInventory
readonlyopenMountInventory:object
openMountInventory.lane
readonlylane:"input"='input'
openNpc
readonlyopenNpc:object
openNpc.lane
readonlylane:"input"='input'
paddleBoat
readonlypaddleBoat:object
paddleBoat.lane
readonlylane:"input"='input'
pickBlock
readonlypickBlock:object
pickBlock.lane
readonlylane:"input"='input'
pickEntity
readonlypickEntity:object
pickEntity.lane
readonlylane:"input"='input'
placeRecipe
readonlyplaceRecipe:object
placeRecipe.lane
readonlylane:"input"='input'
playerInitialized
readonlyplayerInitialized:object
playerInitialized.lane
readonlylane:"input"='input'
playSound
readonlyplaySound:object
playSound.lane
readonlylane:"input"='input'
pressContainerButton
readonlypressContainerButton:object
pressContainerButton.lane
readonlylane:"input"='input'
pressRespawn
readonlypressRespawn:object
pressRespawn.lane
readonlylane:"input"='input'
queryBossBar
readonlyqueryBossBar:object
queryBossBar.lane
readonlylane:"read"='read'
releaseItem
readonlyreleaseItem:object
releaseItem.lane
readonlylane:"input"='input'
renameItem
readonlyrenameItem:object
renameItem.lane
readonlylane:"input"='input'
requestAbility
readonlyrequestAbility:object
requestAbility.lane
readonlylane:"input"='input'
requestGameRules
readonlyrequestGameRules:object
requestGameRules.lane
readonlylane:"read"='read'
requestStatistics
readonlyrequestStatistics:object
requestStatistics.lane
readonlylane:"read"='read'
respawn
readonlyrespawn:object
respawn.lane
readonlylane:"input"='input'
runCommand
readonlyrunCommand:object
runCommand.lane
readonlylane:"input"='input'
scriptMessage
readonlyscriptMessage:object
scriptMessage.lane
readonlylane:"input"='input'
seeRecipe
readonlyseeRecipe:object
seeRecipe.lane
readonlylane:"input"='input'
selectAdvancementsTab
readonlyselectAdvancementsTab:object
selectAdvancementsTab.lane
readonlylane:"read"='read'
selectBundleItem
readonlyselectBundleItem:object
selectBundleItem.lane
readonlylane:"input"='input'
selectHotbarSlot
readonlyselectHotbarSlot:object
selectHotbarSlot.lane
readonlylane:"input"='input'
selectTrade
readonlyselectTrade:object
selectTrade.lane
readonlylane:"input"='input'
setBeaconEffects
readonlysetBeaconEffects:object
setBeaconEffects.lane
readonlylane:"input"='input'
setCreativeSlot
readonlysetCreativeSlot:object
setCreativeSlot.lane
readonlylane:"input"='input'
setDefaultGameMode
readonlysetDefaultGameMode:object
setDefaultGameMode.lane
readonlylane:"input"='input'
setDifficulty
readonlysetDifficulty:object
setDifficulty.lane
readonlylane:"input"='input'
setFlying
readonlysetFlying:object
setFlying.lane
readonlylane:"input"='input'
setGameRules
readonlysetGameRules:object
setGameRules.lane
readonlylane:"input"='input'
setGliding
readonlysetGliding:object
setGliding.lane
readonlylane:"input"='input'
setPlayerPermission
readonlysetPlayerPermission:object
setPlayerPermission.lane
readonlylane:"input"='input'
setRecipeBook
readonlysetRecipeBook:object
setRecipeBook.lane
readonlylane:"input"='input'
setSneaking
readonlysetSneaking:object
setSneaking.lane
readonlylane:"input"='input'
setSprinting
readonlysetSprinting:object
setSprinting.lane
readonlylane:"input"='input'
setViewDistance
readonlysetViewDistance:object
setViewDistance.lane
readonlylane:"input"='input'
stab
readonlystab:object
stab.lane
readonlylane:"input"='input'
startRidingJump
readonlystartRidingJump:object
startRidingJump.lane
readonlylane:"input"='input'
stopRiding
readonlystopRiding:object
stopRiding.lane
readonlylane:"input"='input'
stopRidingJump
readonlystopRidingJump:object
stopRidingJump.lane
readonlylane:"input"='input'
swapHands
readonlyswapHands:object
swapHands.lane
readonlylane:"input"='input'
toggleCrafterSlot
readonlytoggleCrafterSlot:object
toggleCrafterSlot.lane
readonlylane:"input"='input'
turnLecternPage
readonlyturnLecternPage:object
turnLecternPage.lane
readonlylane:"read"='read'
useItem
readonlyuseItem:object
useItem.lane
readonlylane:"input"='input'
useItemOnBlock
readonlyuseItemOnBlock:object
useItemOnBlock.lane
readonlylane:"input"='input'
useLabTable
readonlyuseLabTable:object
useLabTable.lane
readonlylane:"read"='read'
useStructureBlock
readonlyuseStructureBlock:object
useStructureBlock.lane
readonlylane:"read"='read'
MINING_STEPS
constMINING_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
constPLAYER_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
constRECIPE_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.