PrismarineJS / mineflayer

Create Minecraft bots with a powerful, stable, and high level JavaScript API.
https://prismarinejs.github.io/mineflayer/
MIT License
4.92k stars 904 forks source link

WARNING : unknown transaction confirmation for window 0, action -1193 and accepted false #2440

Closed dubfib closed 2 years ago

dubfib commented 2 years ago

Versions

Detailed description of a problem

A clear and concise description of what the problem is, with as much context as possible. What are you building? What problem are you trying to solve?

What did you try yet?

I tried seeing if the message started with WARNING and ended with false but it didn't work.

Did you try any method from the API? No Did you try any example? Any error from those? No

Your current code

import DiscordJS from 'discord.js';
import WOKCommands from 'wokcommands';
import path from 'path';

import mineflayer from 'mineflayer';

import dotenv from 'dotenv';
dotenv.config();

const email = process.env.email;

const bot = mineflayer.createBot({
  host: 'proxy.hypixel.net',
  username: `${email}`,
  port: 25565,
  version: '1.8.9',
  auth: 'microsoft'
});

const client = new DiscordJS.Client({
  intents: [
    DiscordJS.Intents.FLAGS.GUILDS,
    DiscordJS.Intents.FLAGS.GUILD_MESSAGES,
    DiscordJS.Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
  ],
});

client.on('ready', async (client) => {
  client.user.setActivity('with The Guild', { type: 'PLAYING' });

  new WOKCommands(client, {
    commandsDir: path.join(__dirname, 'commands'),
    typeScript: true,
    ignoreBots: false,
    ephemeral: true,
    testServers: ['609235703842209793', '937072465300062309'],
    botOwners: ['723626956188418109', '670630054417399808'],
  });
});

bot.on('chat', async (username, message) => {
  //Filtering out all non username messages.
  if (!username) return;

  //Making message also be msg for easier use.
  const msg = message;

  //Logging the messages in console for now.
  console.log(`${username}: ${msg}`);
  console.log(process.version)
});

bot.on('kicked', console.log);
bot.on('error', console.log);

client.login(process.env.token);

Expected behavior

A clear and concise description of what you expected to happen. For it to join and log user messages in console.

Additional context

Add any other context about the problem here. After like 5 seconds of startup it just spams console. Also the code is in typescript if you need to know

image
dubfib commented 2 years ago

Im also updating my node version right now to see if that helps.

amoraschi commented 2 years ago

The error is self explanatory, mineflayer is rejecting unknown transactions from the server. You can hide it with the option hideErrors set to true when creating the bot.

Please correct me if I'm wrong

dubfib commented 2 years ago

The error is self explanatory, mineflayer is rejecting unknown transactions from the server. You can hide it with the option hideErrors set to false when creating the bot.

Please correct me if I'm wrong

hideErrors needs to be true not false but thank you.