25 KiB
Web Socket Events (Web Socket Chat Bot protocol events)
OnWsCommandResponse
Description:
Sent by the WebSocket Chat Bot when a command was executed.
Response body:
-
successType:
booleanDescription: Flags the command execution as either successful if
trueor not successful iffalse. -
requestIdType:
stringDescription: The request Id that was sent when the command was sent to the WebSocket Chat Bot, used to track commands. (Randomly generated on each command sending)
-
commandType:
stringDescription: The command that was sent.
-
resultType:
objectDescription: The value that the command has returned.
Example:
{
"event": "OnWsCommandResponse",
"data": {
"success": true,
"requestId": "ZLxcOhfMyf4SzNCqwMTx",
"command": "LogToConsole",
"result": true
}
}
MCC Events
OnBlockBreakAnimation
Description:
Sent when a block is broken in the world.
Parameters:
-
EntityType:
Entity json encoded object -
LocationType:
Location json encoded object -
stageType:
integer
Example:
{
"event": "OnBlockBreakAnimation",
"data": {}
}
OnEntityAnimation
Description:
Sent when an entity does an animation.
Parameters:
-
EntityType:
Entity json encoded object -
animationType:
integer
Example:
{
"event": "OnEntityAnimation",
"data": {
"entity": {
"ID":8,
"UUID":"8c0e3dc3-9bcc-3e03-a138-53348330d4ee",
"Name":"someplayer",
"CustomNameJson":null,
"IsCustomNameVisible":false,
"CustomName":null,
"Latency":0,
"Type":77,
"Location":{
"X":-46.08784180879593,
"Y":68,
"Z":147.68046873807907,
"Status":0,
"ChunkX":-3,
"ChunkY":8,
"ChunkZ":9,
"ChunkBlockX":1,
"ChunkBlockY":4,
"ChunkBlockZ":3
},
"Yaw":178.59375,
"Pitch":28.125,
"ObjectData":-1,
"Health":20,
"Item":{
"Type":18,
"Count":0,
"NBT":null,
"IsEmpty":true,
"DisplayName":null,
"Lores":null,
"Damage":0
},
"Pose":0,
"Metadata":{
"6":0
},
"Equipment": {}
},
"animation":0
}
}
OnChatPrivate
Description:
Sent when the MCC receives a private chat message.
Parameters:
-
senderType:
string -
messageType:
string -
rawTextType:
string
Example:
{
"event": "OnChatPublic",
"data": {
"sender":"milutinke",
"message":"hey there",
"rawText":"milutinke whispers to you: hey there"
}
}
OnChatPublic
Description:
Sent when a public message was sent in the chat.
Parameters:
-
usernameType:
string -
messageType:
string -
rawText
Type: string
Example:
{
"event": "OnChatPublic",
"data": {
"username":"milutinke",
"message":"hello world",
"rawText":"<milutinke> hello world"
}
}
OnTeleportRequest
Description:
Sent when the bot gets a teleport request
Parameters:
-
senderType:
string -
rawTextType:
string
Example:
{
"event": "OnTeleportRequest",
"data": {
"sender": "milutinke",
"rawText": "Milutinke want's to teleport to you. Type /tpaccept to accept the teleport request."
}
}
OnChatRaw
Description:
Sent when any kind of chat message was received by the MCC. Can contain JSON.
Parameters:
-
textType:
string -
jsonType:
string
Example:
{
"event": "OnChatRaw",
"data": {
"text":"someplayer has made the advancement §a[§aCover Me with Diamonds]",
"json":"{\"translate\":\"chat.type.advancement.task\",\"with\":[{\"insertion\":\"someplayer\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/tell someplayer \"},\"hoverEvent\":{\"action\":\"show_entity\",\"contents\":{\"type\":\"minecraft:player\",\"id\":\"8c0e3dc3-9bcc-3e03-a138-53348330d4ee\",\"name\":{\"text\":\"someplayer\"}}},\"text\":\"someplayer\"},{\"color\":\"green\",\"translate\":\"chat.square_brackets\",\"with\":[{\"hoverEvent\":{\"action\":\"show_text\",\"contents\":{\"color\":\"green\",\"extra\":[{\"text\":\"\\n\"},{\"translate\":\"advancements.story.shiny_gear.description\"}],\"translate\":\"advancements.story.shiny_gear.title\"}},\"translate\":\"advancements.story.shiny_gear.title\"}]}]}"
}
}
OnDisconnect
Description:
Sent when the bot has disconnected from a server. At this point you can't send commands to the MCC.
Parameters:
-
reasonType:
string -
messageType:
string
Example:
{
"event": "OnDisconnect",
"data": {
"reason": "<reason json encoded object>",
"message": "<message json encoded object>"
}
}
OnPlayerProperty
Description:
Sent when the server need to update a player property
Parameters:
-
propType:
json encoded object of { string key: double/number value }
Example:
{
"event": "OnPlayerProperty",
"data": {
"minecraft:generic.movement_speed": 0.10000000149011612
}
}
OnServerTpsUpdate
Description:
Sent when the server TPS changes/updates.
Parameters:
-
tpsType:
double
Example:
{
"event": "OnServerTpsUpdate",
"data": {
"tps": 20.0
}
}
OnTimeUpdate
Description:
Sent when the world time changes.
NOTE: Sent quite frequently.
Parameters:
-
worldAgeType:
long -
timeOfDayType:
long
Example:
{
"event": "OnTimeUpdate",
"data": {
"worldAge": 1719192,
"timeOfDay": -1132
}
}
OnEntityMove
Description:
Sent when an entity moves.
NOTE: Sent quite frequently.
Parameters:
-
EntityType:
Entity json encoded object
Example:
{
"event": "OnEntityMove",
"data": {
"ID":16,
"UUID":"00000000-0000-0000-0000-000000000000",
"Name":null,
"CustomNameJson":null,
"IsCustomNameVisible":false,
"CustomName":null,
"Latency":0,
"Type":14,
"Location":{
"X":5.5,
"Y":-47.9375,
"Z":204.5,
"Status":0,
"ChunkX":0,
"ChunkY":1,
"ChunkZ":12,
"ChunkBlockX":5,
"ChunkBlockY":0,
"ChunkBlockZ":12
},
"Yaw":0,
"Pitch":0,
"ObjectData":0,
"Health":1,
"Item":{
"Type":18,
"Count":0,
"NBT":null,
"IsEmpty":true,
"DisplayName":null,
"Lores":null,
"Damage":0
},
"Pose":0,
"Metadata":null,
"Equipment": {}
}
}
OnInternalCommand
Description:
Sent when an internal MCC command has been executed.
Parameters:
-
commandType:
string -
parametersType:
string -
resultType:
string
Example:
{
"event": "OnInternalCommand",
"data": {
"command": "dig -115 74 -19",
"parameters": "-115 74 -19",
"result": "Attempting to dig block at -114,5 74 -18,5 (Grass Block)"
}
}
OnEntitySpawn
Description:
Sent when an entity is spawned or enters the player radius.
Parameters:
-
EntityType:
Entity json encoded object
Example:
{
"event": "OnEntitySpawn",
"data": {
"ID":78,
"UUID":"00000000-0000-0000-0000-000000000000",
"Name":null,
"CustomNameJson":null,
"IsCustomNameVisible":false,
"CustomName":null,
"Latency":0,
"Type":15,
"Location":{
"X":-47.5,
"Y":68,
"Z":146.5,
"Status":0,
"ChunkX":-3,
"ChunkY":8,
"ChunkZ":9,
"ChunkBlockX":0,
"ChunkBlockY":4,
"ChunkBlockZ":2
},
"Yaw":30.9375,
"Pitch":0,
"ObjectData":0,
"Health":1,
"Item":{
"Type":18,
"Count":0,
"NBT":null,
"IsEmpty":true,
"DisplayName":null,
"Lores":null,
"Damage":0
},
"Pose":0,
"Metadata":null,
"Equipment":{ }
}
}
OnEntityDespawn
Description:
Sent when an entity is de-spawned or leaves the player radius.
Parameters:
-
EntityType:
Entity json encoded object
Example:
{
"event": "OnEntityDespawn",
"data": {
"ID":15,
"UUID":"00000000-0000-0000-0000-000000000000",
"Name":null,
"CustomNameJson":null,
"IsCustomNameVisible":false,
"CustomName":null,
"Latency":0,
"Type":56,
"Location":{
"X":-38.818737210380526,
"Y":68,
"Z":194.05856433486986,
"Status":0,
"ChunkX":-3,
"ChunkY":8,
"ChunkZ":12,
"ChunkBlockX":9,
"ChunkBlockY":4,
"ChunkBlockZ":2
},
"Yaw":0,
"Pitch":0,
"ObjectData":0,
"Health":1,
"Item":{
"Type":396,
"Count":1,
"NBT":{ },
"IsEmpty":false,
"DisplayName":null,
"Lores":null,
"Damage":0
},
"Pose":0,
"Metadata":{
"8":{
"Type":396,
"Count":1,
"NBT":{
},
"IsEmpty":false,
"DisplayName":null,
"Lores":null,
"Damage":0
}
},
"Equipment":{ }
}
}
- OnHeldItemChange
Description:
Sent when a held item is changed.
Parameters:
-
itemSlotType:
integer
Example:
{
"event": "OnHeldItemChange",
"data": {
"itemSlot": 1
}
}
- OnHealthUpdate
Description:
Sent when player's health is updated.
Parameters:
-
healthType:
float -
foodType:
int
Example:
{
"event": "OnHealthUpdate",
"data": {
"health": 18,
"food": 7
}
}
- OnExplosion
Description:
Sent when there is an explosion.
Parameters:
-
LocationType:
Location json encoded object -
strengthType:
float -
recordCountType:
int
Example:
{
"event": "OnExplosion",
"data": {
"location": {
"X": -117.49000000953674,
"Y": 66.0612500011921,
"Z": -26.490000009536743,
"Status": 0,
"ChunkX": -8,
"ChunkY": 8,
"ChunkZ": -2,
"ChunkBlockX": 10,
"ChunkBlockY": 2,
"ChunkBlockZ": 5
},
"strength": 4,
"recordCount": 139
}
}
- OnSetExperience
Description:
Sent when the player's experience is updated.
Parameters:
-
experienceBarType:
float -
levelType:
int -
totalExperienceType:
intExample:
{ "event": "OnSetExperience", "data": { "experienceBar": 0.60504204, "level": 7, "totalExperience": 120 } }
- OnGamemodeUpdate
Description:
Sent when the player's game mode has changed.
Parameters:
-
playerNameType:
string -
uuidType:
string with UUID -
gameModeType:
string
Example:
{
"event": "OnGamemodeUpdate",
"data": {
"playerName": "milutinke",
"uuid": "8c0e3dc3-9bcc-3e03-a138-53348330d4ee",
"gameMode": "creative"
}
}
- OnLatencyUpdate
Description:
Sent when the player's ping has changed.
Parameters:
-
playerNameType:
string -
uuidType:
string with UUID -
latencyType:
intExample:
{ "event": "OnLatencyUpdate", "data": { "playerName": "someplayer", "uuid":"baa6eda2-cbc5-5119-870d-1960ce60574d", "latency": 14 } }
- OnMapData
Description:
Sent when map data is received.
Parameters:
-
mapIdType:
int -
scaleType:
integer -
trackingPositionType:
bool -
lockedType:
bool -
iconsType:
array of map icon object -
columnsUpdatedType:
integer -
rowsUpdatedType:
integer -
mapColumnXType:
integer -
mapRowZType:
integer -
colorsType:
base 64 encoded string of colors
Example:
{
"event": "OnMapData",
"data": {
"mapId": 1,
"scale": 0,
"trackingPosition": true,
"locked": false,
"icons": [],
"columnsUpdated": 128,
"rowsUpdated": 128,
"mapColumnX": 0,
"mapRowZ": 0,
"colors": null // ommited in this example, too long
}
}
- OnTradeList
Description:
Sent when villager's trade list has been received/updated.
Parameters:
-
windowIdType:
int -
tradesType:
List<VillagerTrade> -
villagerInfoType:
VillagerInfo
Example:
{
"event": "OnTradeList",
"data": {
"windowId": 2,
"trades": <trades json encoded object>,
"villagerInfo": <villagerInfo json encoded object>
}
}
- OnTitle
Description:
Sent when a title action has been received.
Parameters:
-
actionType:
int -
titleTextType:
string -
subtitleTextType:
string -
actionBarTextType:
string -
fadeInType:
int -
stayType:
int -
fadeoutType:
int -
json_Type:
string
Example:
{
"event": "OnTitle",
"data": {
"action": <action json encoded object>,
"titleText": "<titleText json encoded object>",
"subtitleText": "<subtitleText json encoded object>",
"actionBarText": "<actionBarText json encoded object>",
"fadeIn": <fadeIn json encoded object>,
"stay": <stay json encoded object>,
"fadeout": <fadeout json encoded object>,
"json_": "<json_ json encoded object>"
}
}
- OnEntityEquipment
Description:
Sent when entity has changed or equipped equipment.
Parameters:
-
EntityType:
Entity json encoded object(nullable) -
slotType:
int -
itemType:
Item?
Example:
{
"event": "OnEntityEquipment",
"data": {
"entity":{
"ID":8,
"UUID":"8c0e3dc3-9bcc-3e03-a138-53348330d4ee",
"Name":"someplayer",
"CustomNameJson":null,
"IsCustomNameVisible":false,
"CustomName":null,
"Latency":0,
"Type":77,
"Location":{
"X":-46.88311344939438,
"Y":68,
"Z":146.96050249975414,
"Status":0,
"ChunkX":-3,
"ChunkY":8,
"ChunkZ":9,
"ChunkBlockX":1,
"ChunkBlockY":4,
"ChunkBlockZ":2
},
"Yaw":178.59375,
"Pitch":28.125,
"ObjectData":-1,
"Health":20,
"Item":{
"Type":18,
"Count":0,
"NBT":null,
"IsEmpty":true,
"DisplayName":null,
"Lores":null,
"Damage":0
},
"Pose":0,
"Metadata":{
"6":0
},
"Equipment":{
"0":{
"Type":368,
"Count":1,
"NBT":{
"Damage":0
},
"IsEmpty":false,
"DisplayName":null,
"Lores":null,
"Damage":0
}
}
},
"slot":0,
"item":{
"Type":368,
"Count":1,
"NBT":{
"Damage":0
},
"IsEmpty":false,
"DisplayName":null,
"Lores":null,
"Damage":0
}
}
}
- OnEntityEffect
Description: Sent when there are effects applied to an entity.
Parameters:
-
EntityType:
Entity json encoded object -
effectType:
Effects -
amplifierType:
int -
durationType:
int -
flagsType:
integer
Example:
{
"event": "OnEntityEffect",
"data": {
"entity": {
"ID": 50,
"UUID": "8c0e3dc3-9bcc-3e03-a138-53348330d4ee",
"Name": "milutinke",
"CustomNameJson": null,
"IsCustomNameVisible": false,
"CustomName": null,
"Latency": 0,
"Type": 77,
"Location": {
"X": -116.15188604696566,
"Y": 74.79847191937456,
"Z": -22.679173221632723,
"Status": 0,
"ChunkX": -8,
"ChunkY": 8,
"ChunkZ": -2,
"ChunkBlockX": 11,
"ChunkBlockY": 10,
"ChunkBlockZ": 9
},
"Yaw": 330.46875,
"Pitch": 9.84375,
"ObjectData": -1,
"Health": 20,
"Item": {
"Type": 18,
"Count": 0,
"NBT": null,
"IsEmpty": true,
"DisplayName": null,
"Lores": null,
"Damage": 0
},
"Pose": 0,
"Metadata": {
"9": 20,
"11": true,
"16": 122,
"17": 127
},
"Equipment": {}
},
"effect": 33,
"amplifier": 0,
"duration": 77,
"flags": 0
}
}
- OnScoreboardObjective
Description:
Sent when scoreboard objective has been added.
Parameters:
-
objectiveNameType:
string -
modeType:
integer -
objectiveValueType:
string -
typeType:
int -
json_Type:
string
Example:
{
"event": "OnScoreboardObjective",
"data": {
"objectiveName": "testObj",
"mode": 0,
"objectiveValue": "Test Objective",
"type": 0,
"rawJson": "{\"text\":\"Testobj\"}"
}
}
- OnUpdateScore
Description:
Sent when scoreboard objective has been update/changed for an entity.
Parameters:
-
entityNameType:
string -
actionType:
int -
objectiveNameType:
string -
typeType:
int
Example:
{
"event": "OnUpdateScore",
"data": {
"entityName": "test entity",
"action": 1,
"objectiveName": "test_objective",
"type": 1
}
}
- OnInventoryUpdate
Description:
Sent when the an inventory has been updated.
Parameters:
-
inventoryIdType:
int
Example:
{
"event": "OnInventoryUpdate",
"data": {
"inventoryId": 4
}
}
- OnInventoryOpen
Description:
Sent when a player opens an inventory.
Parameters:
-
inventoryIdType:
int
Example:
{
"event": "OnInventoryOpen",
"data": {
"inventoryId": 5
}
}
- OnInventoryClose
Description:
Sent when a player/server closes an inventory.
Parameters:
-
inventoryIdType:
int
Example:
{
"event": "OnInventoryClose",
"data": {
"inventoryId": 4
}
}
- OnPlayerJoin
Description:
Sent when a player joins the server. (Not the bot)
Parameters:
-
uuidType:
string with UUID -
nameType:
string
Example:
{
"event": "OnPlayerJoin",
"data": {
"uuid": "8c0e3dc3-9bcc-3e03-a138-53348330d4ee",
"name": "milutinke"
}
}
- OnPlayerLeave
Description:
Sent when a player leaves the server. (Not the bot)
Parameters:
-
uuidType:
string with UUID -
nameType:
string
Example:
{
"event": "OnPlayerLeave",
"data": {
"uuid":"8c0e3dc3-9bcc-3e03-a138-53348330d4ee",
"name":"milutinke"
}
}
- OnDeath
Description:
Sent when the bot dies.
Parameters: None
Example:
{
"event": "OnDeath",
"data": null
}
- OnRespawn
Description:
Sent when the bot respawns.
Parameters: None
Example:
{
"event": "OnRespawn",
"data": null
}
- OnEntityHealth
Description:
Sent when an entity health changes/updates.
Parameters:
-
EntityType:
Entity json encoded object(nullable) -
healthType:
float
Example:
{
"event": "OnEntityHealth",
"data": {
"entity":{
"ID":78,
"UUID":"00000000-0000-0000-0000-000000000000",
"Name":null,
"CustomNameJson":null,
"IsCustomNameVisible":false,
"CustomName":null,
"Latency":0,
"Type":15,
"Location":{
"X":-47.5,
"Y":68,
"Z":146.5,
"Status":0,
"ChunkX":-3,
"ChunkY":8,
"ChunkZ":9,
"ChunkBlockX":0,
"ChunkBlockY":4,
"ChunkBlockZ":2
},
"Yaw":30.9375,
"Pitch":0,
"ObjectData":0,
"Health":3,
"Item":{
"Type":18,
"Count":0,
"NBT":null,
"IsEmpty":true,
"DisplayName":null,
"Lores":null,
"Damage":0
},
"Pose":0,
"Metadata":{
"9":4
},
"Equipment":{
}
},
"health":3
}
}
- OnEntityMetadata
Description:
Sent when entity's metadata has been received/updated/changed.
Parameters:
-
EntityType:
Entity json encoded object -
metadataType:
Object of number as a key and object as value(nullable)
Example:
{
"event": "OnEntityMetadata",
"data": {
"entity":{
"ID":78,
"UUID":"00000000-0000-0000-0000-000000000000",
"Name":null,
"CustomNameJson":null,
"IsCustomNameVisible":false,
"CustomName":null,
"Latency":0,
"Type":15,
"Location":{
"X":-47.5,
"Y":68,
"Z":146.5,
"Status":0,
"ChunkX":-3,
"ChunkY":8,
"ChunkZ":9,
"ChunkBlockX":0,
"ChunkBlockY":4,
"ChunkBlockZ":2
},
"Yaw":30.9375,
"Pitch":0,
"ObjectData":0,
"Health":3,
"Item":{
"Type":18,
"Count":0,
"NBT":null,
"IsEmpty":true,
"DisplayName":null,
"Lores":null,
"Damage":0
},
"Pose":0,
"Metadata":{
"9":3
},
"Equipment":{
}
},
"metadata":{
"9":3
}
}
}
- OnPlayerStatus
Description:
Sent when player's status has been updated/changed.
Parameters:
statusId
Type: integer
Example:
{
"event": "OnPlayerStatus",
"data": {
"statusId": 5
}
}
- OnNetworkPacket
Description:
Sent when player's status has been updated/changed.
Parameters:
-
packetIdType:
integer -
isLoginType:
booleanDescription: Is the packet sent during the
loginphase. (Alwaysfalse) -
isInboundType:
integerDescription: Is the packet sent from the server or by the MCC.
-
packetDataType:
array of bytesDescription: A raw byte array.