diff --git a/README.md b/README.md index 3707b1d..a72aea1 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ const client = bedrock.createClient({ }) client.on('text', (packet) => { // Listen for chat messages and echo them back. - if (packet.source_name != client.options.username) { + if (packet.source_name != client.username) { client.queue('text', { type: 'chat', needs_translation: false, source_name: client.username, xuid: '', platform_chat_id: '', message: `${packet.source_name} said: ${packet.message} on ${new Date().toLocaleString()}` diff --git a/examples/client/client.js b/examples/client/client.js index c10710a..7bbd028 100644 --- a/examples/client/client.js +++ b/examples/client/client.js @@ -8,10 +8,10 @@ const client = bedrock.createClient({ }) client.on('text', (packet) => { // Listen for chat messages and echo them back. - if (packet.source_name != client.options.username) { + if (packet.source_name != client.username) { client.queue('text', { type: 'chat', needs_translation: false, source_name: client.username, xuid: '', platform_chat_id: '', message: `${packet.source_name} said: ${packet.message} on ${new Date().toLocaleString()}` }) } -}) \ No newline at end of file +})