mineflayer 4.18.0 → 4.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -14
- package/docs/README.md +39 -14
- package/docs/api.md +8 -3
- package/docs/br/README_BR.md +21 -4
- package/docs/es/README_ES.md +20 -4
- package/docs/fr/README_FR.md +22 -4
- package/docs/history.md +16 -0
- package/docs/ru/README_RU.md +25 -4
- package/docs/tr/README_TR.md +19 -4
- package/docs/zh/CONTRIBUTING.md +1 -1
- package/docs/zh/README_ZH_CN.md +43 -23
- package/index.d.ts +26 -21
- package/lib/bossbar.js +92 -95
- package/lib/plugins/anvil.js +2 -2
- package/lib/plugins/book.js +1 -1
- package/lib/plugins/chat.js +4 -4
- package/lib/plugins/chest.js +1 -1
- package/lib/plugins/craft.js +3 -3
- package/lib/plugins/creative.js +2 -2
- package/lib/plugins/digging.js +13 -1
- package/lib/plugins/enchantment_table.js +2 -2
- package/lib/plugins/entities.js +3 -3
- package/lib/plugins/inventory.js +1 -2
- package/lib/plugins/scoreboard.js +8 -0
- package/lib/plugins/tablist.js +12 -7
- package/lib/plugins/villager.js +2 -2
- package/lib/promise_utils.js +5 -0
- package/lib/team.js +47 -54
- package/lib/version.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ First time using Node.js? You may want to start with the [tutorial](tutorial.md)
|
|
|
17
17
|
|
|
18
18
|
## Features
|
|
19
19
|
|
|
20
|
-
* Supports Minecraft 1.8 to 1.20.
|
|
20
|
+
* Supports Minecraft 1.8 to 1.20.4 (1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19 and 1.20)
|
|
21
21
|
* Entity knowledge and tracking.
|
|
22
22
|
* Block knowledge. You can query the world around you. Milliseconds to find any block.
|
|
23
23
|
* Physics and movement - handle all bounding boxes
|
|
@@ -37,9 +37,14 @@ First time using Node.js? You may want to start with the [tutorial](tutorial.md)
|
|
|
37
37
|
|
|
38
38
|
First install Node.js >= 18 from [nodejs.org](https://nodejs.org/) then:
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
```bash
|
|
41
|
+
npm install mineflayer
|
|
42
|
+
```
|
|
41
43
|
|
|
42
|
-
To update mineflayer (or any Node.js) package and its dependencies, use
|
|
44
|
+
To update mineflayer (or any Node.js) package and its dependencies, use
|
|
45
|
+
```bash
|
|
46
|
+
npm update --depth 9999
|
|
47
|
+
```
|
|
43
48
|
|
|
44
49
|
## Documentation
|
|
45
50
|
|
|
@@ -80,11 +85,11 @@ const mineflayer = require('mineflayer')
|
|
|
80
85
|
|
|
81
86
|
const bot = mineflayer.createBot({
|
|
82
87
|
host: 'localhost', // minecraft server ip
|
|
83
|
-
username: 'Bot', // username
|
|
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
|
|
84
89
|
auth: 'microsoft' // for offline mode servers, you can set this to 'offline'
|
|
85
|
-
// port: 25565,
|
|
86
|
-
// version: false,
|
|
87
|
-
// password: '12345678'
|
|
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
|
|
88
93
|
})
|
|
89
94
|
|
|
90
95
|
bot.on('chat', (username, message) => {
|
|
@@ -98,9 +103,10 @@ bot.on('error', console.log)
|
|
|
98
103
|
```
|
|
99
104
|
|
|
100
105
|
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,
|
|
101
|
-
the bot will automatically obtain and cache authentication tokens
|
|
102
|
-
|
|
103
|
-
|
|
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).
|
|
104
110
|
|
|
105
111
|
#### Connecting to a Realm
|
|
106
112
|
|
|
@@ -248,17 +254,36 @@ The most updated and useful are :
|
|
|
248
254
|
|
|
249
255
|
### Testing everything
|
|
250
256
|
|
|
251
|
-
Simply run:
|
|
257
|
+
Simply run:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
npm test
|
|
261
|
+
```
|
|
252
262
|
|
|
253
263
|
### Testing specific version
|
|
254
|
-
Run
|
|
264
|
+
Run
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
npm run mocha_test -- -g <version>
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
where `<version>` is a minecraft version like `1.12`, `1.15.2`...
|
|
255
271
|
|
|
256
272
|
### Testing specific test
|
|
257
|
-
Run
|
|
273
|
+
Run
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
npm run mocha_test -- -g <test_name>
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
where `<test_name>` is a name of the test like `bed`, `useChests`, `rayTrace`...
|
|
258
280
|
|
|
259
281
|
### Example
|
|
260
282
|
|
|
261
|
-
|
|
283
|
+
```bash
|
|
284
|
+
npm run mocha_test -- -g "1.18.1.*BlockFinder"
|
|
285
|
+
```
|
|
286
|
+
to run the block finder test for 1.18.1
|
|
262
287
|
|
|
263
288
|
## License
|
|
264
289
|
|
package/docs/README.md
CHANGED
|
@@ -17,7 +17,7 @@ First time using Node.js? You may want to start with the [tutorial](tutorial.md)
|
|
|
17
17
|
|
|
18
18
|
## Features
|
|
19
19
|
|
|
20
|
-
* Supports Minecraft 1.8 to 1.20.
|
|
20
|
+
* Supports Minecraft 1.8 to 1.20.4 (1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19 and 1.20)
|
|
21
21
|
* Entity knowledge and tracking.
|
|
22
22
|
* Block knowledge. You can query the world around you. Milliseconds to find any block.
|
|
23
23
|
* Physics and movement - handle all bounding boxes
|
|
@@ -37,9 +37,14 @@ First time using Node.js? You may want to start with the [tutorial](tutorial.md)
|
|
|
37
37
|
|
|
38
38
|
First install Node.js >= 18 from [nodejs.org](https://nodejs.org/) then:
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
```bash
|
|
41
|
+
npm install mineflayer
|
|
42
|
+
```
|
|
41
43
|
|
|
42
|
-
To update mineflayer (or any Node.js) package and its dependencies, use
|
|
44
|
+
To update mineflayer (or any Node.js) package and its dependencies, use
|
|
45
|
+
```bash
|
|
46
|
+
npm update --depth 9999
|
|
47
|
+
```
|
|
43
48
|
|
|
44
49
|
## Documentation
|
|
45
50
|
|
|
@@ -80,11 +85,11 @@ const mineflayer = require('mineflayer')
|
|
|
80
85
|
|
|
81
86
|
const bot = mineflayer.createBot({
|
|
82
87
|
host: 'localhost', // minecraft server ip
|
|
83
|
-
username: 'Bot', // username
|
|
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
|
|
84
89
|
auth: 'microsoft' // for offline mode servers, you can set this to 'offline'
|
|
85
|
-
// port: 25565,
|
|
86
|
-
// version: false,
|
|
87
|
-
// password: '12345678'
|
|
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
|
|
88
93
|
})
|
|
89
94
|
|
|
90
95
|
bot.on('chat', (username, message) => {
|
|
@@ -98,9 +103,10 @@ bot.on('error', console.log)
|
|
|
98
103
|
```
|
|
99
104
|
|
|
100
105
|
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,
|
|
101
|
-
the bot will automatically obtain and cache authentication tokens
|
|
102
|
-
|
|
103
|
-
|
|
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).
|
|
104
110
|
|
|
105
111
|
#### Connecting to a Realm
|
|
106
112
|
|
|
@@ -248,17 +254,36 @@ The most updated and useful are :
|
|
|
248
254
|
|
|
249
255
|
### Testing everything
|
|
250
256
|
|
|
251
|
-
Simply run:
|
|
257
|
+
Simply run:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
npm test
|
|
261
|
+
```
|
|
252
262
|
|
|
253
263
|
### Testing specific version
|
|
254
|
-
Run
|
|
264
|
+
Run
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
npm run mocha_test -- -g <version>
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
where `<version>` is a minecraft version like `1.12`, `1.15.2`...
|
|
255
271
|
|
|
256
272
|
### Testing specific test
|
|
257
|
-
Run
|
|
273
|
+
Run
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
npm run mocha_test -- -g <test_name>
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
where `<test_name>` is a name of the test like `bed`, `useChests`, `rayTrace`...
|
|
258
280
|
|
|
259
281
|
### Example
|
|
260
282
|
|
|
261
|
-
|
|
283
|
+
```bash
|
|
284
|
+
npm run mocha_test -- -g "1.18.1.*BlockFinder"
|
|
285
|
+
```
|
|
286
|
+
to run the block finder test for 1.18.1
|
|
262
287
|
|
|
263
288
|
## License
|
|
264
289
|
|
package/docs/api.md
CHANGED
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
- ["blockBreakProgressEnd" (block, entity)](#blockbreakprogressend-block-entity)
|
|
226
226
|
- ["diggingCompleted" (block)](#diggingcompleted-block)
|
|
227
227
|
- ["diggingAborted" (block)](#diggingaborted-block)
|
|
228
|
-
- ["
|
|
228
|
+
- ["usedFirework" (fireworkEntityId)](#usedfirework-fireworkentityid)
|
|
229
229
|
- ["move"](#move)
|
|
230
230
|
- ["forcedMove"](#forcedmove)
|
|
231
231
|
- ["mount"](#mount)
|
|
@@ -270,7 +270,7 @@
|
|
|
270
270
|
- [Methods](#methods)
|
|
271
271
|
- [bot.end(reason)](#botendreason)
|
|
272
272
|
- [bot.quit(reason)](#botquitreason)
|
|
273
|
-
- [bot.tabComplete(str, [assumeCommand], [sendBlockInSight])](#bottabcompletestr-assumecommand-sendblockinsight)
|
|
273
|
+
- [bot.tabComplete(str, [assumeCommand], [sendBlockInSight], [timeout])](#bottabcompletestr-assumecommand-sendblockinsight-timeout)
|
|
274
274
|
- [bot.chat(message)](#botchatmessage)
|
|
275
275
|
- [bot.whisper(username, message)](#botwhisperusername-message)
|
|
276
276
|
- [bot.chatAddPattern(pattern, chatType, description)](#botchataddpatternpattern-chattype-description)
|
|
@@ -1649,7 +1649,7 @@ End the connection with the server.
|
|
|
1649
1649
|
|
|
1650
1650
|
Gracefully disconnect from the server with the given reason (defaults to 'disconnect.quitting').
|
|
1651
1651
|
|
|
1652
|
-
#### bot.tabComplete(str, [assumeCommand], [sendBlockInSight])
|
|
1652
|
+
#### bot.tabComplete(str, [assumeCommand], [sendBlockInSight], [timeout])
|
|
1653
1653
|
|
|
1654
1654
|
This function returns a `Promise`, with `matches` as its argument upon completion.
|
|
1655
1655
|
|
|
@@ -1657,6 +1657,7 @@ Requests chat completion from the server.
|
|
|
1657
1657
|
* `str` - String to complete.
|
|
1658
1658
|
* `assumeCommand` - Field sent to server, defaults to false.
|
|
1659
1659
|
* `sendBlockInSight` - Field sent to server, defaults to true. Set this option to false if you want more performance.
|
|
1660
|
+
* `timeout` - Timeout in milliseconds, after which the function will return an ampty array, defaults to 5000.
|
|
1660
1661
|
|
|
1661
1662
|
#### bot.chat(message)
|
|
1662
1663
|
|
|
@@ -1690,6 +1691,8 @@ the event will be called `"chat:name"`, with name being the name passed
|
|
|
1690
1691
|
|
|
1691
1692
|
returns a number which can be used with bot.removeChatPattern() to only delete this pattern
|
|
1692
1693
|
|
|
1694
|
+
- :eyes: cf. [examples/chat_parsing](https://github.com/PrismarineJS/mineflayer/blob/master/examples/chat_parsing.js#L17-L36)
|
|
1695
|
+
|
|
1693
1696
|
#### bot.addChatPatternSet(name, patterns, chatPatternOptions)
|
|
1694
1697
|
|
|
1695
1698
|
make an event that is called every time all patterns havee been matched to messages,
|
|
@@ -1702,6 +1705,8 @@ the event will be called `"chat:name"`, with name being the name passed
|
|
|
1702
1705
|
|
|
1703
1706
|
returns a number which can be used with bot.removeChatPattern() to only delete this patternset
|
|
1704
1707
|
|
|
1708
|
+
- :eyes: cf. [examples/chat_parsing](https://github.com/PrismarineJS/mineflayer/blob/master/examples/chat_parsing.js#L17-L36)
|
|
1709
|
+
|
|
1705
1710
|
#### bot.removeChatPattern(name)
|
|
1706
1711
|
|
|
1707
1712
|
removes a chat pattern(s)
|
package/docs/br/README_BR.md
CHANGED
|
@@ -213,16 +213,33 @@ Mas também dê uma olhada em:
|
|
|
213
213
|
|
|
214
214
|
### Executar Todos os Testes
|
|
215
215
|
|
|
216
|
-
Basta executar:
|
|
216
|
+
Basta executar:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
npm test
|
|
220
|
+
```
|
|
217
221
|
|
|
218
222
|
### Executar Testes para uma Versão Específica do Minecraft
|
|
219
|
-
|
|
223
|
+
|
|
224
|
+
Execute
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
npm test -- -g <versão>
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
onde `<versão>` é uma versão do Minecraft, como `1.12`, `1.15.2`...
|
|
220
231
|
|
|
221
232
|
### Executar um Teste Específico
|
|
222
|
-
|
|
233
|
+
|
|
234
|
+
Execute
|
|
235
|
+
```bash
|
|
236
|
+
npm test -- -g <nome_do_teste>
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
onde `<nome_do_teste>` é o nome do teste que você deseja executar, como `bed`, `useChests`, `rayTrace`...
|
|
223
240
|
|
|
224
241
|
## Licença
|
|
225
242
|
|
|
226
|
-
[MIT](LICENSE)
|
|
243
|
+
[MIT](../../LICENSE)
|
|
227
244
|
|
|
228
245
|
Esta documentação não é oficialmente mantida. Para ver as últimas atualizações, consulte a documentação original: [unstable_api](../README.md)
|
package/docs/es/README_ES.md
CHANGED
|
@@ -213,17 +213,33 @@ Pero también echa un vistazo a:
|
|
|
213
213
|
|
|
214
214
|
### Ejecuta todas las pruebas
|
|
215
215
|
|
|
216
|
-
Simplemente ejecuta:
|
|
216
|
+
Simplemente ejecuta:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
npm test
|
|
220
|
+
```
|
|
217
221
|
|
|
218
222
|
### Ejecuta pruebas para una versión específica de Minecraft
|
|
219
|
-
|
|
223
|
+
|
|
224
|
+
Ejecuta
|
|
225
|
+
```bash
|
|
226
|
+
npm test -- -g <version>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
donde `<version>` es una versión de minecraft como `1.12`, `1.15.2`...
|
|
220
230
|
|
|
221
231
|
### Ejecuta una prueba específica
|
|
222
|
-
|
|
232
|
+
|
|
233
|
+
Ejecuta
|
|
234
|
+
```bash
|
|
235
|
+
npm test -- -g <test_name>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
donde `<test_name>` es el nombre de la prueba que quieres ejecutar como `bed`, `useChests`, `rayTrace`...
|
|
223
239
|
|
|
224
240
|
## Licencia
|
|
225
241
|
|
|
226
|
-
[MIT](LICENSE)
|
|
242
|
+
[MIT](../../LICENSE)
|
|
227
243
|
|
|
228
244
|
|
|
229
245
|
Esta documentación no está mantenida oficialmente, si quiere ver las últimas novedades, por favor dirijase a la documentación original: [unstable_api](../README.md)
|
package/docs/fr/README_FR.md
CHANGED
|
@@ -221,14 +221,32 @@ Laissez un coup d'oeil à ses projets :
|
|
|
221
221
|
|
|
222
222
|
### Tout tester
|
|
223
223
|
|
|
224
|
-
Exécuter seulement :
|
|
224
|
+
Exécuter seulement :
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
npm test
|
|
228
|
+
```
|
|
225
229
|
|
|
226
230
|
### Tester une version spécifique
|
|
227
|
-
|
|
231
|
+
|
|
232
|
+
Exécutez
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
npm test -g <version>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
où `<version>` est une version de Minecraft comme `1.12`, `1.15.2`...
|
|
228
239
|
|
|
229
240
|
### Tester un test spécifique
|
|
230
|
-
|
|
241
|
+
|
|
242
|
+
Executer
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
npm test -g <test_name>
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
où `<test_name>` est le nom d'un teste comme `lit`, `utiliseCoffre`, `rayTrace`...
|
|
231
249
|
|
|
232
250
|
## Licence
|
|
233
251
|
|
|
234
|
-
[MIT](
|
|
252
|
+
[MIT](../../LICENSE)
|
package/docs/history.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 4.20.0
|
|
2
|
+
* [Update api.md - addChatPattern[Set] link to example of usage (#3304)](https://github.com/PrismarineJS/mineflayer/commit/bb3e5877b7b3b8ab063b39a5b47d103b819da1c2) (thanks @boly38)
|
|
3
|
+
* [Fixed deleted scoreboards not being removed from ScoreBoard.positions (#3306)](https://github.com/PrismarineJS/mineflayer/commit/643023df91bf428d3e7d30e8f2eab97e3238b0b2) (thanks @Ynfuien)
|
|
4
|
+
* [Support 1.20.4 (#3310)](https://github.com/PrismarineJS/mineflayer/commit/aa99daa7d63ee9549f2dda5a79c140e30e19a89b) (thanks @rom1504)
|
|
5
|
+
|
|
6
|
+
## 4.19.0
|
|
7
|
+
* [Clarify readme createBot username handling (#3300)](https://github.com/PrismarineJS/mineflayer/commit/7a2680bc07f53d16626679537ea1f07aae180549) (thanks @extremeheat)
|
|
8
|
+
* [fix world typing (#3302)](https://github.com/PrismarineJS/mineflayer/commit/5dc36d6cdeaf4be72ea023827d45b9d78e575f66) (thanks @GenerelSchwerz)
|
|
9
|
+
* [modified the README.md files for other languages and fixed a linking issue at those files. (#3297)](https://github.com/PrismarineJS/mineflayer/commit/cc98f1307e3ab48477d2a9ff29da4447f42b30bc) (thanks @Axwaizee)
|
|
10
|
+
* [formatted docs/README.md for easy copy (#3295)](https://github.com/PrismarineJS/mineflayer/commit/468c8aa9d382a7872ec991c3b834b98cbe495e8d) (thanks @Axwaizee)
|
|
11
|
+
* [Added missing bot.teams definition (#3294)](https://github.com/PrismarineJS/mineflayer/commit/fb8ee7aa619bd38cc97d5dbd870bb11455d51d39) (thanks @Ynfuien)
|
|
12
|
+
* [Timeout for bot.tabComplete() (#3293)](https://github.com/PrismarineJS/mineflayer/commit/4231a169d579d08ac7b9ec0694e18b1f6ac837ea) (thanks @Ynfuien)
|
|
13
|
+
* [:label: Update types to be updated with what's in JavaScript (#3287)](https://github.com/PrismarineJS/mineflayer/commit/210785e86c031f7e3323d7d2ffe5152d2d4a5eb6) (thanks @fantomitechno)
|
|
14
|
+
* [Fixed some typo (#3290)](https://github.com/PrismarineJS/mineflayer/commit/ba53a953d03a6edb34aa5bf38bccde58e65d816d) (thanks @SilianZ)
|
|
15
|
+
* [Updated digging code to account for raycasted tall grass checks (#3285)](https://github.com/PrismarineJS/mineflayer/commit/bd0fb5c4d3b665f264009f62f9288828f3018cea) (thanks @GenerelSchwerz)
|
|
16
|
+
|
|
1
17
|
## 4.18.0
|
|
2
18
|
* [Minecraft 1.20.2 support (#3262)](https://github.com/PrismarineJS/mineflayer/commit/2ff9919760d714be57dcb678f8ab5ecff69f5fee) (thanks @rom1504)
|
|
3
19
|
* [Update recommended Node.js version (#3279)](https://github.com/PrismarineJS/mineflayer/commit/5c71edf48bb2f2dfa16cddb9af5baa0c4d55cf0d) (thanks @Nyaasu66)
|
package/docs/ru/README_RU.md
CHANGED
|
@@ -219,17 +219,38 @@ Mineflayer поддерживает сторонние плагины. Любо
|
|
|
219
219
|
|
|
220
220
|
### Тестирование всего
|
|
221
221
|
|
|
222
|
-
Просто запустите:
|
|
222
|
+
Просто запустите:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
npm test
|
|
226
|
+
```
|
|
223
227
|
|
|
224
228
|
### Тестирование определённой версии
|
|
225
|
-
Запустите
|
|
229
|
+
Запустите
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
npm run mocha_test -- -g <version>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
где `<version>` означает версию, таких как `1.12`, `1.15.2`...
|
|
226
236
|
|
|
227
237
|
### Тестирование определённой функции
|
|
228
|
-
|
|
238
|
+
|
|
239
|
+
Запустите
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
npm run mocha_test -- -g <test_name>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
где `<test_name>` означает название проверки, таких как `bed`, `useChests`, `rayTrace`...
|
|
229
246
|
|
|
230
247
|
### Пример
|
|
231
248
|
|
|
232
|
-
|
|
249
|
+
```bash
|
|
250
|
+
npm run mocha_test -- -g "1.18.1.*BlockFinder"
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
запустит тест BlockFinder на версии 1.18.1
|
|
233
254
|
|
|
234
255
|
## Лицензия
|
|
235
256
|
|
package/docs/tr/README_TR.md
CHANGED
|
@@ -218,13 +218,28 @@ En çok güncellenen ve en kullanışlı olan bazıları:
|
|
|
218
218
|
|
|
219
219
|
### Her şeyi test etme
|
|
220
220
|
|
|
221
|
-
Basitçe
|
|
221
|
+
Basitçe
|
|
222
|
+
```bash
|
|
223
|
+
npm test
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
komutunu çalıştırın
|
|
222
227
|
|
|
223
228
|
### Özel bir sürümü test etme
|
|
224
|
-
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
npm test -- -g <version>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
komutunu çalıştırın, `<version>` bir Minecraft sürümü olmalı (`1.12`, `1.15.2` gibi).
|
|
225
235
|
|
|
226
236
|
### Özel bir şeyi test etme
|
|
227
|
-
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
npm test -- -g <test_name>
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
komutunu çalıştırın, `<test_name>` kısmının olduğu bölüm bir test adı olmalı (`bed`, `useChests`, `rayTrace` gibi).
|
|
228
243
|
|
|
229
244
|
## Lisans
|
|
230
|
-
[MIT](LICENSE)
|
|
245
|
+
[MIT](../../LICENSE)
|
package/docs/zh/CONTRIBUTING.md
CHANGED
package/docs/zh/README_ZH_CN.md
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
| <sub>EN</sub> [English](../README.md) | <sub>RU</sub> [русский](../ru/README_RU.md) | <sub>ES</sub> [Español](../es/README_ES.md) | <sub>FR</sub> [Français](../fr/README_FR.md) | <sub>TR</sub> [Türkçe](../tr/README_TR.md) | <sub>ZH</sub> [中文](../zh/README_ZH_CN.md) | <sub>BR</sub> [Portuguese](../br/README_BR.md) |
|
|
14
14
|
|-------------------------|----------------------------|----------------------------|----------------------------|----------------------------|----------------------------|----------------------------|
|
|
15
15
|
|
|
16
|
-
使用强大、稳定、高级的JavaScript [API](../api.md) 来开发Minecraft机器人,同时支持 Python。
|
|
16
|
+
使用强大、稳定、高级的 JavaScript [API](../api.md) 来开发 Minecraft 机器人,同时支持 Python。
|
|
17
17
|
|
|
18
|
-
第一次使用 node.js ?你可以先看看 [使用教程](../tutorial.md) 。了解过 Python?这里有一些 [Python实例](https://github.com/PrismarineJS/mineflayer/tree/master/examples/python),同时你也可以
|
|
18
|
+
第一次使用 node.js ?你可以先看看 [使用教程](../tutorial.md) 。了解过 Python?这里有一些 [Python 实例](https://github.com/PrismarineJS/mineflayer/tree/master/examples/python),同时你也可以[在谷歌 Colab 中运行 Mineflayer](https://colab.research.google.com/github/PrismarineJS/mineflayer/blob/master/docs/mineflayer.ipynb) 来体验一下。
|
|
19
19
|
|
|
20
20
|
## 特点
|
|
21
21
|
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
* 各种各样的的信息接口,比如查看你的血量或是否下雨
|
|
31
31
|
* 激活方块和使用物品
|
|
32
32
|
* 进行聊天
|
|
33
|
+
|
|
33
34
|
### 路线图
|
|
34
35
|
|
|
35
36
|
[点这里](https://github.com/PrismarineJS/mineflayer/wiki/Big-Prismarine-projects) 看看目前我们有哪些实用的项目
|
|
@@ -80,11 +81,11 @@
|
|
|
80
81
|
const mineflayer = require('mineflayer')
|
|
81
82
|
|
|
82
83
|
const bot = mineflayer.createBot({
|
|
83
|
-
host: 'localhost', // minecraft 服务器的
|
|
84
|
+
host: 'localhost', // minecraft 服务器的 IP 地址
|
|
84
85
|
username: 'email@example.com', // minecraft 用户名
|
|
85
86
|
password: '12345678' // minecraft 密码, 如果你玩的是不需要正版验证的服务器,请注释掉。
|
|
86
|
-
// port: 25565, // 默认使用25565,如果你的服务器端口不是这个请取消注释并填写。
|
|
87
|
-
// version: false, // 如果需要指定使用一个版本或快照时,请取消注释并手动填写(如:"1.8.9
|
|
87
|
+
// port: 25565, // 默认使用 25565,如果你的服务器端口不是这个请取消注释并填写。
|
|
88
|
+
// version: false, // 如果需要指定使用一个版本或快照时,请取消注释并手动填写(如:"1.8.9" 或 "1.16.5"),否则会自动设置。
|
|
88
89
|
// auth: 'mojang' // 如果需要使用微软账号登录时,请取消注释,然后将值设置为 'microsoft',否则会自动设置为 'mojang'。
|
|
89
90
|
})
|
|
90
91
|
|
|
@@ -93,15 +94,15 @@ bot.on('chat', (username, message) => {
|
|
|
93
94
|
bot.chat(message)
|
|
94
95
|
})
|
|
95
96
|
|
|
96
|
-
//
|
|
97
|
+
// 记录错误和被踢出服务器的原因:
|
|
97
98
|
bot.on('kicked', console.log)
|
|
98
99
|
bot.on('error', console.log)
|
|
99
100
|
```
|
|
100
101
|
|
|
101
|
-
### 看看你的bot在做什么
|
|
102
|
+
### 看看你的 bot 在做什么
|
|
102
103
|
|
|
103
|
-
感谢 [
|
|
104
|
-
只需要运行 `npm install prismarine-viewer` 并将其添加到你的bot代码中。
|
|
104
|
+
感谢 [prismarine-viewer](https://github.com/PrismarineJS/prismarine-viewer)项目,它可以在浏览器窗口显示你的机器人正在做什么。
|
|
105
|
+
只需要运行 `npm install prismarine-viewer` 并将其添加到你的 bot 代码中。
|
|
105
106
|
|
|
106
107
|
```js
|
|
107
108
|
const { mineflayer: mineflayerViewer } = require('prismarine-viewer')
|
|
@@ -118,13 +119,13 @@ bot.once('spawn', () => {
|
|
|
118
119
|
|
|
119
120
|
| 例子 | 描述 |
|
|
120
121
|
|---|---|
|
|
121
|
-
|[viewer](https://github.com/PrismarineJS/mineflayer/tree/master/examples/viewer) | 在浏览器中显示bot的视角 |
|
|
122
|
-
|[pathfinder](https://github.com/PrismarineJS/mineflayer/tree/master/examples/pathfinder) | 让你的bot自动前往任何地点 |
|
|
122
|
+
|[viewer](https://github.com/PrismarineJS/mineflayer/tree/master/examples/viewer) | 在浏览器中显示 bot 的视角 |
|
|
123
|
+
|[pathfinder](https://github.com/PrismarineJS/mineflayer/tree/master/examples/pathfinder) | 让你的 bot 自动前往任何地点 |
|
|
123
124
|
|[chest](https://github.com/PrismarineJS/mineflayer/blob/master/examples/chest.js) | 使用箱子、熔炉、酿造台、附魔台 |
|
|
124
125
|
|[digger](https://github.com/PrismarineJS/mineflayer/blob/master/examples/digger.js) | 学习如何创建一个能够挖掘方块的简单bot |
|
|
125
126
|
|[discord](https://github.com/PrismarineJS/mineflayer/blob/master/examples/discord.js) | 将 discord bot 与 mineflayer bot 进行消息互通 |
|
|
126
127
|
|[jumper](https://github.com/PrismarineJS/mineflayer/blob/master/examples/jumper.js) | 学习如何移动、跳跃、骑乘载具、攻击附近的实体 |
|
|
127
|
-
|[ansi](https://github.com/PrismarineJS/mineflayer/blob/master/examples/ansi.js) | 使用全彩色在命令行中显示bot的聊天记录 |
|
|
128
|
+
|[ansi](https://github.com/PrismarineJS/mineflayer/blob/master/examples/ansi.js) | 使用全彩色在命令行中显示 bot 的聊天记录 |
|
|
128
129
|
|[guard](https://github.com/PrismarineJS/mineflayer/blob/master/examples/guard.js) | 让bot守卫一个指定的区域,不让附近的生物进入。 |
|
|
129
130
|
|[multiple-from-file](https://github.com/PrismarineJS/mineflayer/blob/master/examples/multiple_from_file.js) | 创建一个包含账户信息的文本文件,让它们全部同时登录 |
|
|
130
131
|
|
|
@@ -132,15 +133,15 @@ bot.once('spawn', () => {
|
|
|
132
133
|
|
|
133
134
|
### 模块
|
|
134
135
|
|
|
135
|
-
很多活跃的开发都发生在 mineflayer 所使用的小型npm包内
|
|
136
|
+
很多活跃的开发都发生在 mineflayer 所使用的小型 npm 包内
|
|
136
137
|
|
|
137
|
-
#### The Node Way™
|
|
138
|
+
#### The Node Way & trade;
|
|
138
139
|
|
|
139
140
|
> "当你很好的编写了一个应用程序,此时它的价值仅限于这些特定的需求。你要知道,真正好的、可重复使用的优秀组件都会升华到github和npm上,在那里,每个人都可以合作来推进公共事业。" — [《 how I write modules 》 - substack](https://gist.github.com/substack/5075355)
|
|
140
141
|
|
|
141
142
|
#### 子模块
|
|
142
143
|
|
|
143
|
-
这些是 构成
|
|
144
|
+
这些是 构成 mineflayer 的主要模块:
|
|
144
145
|
|
|
145
146
|
| 模块 | 描述 |
|
|
146
147
|
|---|---|
|
|
@@ -177,7 +178,7 @@ node your_script.js
|
|
|
177
178
|
|
|
178
179
|
## 第三方插件
|
|
179
180
|
|
|
180
|
-
|
|
181
|
+
mineflayer 支持插件;任何人都可以创建一个插件,在 mineflayer 之上添加更高级别的 API。
|
|
181
182
|
|
|
182
183
|
最新和最有用的有:
|
|
183
184
|
|
|
@@ -206,9 +207,9 @@ Mineflayer 支持插件;任何人都可以创建一个插件,在 Mineflayer
|
|
|
206
207
|
* [Bloodhound](https://github.com/Nixes/mineflayer-bloodhound) - 确定谁和什么对另一个实体的损害负责
|
|
207
208
|
* [tps](https://github.com/SiebeDW/mineflayer-tps) - 获取当前的 tps(已处理的 tps)
|
|
208
209
|
* [panorama](https://github.com/IceTank/mineflayer-panorama) - 拍摄您的世界的全景图像
|
|
209
|
-
* [player-death-event](https://github.com/tuanzisama/mineflayer-death-event) - 在Mineflayer里监听玩家死亡事件
|
|
210
|
+
* [player-death-event](https://github.com/tuanzisama/mineflayer-death-event) - 在 Mineflayer 里监听玩家死亡事件
|
|
210
211
|
|
|
211
|
-
## 正在使用
|
|
212
|
+
## 正在使用 mineflayer 的项目
|
|
212
213
|
|
|
213
214
|
* [rom1504/rbot](https://github.com/rom1504/rbot)
|
|
214
215
|
* [YouTube - 建造旋转楼梯](https://www.youtube.com/watch?v=UM1ZV5200S0)
|
|
@@ -227,20 +228,39 @@ Mineflayer 支持插件;任何人都可以创建一个插件,在 Mineflayer
|
|
|
227
228
|
|
|
228
229
|
### 完整测试
|
|
229
230
|
|
|
230
|
-
|
|
231
|
+
运行
|
|
232
|
+
```bash
|
|
233
|
+
npm test
|
|
234
|
+
````
|
|
231
235
|
|
|
232
236
|
### 测试指定版本
|
|
233
237
|
|
|
234
|
-
运行
|
|
238
|
+
运行
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
npm mocha_test -- -g <version>
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
其中 `<version>` 表示 minecraft 版本号 如 `1.12`, `1.15.2`...
|
|
235
245
|
|
|
236
246
|
### 测试指定测试脚本
|
|
237
247
|
|
|
238
|
-
运行
|
|
248
|
+
运行
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
npm mocha_test -- -g <test_name>
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
其中 `<test_name>` 是测试名称,例如 `bed`, `useChests`, `rayTrace`...
|
|
239
255
|
|
|
240
256
|
### 示例
|
|
241
257
|
|
|
242
|
-
|
|
258
|
+
```bash
|
|
259
|
+
npm run mocha_test -- -g "1.18.1.*BlockFinder"
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
进行 1.18.1 寻路测试
|
|
243
263
|
|
|
244
264
|
## 许可证
|
|
245
265
|
|
|
246
|
-
[MIT](
|
|
266
|
+
[MIT](../../LICENSE)
|