bedrock-protocol icon indicating copy to clipboard operation
bedrock-protocol copied to clipboard

Minecraft supported version, and command.

Open NoHaije opened this issue 10 months ago • 4 comments

Hello, i am using the bedrock-protocol library to create a bot for Minecraft Bedrock. However, I encountered an issue while trying to connect to a server running version 1.20.51. The client throws the following error:

Error: Unsupported version 1.20.51

Could you please confirm if this version is supported by the library? If not, could you provide an estimated timeline for its support or suggest a workaround?

Additionally, I would like to know how the bot can execute commands after connecting to the server. I attempted to send a command to the server using the client.queue method, but it does not work—the command is either not sent or not recognized by the server. Below is the example code I am using, but it does not work, and the command is not executed:

const { createClient } = require('bedrock-protocol');

const client = createClient({
  host: '...',
  port: ...,
  username: '...',
  offline: false,
  flow: 'live'
  version: '1.20.51' // I manually set this version
});

client.on('spawn', () => {
  console.log('Bot connected to the server');
  // Attempting to execute a command
  client.queue('text', {
    type: 'chat',
    message: '/say test,
  });
});

client.on('error', (err) => {
  console.error('Client error:', err);
});

I would appreciate clarification on the following points:

  1. How can I correctly send and execute commands on the server?
  2. Is version 1.20.51 supported? If not, will support be added in the future?

Thank you for your time and assistance! Best regards, NoHaije So1o.

NoHaije avatar Jan 01 '25 13:01 NoHaije