Skip to content

Latest commit

 

History

History
82 lines (71 loc) · 1.84 KB

Events.md

File metadata and controls

82 lines (71 loc) · 1.84 KB

Event Surface

Subscribe with client.on(name, handler), client.once(name, handler), or client.waitFor(name, options).

client.on("OnChatRaw", ({ text }) => {
  console.log(text);
});

Lifecycle and Protocol

  • ready
  • authenticated
  • sessionChanged
  • reconnectScheduled
  • reconnectExhausted
  • open
  • close
  • error
  • rawFrameSent
  • rawFrameReceived
  • rawEnvelope
  • rawProtocolEvent
  • unknownProtocolEvent
  • parsingError
  • OnWsCommandResponse
  • OnMccCommandResponse
  • OnWsConnectionClose
  • OnGameJoined
  • OnDisconnect

Chat and Social

  • OnChatPrivate
  • OnChatPublic
  • OnTeleportRequest
  • OnChatRaw
  • OnPlayerJoin
  • OnPlayerLeave

OnChatPublic and OnChatPrivate use sender, not the old username field.

World and Gameplay

  • OnBlockBreakAnimation
  • OnEntityAnimation
  • OnPlayerProperty
  • OnServerTpsUpdate
  • OnTimeUpdate
  • OnEntityMove
  • OnEntitySpawn
  • OnEntityDespawn
  • OnHeldItemChange
  • OnHealthUpdate
  • OnExplosion
  • OnSetExperience
  • OnGamemodeUpdate
  • OnLatencyUpdate
  • OnMapData
  • OnTradeList
  • OnTitle
  • OnEntityEquipment
  • OnEntityEffect
  • OnScoreboardObjective
  • OnUpdateScore
  • OnInventoryUpdate
  • OnInventoryOpen
  • OnInventoryClose
  • OnDeath
  • OnRespawn
  • OnEntityHealth
  • OnEntityMetadata
  • OnPlayerStatus
  • OnNetworkPacket
  • OnInternalCommand

Runtime Notes

  • OnWsConnectionClose is implemented from current MCC source and typed in the SDK.
  • In local 1.21.11-Vanilla validation, player and server chat were consistently observed as OnChatRaw. OnChatPublic is still typed against the current MCC source contract, but it was not emitted in that offline local run.
  • Use rawProtocolEvent when investigating new or drifting MCC event behavior; it preserves the original envelope alongside the parsed payload.