Class in @minecraft/server
What the player’s latest input said of their controls.
import { PlayerInputInfo } from '@minecraft/server';Example
Section titled “Example”import { world, type PlayerInputInfo } from '@minecraft/server';
for (const player of world.getAllPlayers()) { const playerInputInfo: PlayerInputInfo = player.inputInfo; console.log(player.name, playerInputInfo.lastInputModeUsed);}import { world } from '@minecraft/server';
for (const player of world.getAllPlayers()) { const playerInputInfo = player.inputInfo; console.log(player.name, playerInputInfo.lastInputModeUsed);}Properties
Section titled “Properties”lastInputModeUsed
Section titled “lastInputModeUsed”read-only
readonly lastInputModeUsed: InputMode;Taken from each input the client sends.
Types
touchOnlyAffectsHotbar
Section titled “touchOnlyAffectsHotbar”read-only
readonly touchOnlyAffectsHotbar: boolean;Always false in Basalt.
Methods
Section titled “Methods”getButtonState
Section titled “getButtonState”getButtonState(button: InputButton): ButtonState;Parameters
buttonInputButton
Returns
ButtonStategetMovementVector
Section titled “getMovementVector”getMovementVector(): Vector2;Sideways (x) and forwards (y), each from -1 to 1.
Returns
Vector2Types