Skip to content

Commit 7a2680b

Browse files
authored
Clarify readme createBot username handling (#3300)
* Clarify readme createBot username handling * Update README.md
1 parent 5dc36d6 commit 7a2680b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

docs/README.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ const mineflayer = require('mineflayer')
8585

8686
const bot = mineflayer.createBot({
8787
host: 'localhost', // minecraft server ip
88-
username: 'Bot', // username or email, switch if you want to change accounts
88+
username: 'Bot', // username to join as if auth is `offline`, else a unique identifier for this account. Switch if you want to change accounts
8989
auth: 'microsoft' // for offline mode servers, you can set this to 'offline'
90-
// port: 25565, // only set if you need a port that isn't 25565
91-
// 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
92-
// password: '12345678' // set if you want to use password-based auth (may be unreliable). If specified, the `username` must be an email
90+
// port: 25565, // set if you need a port that isn't 25565
91+
// 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
92+
// password: '12345678' // set if you want to use password-based auth (may be unreliable). If specified, the `username` must be an email
9393
})
9494

9595
bot.on('chat', (username, message) => {
@@ -103,9 +103,10 @@ bot.on('error', console.log)
103103
```
104104

105105
If `auth` is set to `microsoft`, you will be prompted to login to microsoft.com with a code in your browser. After signing in on your browser,
106-
the bot will automatically obtain and cache authentication tokens in the local file system so you don't have to sign-in again.
107-
To switch the account, update the supplied `username`. By default, cached tokens will be stored in your user's .minecraft folder.
108-
For more information on these options and others, see node-minecraft-protocol's [API doc](https://github.com/PrismarineJS/node-minecraft-protocol/blob/master/docs/API.md#mccreateclientoptions).
106+
the bot will automatically obtain and cache authentication tokens (under your specified username) so you don't have to sign-in again.
107+
108+
To switch the account, update the supplied `username`. By default, cached tokens will be stored in your user's .minecraft folder, or if `profilesFolder` is specified, they'll instead be stored there.
109+
For more information on bot options see node-minecraft-protocol's [API doc](https://github.com/PrismarineJS/node-minecraft-protocol/blob/master/docs/API.md#mccreateclientoptions).
109110

110111
#### Connecting to a Realm
111112

0 commit comments

Comments
 (0)