-
-
Notifications
You must be signed in to change notification settings - Fork 975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The bot doesn't work on servers that have the minecart improvements experiment turned on. #3555
Comments
What do you mean by "Doesn't work"? Are you able to connect to the server? Does the bot connect, and disconnect? Can they view the minecart? Is there a problem getting into the minecart? Are there any error messages or serverside messages? |
If the bot is near to the chunk where minecarts are, then it just prints out errors in the console, that it can't load it, but if I teleport it to a few chunks away, it works fine. Also the minecart max speed is set to 1000. I tried changing it do the default 8 but it still doesn't work. It can't load the minecarts. Is there any way to load the experiment datapack to the bot? |
Accidentally set this to closed. I'm on mobile and it's easier on PC |
Can you post the error messages you received? |
I am also seeing this error when minecart improvements are on: Chunk size is 166 but only 112 was read ; partial packet : {"name":"move_minecart","params":{"entityId":199,"steps":[{"position":{"x":-3.259765625,"y":0,"z":3.1960935592651367},"movement":{"x":-107374184,"y":-5.072647571563721,"z":2.6750882398118847e-7},"yaw":0,"pitch":0,"weight":0},{"position":{"x":0,"y":1.4834635257720947,"z":-8.083026903789747e-26},"movement":{"x":2.0037801265716553,"y":1.1813288352181871e-28,"z":-1.0842021724855044e-19},"yaw":2.306537272278649e-41,"pitch":-3.155443432804951e-31,"weight":-107873552},{"position":{"x":495282651136,"y":-19,"z":0},"movement":{"x":0,"y":0,"z":2.286498704238804e-41},"yaw":663268.25,"pitch":-1142947840,"weight":0.11439716070890427}]}}; buffer :31c70103c050a00000000000404c8ccccccccccdc0a25321348f9e22000000000000000000000000000000003fbde22295c8204540003def1115c050a00000000000404c8ccccccccccdc0a252e6a24bc198000000000000000000000000000000003fbd4921ee44ce8840003dea490fc050a00000000000404c8ccccccccccdc0a252ad3bea7572000000000000000000000000000000003fbcb330a613272e40003de59985 |
The bot doesn't work on servers that have the minecart improvements experiment turned on.
I tried some things in my code. Here's my code:
`const mineflayer = require('mineflayer');
const { pathfinder, Movements, goals } = require('mineflayer-pathfinder');
const mcDataLoader = require('minecraft-data');
function createBot() {
const bot = mineflayer.createBot({
host: 'MindenNx2W.aternos.me', // A szerver IP-címe
port: 30436, // A szerver portja
username: 'Szipoa', // A bot neve
version: '1.21.4' // Minecraft verzió
});
bot.loadPlugin(pathfinder);
let hasTrident = false; // Jelzi, hogy megkapta-e már a szigonyt
bot.once('spawn', () => {
const mcData = mcDataLoader(bot.version);
console.log('Minecraft Data betöltve:', mcData.version.minecraftVersion);
});
// Packet figyelése és manuális kezelése
bot._client.on('packet', (data, meta) => {
if (meta.name === 'move_minecart') {
try {
processMinecartPacket(data); // Feldolgozás vagy hibás értékek figyelmen kívül hagyásával
} catch (err) {
console.warn('Hiba történt a move_minecart csomag feldolgozása során:', err);
}
}
});
function processMinecartPacket(data) {
const { entityId, steps } = data;
}
bot.on('playerCollect', (collector, collected) => {
if (collector.username === bot.username) {
setTimeout(() => { // Várunk egy kicsit az inventory frissítésére
const item = bot.inventory.items().find(i => i.customName === 'Zsozal Szigony 2');
if (item) {
hasTrident = true;
console.log('A bot megkapta a "Zsozal Szigony 2" nevű szigonyt!');
}
}, 150); // Várakozási idő az inventory frissítéséhez
}
});
bot.on('chat', (username, message) => {
if (!hasTrident) {
console.log(
Parancs érkezett ${username}-tól: "${message}", de a bot még nem kapta meg a szigonyt.
);return;
}
});
function attackWithTrident(target) {
const trident = bot.inventory.items().find(item => item.name === 'trident' && item.customName === 'Zsozal Szigony 2');
}
function attackMelee(target) {
bot.lookAt(target.position.offset(0, target.height / 2, 0), true, () => {
bot.attack(target); // Ütés közelről
});
}
// Automatikus respawnolás halál esetén
bot.on('death', () => {
console.log('A bot meghalt! Újraéled...');
});
// Automatikus újracsatlakozás hibák esetén
bot.on('end', () => {
console.log('Bot kilépett. Újracsatlakozás...');
setTimeout(() => createBot(), 5000); // Újraindítás várakozás után
});
bot.on('error', (err) => {
console.error('Hiba történt:', err);
});
bot.on('kicked', (reason) => {
console.log('A bot ki lett rúgva:', reason);
});
}
createBot();
`
The text was updated successfully, but these errors were encountered: