mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2025-05-05 19:03:40 -04:00
update to new minecraft-data protocol schema
This commit is contained in:
parent
93449427cd
commit
d78d87b9fc
3 changed files with 64 additions and 56 deletions
examples/client_custom_packets
|
@ -9,17 +9,47 @@ var customPackets={
|
|||
"1.8": {
|
||||
"play": {
|
||||
"toClient": {
|
||||
"my_custom_packet": {
|
||||
"id": "0x7A",
|
||||
"fields": [
|
||||
{
|
||||
"name": "age",
|
||||
"type": "i64"
|
||||
},
|
||||
{
|
||||
"name": "time",
|
||||
"type": "i64"
|
||||
}
|
||||
"types": {
|
||||
"packet_custom_name": [
|
||||
"container",[
|
||||
{
|
||||
"name": "age",
|
||||
"type": "i64"
|
||||
},
|
||||
{
|
||||
"name": "time",
|
||||
"type": "i64"
|
||||
}
|
||||
]
|
||||
],
|
||||
"packet": [
|
||||
"container",
|
||||
[
|
||||
{
|
||||
"name": "name",
|
||||
"type": [
|
||||
"mapper",
|
||||
{
|
||||
"type": "varint",
|
||||
"mappings": {
|
||||
"0x7A": "custom_name"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "params",
|
||||
"type": [
|
||||
"switch",
|
||||
{
|
||||
"compareTo": "name",
|
||||
"fields": {
|
||||
"custom_name": "packet_custom_name"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -51,6 +81,6 @@ client.on('login',function(){
|
|||
|
||||
});
|
||||
|
||||
client.on('my_custom_packet',function(packet){
|
||||
client.on('custom_name',function(packet){
|
||||
console.log(packet);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue