Skip to content

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

Description

@KarumaMC

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions