Last active
April 30, 2024 19:58
-
-
Save 182exe/5dca99666bc7793f059c5697a59fdaf2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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` | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
don't be a skid :P