Comments (6)
Update your deps with npm update
then rename your username
to something else and try again
from mineflayer.
even after update
const mineflayer = require('mineflayer')
const { mineflayer: mineflayerViewer } = require('prismarine-viewer')
const bot = mineflayer.createBot({
host: 'play.callmecarson.live', // minecraft server ip
username: 'OvertimesBot', // username to join as if auth is `offline`, else a unique identifier for this account. Switch if you want to change accounts
auth: 'microsoft', // for offline mode servers, you can set this to 'offline'
version:'1.20.2',
// port: 25565, // set if you need a port that isn't 25565
// version: false, // only set if you need a specific version or snapshot (ie: "1.8.9" or "1.16.5"), otherwise it's set automatically
// password: '12345678' // set if you want to use password-based auth (may be unreliable). If specified, the `username` must be an email
})
bot.on('chat', (username, message) => {
if (username === bot.username) return
if (message = "hi")
bot.chat("Hello!")
})
bot.once('spawn', () => {
mineflayerViewer(bot, { port: 3007, firstPerson: true }) // port is the minecraft server port, if first person is false, you get a bird's-eye view
})
// Log errors and kick reasons:
bot.on('kicked', console.log)
bot.on('error', console.log)
Error: Profile not found, please restart your launcher if you recently created your profile
at call (C:\Users\truen\Desktop\Stuff\Minecraft Bot\node_modules\yggdrasil\src\utils.js:35:40)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async join (C:\Users\truen\Desktop\Stuff\Minecraft Bot\node_modules\yggdrasil\src\Server.js:20:12)
Error: Profile not found, please restart your launcher if you recently created your profile
at call (C:\Users\truen\Desktop\Stuff\Minecraft Bot\node_modules\yggdrasil\src\utils.js:35:40)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async join (C:\Users\truen\Desktop\Stuff\Minecraft Bot\node_modules\yggdrasil\src\Server.js:20:12)
from mineflayer.
Did you do this part?
then rename your username to something else and try again
from mineflayer.
const mineflayer = require('mineflayer')
const { mineflayer: mineflayerViewer } = require('prismarine-viewer')
const bot = mineflayer.createBot({
host: 'play.callmecarson.live', // minecraft server ip
auth: 'microsoft', // for offline mode servers, you can set this to 'offline'
version:'1.20.2',
// port: 25565, // set if you need a port that isn't 25565
// version: false, // only set if you need a specific version or snapshot (ie: "1.8.9" or "1.16.5"), otherwise it's set automatically
// password: '12345678' // set if you want to use password-based auth (may be unreliable). If specified, the `username` must be an email
})
bot.on('chat', (username, message) => {
if (username === bot.username) return
if (message = "hi")
bot.chat("Hello!")
})
bot.once('spawn', () => {
mineflayerViewer(bot, { port: 3007, firstPerson: true }) // port is the minecraft server port, if first person is false, you get a bird's-eye view
})
// Log errors and kick reasons:
bot.on('kicked', console.log)
bot.on('error', console.log)
PS C:\Users\truen\Desktop\Stuff\Minecraft Bot> node bot.js
{"color":"red","text":"An internal error occurred in your connection."} false
from mineflayer.
I fixed it, for anybody who comes across this problem later this is my code
const mineflayer = require('mineflayer');
const { mineflayer: mineflayerViewer } = require('prismarine-viewer');
const pathfinder = require('mineflayer-pathfinder').pathfinder;
const Movements = require('mineflayer-pathfinder').Movements;
const { GoalNear } = require('mineflayer-pathfinder').goals;
const bot = mineflayer.createBot({
host: 'play.callmecarson.live',
auth: 'microsoft',
version: '1.20.2',
});
console.log("Bot is starting...");
bot.on('login', () => {
console.log("Bot has logged in!");
});
bot._client.on('resource_pack_send', (data) => {
bot._client.write('resource_pack_receive', { hash: "Resourcepack", result: 3 });
bot._client.write('resource_pack_receive', { hash: "Resourcepack", result: 0 });
});
bot.on('message', (jsonMsg) => {
console.log(jsonMsg);
});
bot.loadPlugin(pathfinder);
let followingPlayer = null;
let followGoal = null;
let spleefMode = false;
function updateFollowGoal() {
if (followingPlayer) {
const player = bot.players[followingPlayer];
if (player && player.entity) {
const mcData = require('minecraft-data')(bot.version);
const movements = new Movements(bot, mcData);
movements.scafoldingBlocks = [];
bot.pathfinder.setMovements(movements);
const goal = new GoalNear(player.entity.position.x, player.entity.position.y, player.entity.position.z, 1);
followGoal = goal;
bot.pathfinder.setGoal(goal, true);
} else {
followingPlayer = null;
followGoal = null;
bot.pathfinder.setGoal(null);
bot.chat("Player not found. Stopping following.");
}
}
}
function spleefBehavior() {
if (!spleefMode) return;
const player = bot.players[followingPlayer];
if (player && player.entity) {
const blockBelow = bot.blockAt(player.entity.position.offset(0, -1, 0));
if (blockBelow && blockBelow.name === 'snow_block') {
bot.dig(blockBelow, true);
}
}
}
bot.on('physicsTick', () => {
updateFollowGoal();
spleefBehavior();
});
bot.on('chat', (username, message) => {
if (username === bot.username) return;
if (message === "hi" && username === "overtimepog") {
bot.chat("Hello!");
} else if (message === "come to me" && username === "overtimepog") {
followingPlayer = username;
bot.chat("Following you now!");
} else if (message === "stop" && username === "overtimepog") {
followingPlayer = null;
followGoal = null;
bot.pathfinder.setGoal(null);
bot.chat("Stopped following.");
} else if (message === "spleef mode" && username === "overtimepog") {
bot.chat("/mini join")
spleefMode = true;
bot.chat("Spleef mode activated!");
} else if (message === "stop spleef" && username === "overtimepog") {
spleefMode = false;
bot.chat("Spleef mode deactivated.");
}
});
bot.once('spawn', () => {
console.log("Bot has spawned!");
mineflayerViewer(bot, { port: 3007, firstPerson: true });
});
// Log errors and kick reasons:
bot.on('kicked', console.log);
bot.on('error', console.log);
from mineflayer.
Actually, none of that should be relevant, your issue is caused before the client is able to join the server at all. This means you need to 1. update your dependencies and 2. ensure that it's not caused by an invalid cached credentials by changing your username to force a re-sign in.
from mineflayer.
Related Issues (20)
- Multiple Bots crash HOT 1
- pickRealm silently fails to connect HOT 3
- bot.sleep() can make memory leak
- Error: Can't find potato in slots [54 - 90], (item id: 1091) HOT 1
- React to a message sent by the server without username HOT 3
- Some items are not appearing in the slots - (Possibly resolved) HOT 3
- Attacking on Pre Motion instead of Post. HOT 3
- Error: Event windowOpen did not fire within timeout of 20000ms HOT 1
- villager trade() improvement request
- TypeError: Cannot read properties of undefined (reading 'blocksByName') HOT 1
- Joining serverr: ERROR is not valid JSON HOT 2
- Microsoft Auth HOT 3
- nearestPlayer in python
- Current axios version contains CSRF vulnerability. HOT 1
- No goal_reached Event at all
- Do not have protocol data for protocol version 766 (attempted to use 763 data) HOT 3
- Bot doesn't reconnect to the server HOT 1
- Protocol Error HOT 1
- add support for early versions of minecraft like alpha 1.2.6 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mineflayer.