Skip to content

Instantly share code, notes, and snippets.

@jocopa3
Last active February 13, 2024 03:52
Show Gist options
  • Star 34 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save jocopa3/5f718f4198f1ea91a37e3a9da468675c to your computer and use it in GitHub Desktop.
Save jocopa3/5f718f4198f1ea91a37e3a9da468675c to your computer and use it in GitHub Desktop.
// To subscribe to an event, pass this JSON text to the client through the WebSocket:
{
"body": {
"eventName": "NameOfEvent" // Replace with an event name listed below
},
"header": {
"requestId": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx", // UUID
"messagePurpose": "subscribe",
"version": 1, // Protocol version (currently 1 as-of 1.0.2)
"messageType": "commandRequest"
}
}
====== Event Names ======
Note: I haven't tested many of these. Most seem to work, but a few may not.
AdditionalContentLoaded
AgentCommand
AgentCreated
ApiInit
AppPaused
AppResumed
AppSuspended
AwardAchievement
BlockBroken
BlockPlaced
BoardTextUpdated
BossKilled
CameraUsed
CauldronUsed
ChunkChanged - Does not work in 1.0.2
ChunkLoaded - Does not work in 1.0.2
ChunkUnloaded - Does not work in 1.0.2
ConfigurationChanged
ConnectionFailed
CraftingSessionCompleted
EndOfDay
EntitySpawned
FileTransmissionCancelled
FileTransmissionCompleted
FileTransmissionStarted
FirstTimeClientOpen
FocusGained
FocusLost
GameSessionComplete
GameSessionStart
HardwareInfo
HasNewContent
ItemAcquired
ItemCrafted
ItemDestroyed
ItemDropped
ItemEnchanted
ItemSmelted
ItemUsed
JoinCanceled
JukeboxUsed
LicenseCensus
MascotCreated
MenuShown
MobInteracted
MobKilled
MultiplayerConnectionStateChanged
MultiplayerRoundEnd
MultiplayerRoundStart
NpcPropertiesUpdated
OptionsUpdated
performanceMetrics
PackImportStage
PlayerBounced
PlayerDied
PlayerJoin
PlayerLeave
PlayerMessage
PlayerTeleported
PlayerTransform
PlayerTravelled
PortalBuilt
PortalUsed
PortfolioExported
PotionBrewed
PurchaseAttempt
PurchaseResolved
RegionalPopup
RespondedToAcceptContent
ScreenChanged
ScreenHeartbeat
SignInToEdu
SignInToXboxLive
SignOutOfXboxLive
SpecialMobBuilt
StartClient
StartWorld
TextToSpeechToggled
UgcDownloadCompleted
UgcDownloadStarted
UploadSkin
VehicleExited
WorldExported
WorldFilesListed
WorldGenerated
WorldLoaded
WorldUnloaded
@MihaiZecheru
Copy link

jh.socket.on("message", (packet) => {
messageHandler(jh, packet);
});

I am able to connect to PlayerMessage (chat events) like this.

I am trying to connect to PlayerJoin events but I don't know what the keyword is. What should I put for the first argument of socket.on ?

I've tried PlayerJoin, playerJoin, player, join, and Join. none seem to work :(

do you think you can help?

@RizkyPIsADude
Copy link

How do i subscribe to every eventnames?, i want to debug my event listener

@NoobDancer100
Copy link

NoobDancer100 commented Jul 1, 2022

How do i subscribe to every eventnames?, i want to debug my event listener

You have to subscribe one by one.

@sp2934598w3048
Copy link

How did you find these event names? Is it in the install directory or something (Windows 10)?

@vanistillhere
Copy link

How did you find these event names? Is it in the install directory or something (Windows 10)?

i think it's a packet dump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment