Skip to content

Latest commit

 

History

History
98 lines (77 loc) · 2.74 KB

Commands.md

File metadata and controls

98 lines (77 loc) · 2.74 KB

Command Surface

MccClient exposes typed wrappers over the current MCC WebSocket commands. The low-level equivalent is protocolClient.sendCommand(name, parameters).

Connection and Console

  • authenticate(password)
  • changeSessionId(sessionId)
  • logToConsole(message)
  • logDebugToConsole(message)
  • logToConsoleTranslated(message)
  • logDebugToConsoleTranslated(message)
  • reconnectToServer(extraAttempts?, delaySeconds?)
  • disconnectAndExit()
  • runScript(fileName)

Chat and Messaging

  • sendChat(message)
  • sendMccCommand(command)
  • sendPrivateMessage(playerName, message)
  • getMaxChatMessageLength()

World, Player, and Movement

  • getTerrainEnabled()
  • setTerrainEnabled(enabled)
  • getEntityHandlingEnabled()
  • sneak(enabled)
  • sendEntityAction(actionType)
  • digBlock(location, direction?)
  • setSlot(slot)
  • getWorld()
  • getEntities()
  • getPlayersLatency()
  • getCurrentLocation()
  • moveToLocation(location, allowUnsafe?, minDistance?)
  • clientIsMoving()
  • lookAtLocation(location)
  • getTimestamp()
  • getServerPort()
  • getServerHost()
  • getUsername()
  • getGamemode()
  • getYaw()
  • getPitch()
  • getUserUUID()
  • getOnlinePlayers()
  • getOnlinePlayersWithUUID()
  • getServerTPS()
  • respawn()
  • getProtocolVersion()

Entity and Interaction

  • interactEntity(entityId, interactType, hand?)
  • sendAnimation(hand?)
  • sendPlaceBlock(location, direction, hand?)
  • useItemInHand()

Inventory and Windows

  • creativeGive(type, count, damage?)
  • creativeDelete(slot)
  • getInventoryEnabled()
  • getPlayerInventory()
  • getInventories()
  • windowAction(windowId, slotId, mouseButton, actionType, item?)
  • changeSlot(slot)
  • getCurrentSlot()
  • clearInventories()
  • updateSign(location, lines, frontText?)
  • selectTrade(tradeIndex)
  • updateCommandBlock(location, command, mode, flags, name?)
  • closeInventory(inventoryId)

Mappings and Enum-Friendly Inputs

The current MCC runtime serializes many enum-like values as names. The SDK accepts string names for typed enum inputs and exposes runtime mapping commands for version-sensitive IDs:

  • getItemTypeMappings()
  • getEntityTypeMappings()

Use the mappings instead of hard-coded numeric tables when you need stable item or entity identifiers across protocol updates.

Low-Level Access

If you need a command that is not wrapped yet, use:

const response = await client.protocolClient.sendCommand("GetUsername");

The command schema is exported as commandDefinitions.

Runtime Caveat

The workspace copy of WebSocketBot.cs includes a session-routing fix, so ChangeSessionId now works in local validation. If you target an older unpatched MCC WebSocket bot, that command may still fail after the rename response.