Skip to content

Instantly share code, notes, and snippets.

@182exe
Last active April 30, 2024 19:58
Show Gist options
  • Save 182exe/5dca99666bc7793f059c5697a59fdaf2 to your computer and use it in GitHub Desktop.
Save 182exe/5dca99666bc7793f059c5697a59fdaf2 to your computer and use it in GitHub Desktop.
// use with @prismarinejs/mineflayer
// if you don't know what a session token/access token is, don't bother with this; it's for the silliest of devs
const mineflayer = require(`mineflayer`)
const config = {
host: `example.com`,
port: 25565,
token: `eyJraWQiOiJhYzg0YSIsImFsZyI6IkhTMjU2In0.eyJ4dWlkIjoiMjUzNTQ...`
}
const bot = mineflayer.createBot({
host: config.host,
port: config.port,
accessToken: config.token,
session: {
accessToken: config.token,
selectedProfile: {
name: "username", // here's a snippet to get these without having to hardcode them: https://gist.github.com/182exe/60fb8b196004c2e3c9f66e86d4587024
id: "uuid",
}
},
skipValidation: true,
auth: `mojang`
})
@182exe
Copy link
Author

182exe commented Apr 11, 2024

don't be a skid :P

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