PrismarineJS / node-minecraft-protocol-forge

Plugin to add FML/Forge client support (including auto-versioning) to node-minecraft-protocol
54 stars 18 forks source link

I was kicked for {"text":"This server has mods that require Forge to be installed on the client. Contact your server admin for more details."} #38

Open KarumaMC opened 1 month ago

KarumaMC commented 1 month ago

How do i fix this i been trying to solve this. Here the code

const mineflayer = require('mineflayer'); const autoVersionForge = require('minecraft-protocol-forge').autoVersionForge;

const bot = mineflayer.createBot({ host: 'server Screenshot_20241006_132029 ', username: 'Matt', version: false // Allow autoVersionForge to handle the version });

autoVersionForge(bot._client);

bot.on('spawn', () => { console.log('Bot spawned!'); bot.chat('Hi, I am Matt and I am here to help!'); });

bot.on('chat', (username, message) => { if (username === bot.username) return;

if (message === 'mine') { bot.chat('Mining initiated!'); startMining(); } else if (message === 'farm') { bot.chat('Farming initiated!'); startFarming(); } else { bot.chat(message); // Echo the message back } });

bot.on('kicked', (reason) => { console.log('I was kicked for', reason); });

bot.on('error', (err) => { console.error('An error occurred:', err); });

bot.on('end', () => { console.log('Bot has disconnected'); });

// Function to start mining function startMining() { console.log('Mining in progress...'); bot.chat('Mining logic not yet implemented.'); }

// Function to start farming function startFarming() { console.log('Farming in progress...'); bot.chat('Farming logic not yet implemented.'); }

Version: Minecraft forge 1.19.2 Forge: 43.4.4