mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-27 05:03:50 -04:00
Fixed client echo crash on /say
This commit is contained in:
parent
efef72ee9a
commit
a563893a62
@ -26,7 +26,8 @@ client.on('chat', function (packet) {
|
||||
if (jsonMsg.translate === 'chat.type.announcement' || jsonMsg.translate === 'chat.type.text') {
|
||||
const username = jsonMsg.with[0].text
|
||||
const msg = jsonMsg.with[1]
|
||||
if (username === client.username) return
|
||||
client.write('chat', {message: msg})
|
||||
if (username === client.username) return;
|
||||
if (msg.text) client.write('chat', {message: msg.text})
|
||||
else client.write('chat', {message: msg})
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user