Skip to content

0xrushi/minecraft-mineflayer-bot-learnings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

minecraft-mineflayer-bot-learnings

Now Microsoft moved all mojang accounts to Microsofts

const bot = mineflayer.createBot({
  host: 'localhost', // server host
  port: 25565,
  version: "1.17.1",
  username: "noob@gmail.com", // microsoft email, fake name works for offline servers
  auth: "microsoft" // microsoft for microsoft account
  // password: "yourpasswored" // keep this commented for microsoft
})

See what your bot is doing

Thanks to the prismarine-viewer project, it's possible to display in a browser window what your bot is doing. Just run npm install prismarine-viewer and add this to your bot:

const { mineflayer: mineflayerViewer } = require('prismarine-viewer')
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
})

And you'll get a live view looking like this:

viewer

LIBS

Minecraft bots with just OpenCV

Minecraft RL openai gym like libraries