mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2025-07-08 10:43:58 -04:00
examples updated to work with 1.6.1
This commit is contained in:
parent
a4ba03d6a2
commit
8e02b4f0b0
3 changed files with 35 additions and 16 deletions
examples
|
@ -33,13 +33,20 @@ server.on('login', function(client) {
|
|||
onGround: true
|
||||
});
|
||||
|
||||
client.write(0x03, { message: 'Hello, world!' });
|
||||
var msg = {
|
||||
translate: 'chat.type.announcement',
|
||||
using: [
|
||||
'Server',
|
||||
'Hello, world!'
|
||||
]
|
||||
};
|
||||
client.write(0x03, { message: JSON.stringify(msg) });
|
||||
});
|
||||
|
||||
server.on('error', function(error) {
|
||||
console.log('Error:', error);
|
||||
console.log('Error:', error);
|
||||
});
|
||||
|
||||
server.on('listening', function() {
|
||||
console.log('Server listening on port', server.socketServer.address().port);
|
||||
console.log('Server listening on port', server.socketServer.address().port);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue