mineflayer 3.10.0 → 3.12.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/.github/FUNDING.yml +0 -2
- package/.github/workflows/ci.yml +20 -16
- package/README.md +16 -15
- package/docs/README.md +16 -15
- package/docs/api.md +50 -27
- package/docs/es/README_ES.md +1 -1
- package/docs/es/api_es.md +34 -18
- package/docs/fr/README_FR.md +1 -1
- package/docs/history.md +28 -0
- package/docs/ru/README_RU.md +1 -1
- package/docs/ru/api_ru.md +1 -1
- package/docs/tr/README_TR.md +1 -1
- package/docs/zh/README_ZH_CN.md +1 -1
- package/examples/chatterbox.js +1 -1
- package/examples/discord.js +15 -5
- package/examples/plugins/afk.js +50 -37
- package/examples/python/basic.py +2 -2
- package/examples/python/chatterbox.py +1 -1
- package/examples/screenshot-with-node-canvas-webgl/screenshot.js +2 -2
- package/index.d.ts +108 -134
- package/lib/conversions.js +1 -1
- package/lib/features.json +57 -27
- package/lib/loader.js +5 -4
- package/lib/plugins/bed.js +1 -1
- package/lib/plugins/block_actions.js +19 -7
- package/lib/plugins/blocks.js +17 -4
- package/lib/plugins/chat.js +5 -6
- package/lib/plugins/command_block.js +1 -1
- package/lib/plugins/craft.js +10 -18
- package/lib/plugins/creative.js +2 -2
- package/lib/plugins/digging.js +15 -6
- package/lib/plugins/enchantment_table.js +4 -2
- package/lib/plugins/entities.js +13 -8
- package/lib/plugins/explosion.js +3 -1
- package/lib/plugins/fishing.js +2 -2
- package/lib/plugins/game.js +55 -50
- package/lib/plugins/inventory.js +164 -40
- package/lib/plugins/physics.js +16 -5
- package/lib/plugins/place_block.js +7 -6
- package/lib/plugins/ray_trace.js +10 -0
- package/lib/plugins/simple_inventory.js +1 -1
- package/lib/plugins/sound.js +1 -1
- package/lib/plugins/spawn_point.js +1 -1
- package/lib/plugins/villager.js +57 -42
- package/lib/version.js +3 -3
- package/package.json +23 -22
package/.github/FUNDING.yml
CHANGED
package/.github/workflows/ci.yml
CHANGED
|
@@ -2,10 +2,10 @@ name: CI
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
-
branches:
|
|
5
|
+
branches:
|
|
6
6
|
- master
|
|
7
7
|
pull_request:
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
jobs:
|
|
10
10
|
Lint:
|
|
11
11
|
runs-on: ubuntu-latest
|
|
@@ -22,21 +22,25 @@ jobs:
|
|
|
22
22
|
runs-on: ubuntu-latest
|
|
23
23
|
strategy:
|
|
24
24
|
matrix:
|
|
25
|
+
javaVersion: [1.8]
|
|
25
26
|
mcVersion: ['1.8.8', '1.9.4', '1.10.2', '1.11.2', '1.12.2', '1.13.2', '1.14.4', '1.15.2', '1.16.5']
|
|
27
|
+
include:
|
|
28
|
+
- javaVersion: 16
|
|
29
|
+
mcVersion: '1.17.1'
|
|
26
30
|
fail-fast: false
|
|
27
31
|
|
|
28
32
|
steps:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
- uses: actions/checkout@v2
|
|
34
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
35
|
+
uses: actions/setup-node@v1.4.4
|
|
36
|
+
with:
|
|
37
|
+
node-version: 14.x
|
|
38
|
+
- name: Setup Java JDK
|
|
39
|
+
uses: actions/setup-java@v1.4.3
|
|
40
|
+
with:
|
|
41
|
+
java-version: ${{ matrix.javaVersion }}
|
|
42
|
+
java-package: jre
|
|
43
|
+
- name: Install Dependencies
|
|
44
|
+
run: npm install
|
|
45
|
+
- name: Start Tests
|
|
46
|
+
run: npm run mocha_test -- -g ${{ matrix.mcVersion }}
|
package/README.md
CHANGED
|
@@ -3,23 +3,20 @@
|
|
|
3
3
|
[](http://badge.fury.io/js/mineflayer)
|
|
4
4
|
[](https://github.com/PrismarineJS/mineflayer/actions?query=workflow%3A%22CI%22)
|
|
5
5
|
[](https://discord.gg/GsEFRM8)
|
|
6
|
-
[](https://gitter.im/PrismarineJS/general)
|
|
7
|
-
[](https://irc.gitter.im/)
|
|
8
6
|
[](https://issuehunt.io/r/PrismarineJS/mineflayer)
|
|
9
|
-
|
|
10
7
|
[](https://gitpod.io/#https://github.com/PrismarineJS/mineflayer)
|
|
11
8
|
[](https://colab.research.google.com/github/PrismarineJS/mineflayer/blob/master/docs/mineflayer.ipynb)
|
|
12
9
|
|
|
13
|
-
|
|
|
10
|
+
| <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) |
|
|
14
11
|
|-------------------------|----------------------------|----------------------------|----------------------------|----------------------------|----------------------------|
|
|
15
12
|
|
|
16
13
|
Create Minecraft bots with a powerful, stable, and high level JavaScript [API](api.md), also usable from Python.
|
|
17
14
|
|
|
18
|
-
First time using
|
|
15
|
+
First time using Node.js? You may want to start with the [tutorial](tutorial.md). Know Python? Checkout some [Python examples](https://github.com/PrismarineJS/mineflayer/tree/master/examples/python) and try out [Mineflayer on Google Colab](https://colab.research.google.com/github/PrismarineJS/mineflayer/blob/master/docs/mineflayer.ipynb).
|
|
19
16
|
|
|
20
17
|
## Features
|
|
21
18
|
|
|
22
|
-
* Supports Minecraft 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15 and 1.
|
|
19
|
+
* Supports Minecraft 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16 and 1.17.
|
|
23
20
|
* Entity knowledge and tracking.
|
|
24
21
|
* Block knowledge. You can query the world around you. Milliseconds to find any block.
|
|
25
22
|
* Physics and movement - handle all bounding boxes
|
|
@@ -33,11 +30,11 @@ First time using node.js ? You may want to start with the [tutorial](tutorial.md
|
|
|
33
30
|
|
|
34
31
|
### Roadmap
|
|
35
32
|
|
|
36
|
-
Checkout this page
|
|
33
|
+
Checkout [this page](https://github.com/PrismarineJS/mineflayer/wiki/Big-Prismarine-projects) to see what our current projects are.
|
|
37
34
|
|
|
38
35
|
## Installation
|
|
39
36
|
|
|
40
|
-
First install
|
|
37
|
+
First install Node.js >= 14 from [nodejs.org](https://nodejs.org/) then:
|
|
41
38
|
|
|
42
39
|
`npm install mineflayer`
|
|
43
40
|
|
|
@@ -45,7 +42,7 @@ First install nodejs >= 14 from [nodejs.org](https://nodejs.org/) then:
|
|
|
45
42
|
|
|
46
43
|
| link | description |
|
|
47
44
|
|---|---|
|
|
48
|
-
|[tutorial](tutorial.md) | Begin with
|
|
45
|
+
|[tutorial](tutorial.md) | Begin with Node.js and mineflayer |
|
|
49
46
|
| [FAQ.md](FAQ.md) | Got a question ? go there first |
|
|
50
47
|
| [api.md](api.md) [unstable_api.md](unstable_api.md) | The full API reference |
|
|
51
48
|
| [history.md](history.md) | The changelog for mineflayer |
|
|
@@ -71,7 +68,7 @@ If you want to learn more, more video tutorials are [there,](https://www.youtube
|
|
|
71
68
|
|
|
72
69
|
**Getting Started**
|
|
73
70
|
|
|
74
|
-
Without version specified, the version of the server will be guessed automatically.
|
|
71
|
+
Without a version specified, the version of the server will be guessed automatically.
|
|
75
72
|
Without auth specified, the mojang auth style will be guessed.
|
|
76
73
|
|
|
77
74
|
### Echo Example
|
|
@@ -99,7 +96,7 @@ bot.on('error', console.log)
|
|
|
99
96
|
|
|
100
97
|
### See what your bot is doing
|
|
101
98
|
|
|
102
|
-
Thanks to [prismarine-viewer](https://github.com/PrismarineJS/prismarine-viewer) project, it's possible to display in a browser window what your bot is doing.
|
|
99
|
+
Thanks to the [prismarine-viewer](https://github.com/PrismarineJS/prismarine-viewer) project, it's possible to display in a browser window what your bot is doing.
|
|
103
100
|
Just run `npm install prismarine-viewer` and add this to your bot:
|
|
104
101
|
```js
|
|
105
102
|
const { mineflayer: mineflayerViewer } = require('prismarine-viewer')
|
|
@@ -118,7 +115,7 @@ And you'll get a *live* view looking like this:
|
|
|
118
115
|
|[viewer](https://github.com/PrismarineJS/mineflayer/tree/master/examples/viewer) | Display your bot world view in the browser |
|
|
119
116
|
|[pathfinder](https://github.com/PrismarineJS/mineflayer/tree/master/examples/pathfinder) | Make your bot go to any location automatically |
|
|
120
117
|
|[chest](https://github.com/PrismarineJS/mineflayer/blob/master/examples/chest.js) | Use chests, furnaces, dispensers, enchantment tables |
|
|
121
|
-
|[digger](https://github.com/PrismarineJS/mineflayer/blob/master/examples/digger.js) | Learn how to create a simple bot that is capable of digging
|
|
118
|
+
|[digger](https://github.com/PrismarineJS/mineflayer/blob/master/examples/digger.js) | Learn how to create a simple bot that is capable of digging blocks |
|
|
122
119
|
|[discord](https://github.com/PrismarineJS/mineflayer/blob/master/examples/discord.js) | Connect a discord bot with a mineflayer bot |
|
|
123
120
|
|[jumper](https://github.com/PrismarineJS/mineflayer/blob/master/examples/jumper.js) | Learn how to move, jump, ride vehicles, attack nearby entities |
|
|
124
121
|
|[ansi](https://github.com/PrismarineJS/mineflayer/blob/master/examples/ansi.js) | Display your bot's chat with all of the chat colors shown in your terminal |
|
|
@@ -182,14 +179,17 @@ The most updated and useful are :
|
|
|
182
179
|
* [pathfinder](https://github.com/Karang/mineflayer-pathfinder) - advanced A* pathfinding with a lot of configurable features
|
|
183
180
|
* [prismarine-viewer](https://github.com/PrismarineJS/prismarine-viewer) - simple web chunk viewer
|
|
184
181
|
* [web-inventory](https://github.com/ImHarvol/mineflayer-web-inventory) - web based inventory viewer
|
|
185
|
-
* [statemachine](https://github.com/TheDudeFromCI/mineflayer-statemachine) - A state machine API for more complex bot
|
|
186
|
-
* [Armor Manager](https://github.com/G07cha/MineflayerArmorManager) - automatic armor
|
|
182
|
+
* [statemachine](https://github.com/TheDudeFromCI/mineflayer-statemachine) - A state machine API for more complex bot behaviors
|
|
183
|
+
* [Armor Manager](https://github.com/G07cha/MineflayerArmorManager) - automatic armor management
|
|
187
184
|
* [Collect Block](https://github.com/TheDudeFromCI/mineflayer-collectblock) - Quick and simple block collection API.
|
|
188
185
|
* [Dashboard](https://github.com/wvffle/mineflayer-dashboard) - Frontend dashboard for mineflayer bot
|
|
189
186
|
* [PVP](https://github.com/TheDudeFromCI/mineflayer-pvp) - Easy API for basic PVP and PVE.
|
|
190
|
-
* [
|
|
187
|
+
* [Auto Eat](https://github.com/link-discord/mineflayer-auto-eat) - Automatic eating of food.
|
|
188
|
+
* [Auto Crystal](https://github.com/link-discord/mineflayer-autocrystal) - Automatic placing & breaking of end crystals.
|
|
191
189
|
* [Tool](https://github.com/TheDudeFromCI/mineflayer-tool) - A utility for automatic tool/weapon selection with a high level API.
|
|
192
190
|
* [Hawkeye](https://github.com/sefirosweb/minecraftHawkEye) - A utility for using auto-aim with bows.
|
|
191
|
+
* [GUI](https://github.com/firejoust/mineflayer-GUI) - Eased navigation & management of nested chest-GUI windows
|
|
192
|
+
* [Projectile](https://github.com/firejoust/mineflayer-projectile) - Configurable tool for projectile based combat
|
|
193
193
|
|
|
194
194
|
|
|
195
195
|
But also check out :
|
|
@@ -204,6 +204,7 @@ The most updated and useful are :
|
|
|
204
204
|
* [Bloodhound](https://github.com/Nixes/mineflayer-bloodhound) - determine who and what is responsible for damage to another entity
|
|
205
205
|
* [tps](https://github.com/SiebeDW/mineflayer-tps) - get the current tps (processed tps)
|
|
206
206
|
* [panorama](https://github.com/IceTank/mineflayer-panorama) - take Panorama Images of your world
|
|
207
|
+
* [player-death-event](https://github.com/tuanzisama/mineflayer-death-event) - emit player death event in Mineflayer.
|
|
207
208
|
|
|
208
209
|
## Projects Using Mineflayer
|
|
209
210
|
|
package/docs/README.md
CHANGED
|
@@ -3,23 +3,20 @@
|
|
|
3
3
|
[](http://badge.fury.io/js/mineflayer)
|
|
4
4
|
[](https://github.com/PrismarineJS/mineflayer/actions?query=workflow%3A%22CI%22)
|
|
5
5
|
[](https://discord.gg/GsEFRM8)
|
|
6
|
-
[](https://gitter.im/PrismarineJS/general)
|
|
7
|
-
[](https://irc.gitter.im/)
|
|
8
6
|
[](https://issuehunt.io/r/PrismarineJS/mineflayer)
|
|
9
|
-
|
|
10
7
|
[](https://gitpod.io/#https://github.com/PrismarineJS/mineflayer)
|
|
11
8
|
[](https://colab.research.google.com/github/PrismarineJS/mineflayer/blob/master/docs/mineflayer.ipynb)
|
|
12
9
|
|
|
13
|
-
|
|
|
10
|
+
| <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) |
|
|
14
11
|
|-------------------------|----------------------------|----------------------------|----------------------------|----------------------------|----------------------------|
|
|
15
12
|
|
|
16
13
|
Create Minecraft bots with a powerful, stable, and high level JavaScript [API](api.md), also usable from Python.
|
|
17
14
|
|
|
18
|
-
First time using
|
|
15
|
+
First time using Node.js? You may want to start with the [tutorial](tutorial.md). Know Python? Checkout some [Python examples](https://github.com/PrismarineJS/mineflayer/tree/master/examples/python) and try out [Mineflayer on Google Colab](https://colab.research.google.com/github/PrismarineJS/mineflayer/blob/master/docs/mineflayer.ipynb).
|
|
19
16
|
|
|
20
17
|
## Features
|
|
21
18
|
|
|
22
|
-
* Supports Minecraft 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15 and 1.
|
|
19
|
+
* Supports Minecraft 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16 and 1.17.
|
|
23
20
|
* Entity knowledge and tracking.
|
|
24
21
|
* Block knowledge. You can query the world around you. Milliseconds to find any block.
|
|
25
22
|
* Physics and movement - handle all bounding boxes
|
|
@@ -33,11 +30,11 @@ First time using node.js ? You may want to start with the [tutorial](tutorial.md
|
|
|
33
30
|
|
|
34
31
|
### Roadmap
|
|
35
32
|
|
|
36
|
-
Checkout this page
|
|
33
|
+
Checkout [this page](https://github.com/PrismarineJS/mineflayer/wiki/Big-Prismarine-projects) to see what our current projects are.
|
|
37
34
|
|
|
38
35
|
## Installation
|
|
39
36
|
|
|
40
|
-
First install
|
|
37
|
+
First install Node.js >= 14 from [nodejs.org](https://nodejs.org/) then:
|
|
41
38
|
|
|
42
39
|
`npm install mineflayer`
|
|
43
40
|
|
|
@@ -45,7 +42,7 @@ First install nodejs >= 14 from [nodejs.org](https://nodejs.org/) then:
|
|
|
45
42
|
|
|
46
43
|
| link | description |
|
|
47
44
|
|---|---|
|
|
48
|
-
|[tutorial](tutorial.md) | Begin with
|
|
45
|
+
|[tutorial](tutorial.md) | Begin with Node.js and mineflayer |
|
|
49
46
|
| [FAQ.md](FAQ.md) | Got a question ? go there first |
|
|
50
47
|
| [api.md](api.md) [unstable_api.md](unstable_api.md) | The full API reference |
|
|
51
48
|
| [history.md](history.md) | The changelog for mineflayer |
|
|
@@ -71,7 +68,7 @@ If you want to learn more, more video tutorials are [there,](https://www.youtube
|
|
|
71
68
|
|
|
72
69
|
**Getting Started**
|
|
73
70
|
|
|
74
|
-
Without version specified, the version of the server will be guessed automatically.
|
|
71
|
+
Without a version specified, the version of the server will be guessed automatically.
|
|
75
72
|
Without auth specified, the mojang auth style will be guessed.
|
|
76
73
|
|
|
77
74
|
### Echo Example
|
|
@@ -99,7 +96,7 @@ bot.on('error', console.log)
|
|
|
99
96
|
|
|
100
97
|
### See what your bot is doing
|
|
101
98
|
|
|
102
|
-
Thanks to [prismarine-viewer](https://github.com/PrismarineJS/prismarine-viewer) project, it's possible to display in a browser window what your bot is doing.
|
|
99
|
+
Thanks to the [prismarine-viewer](https://github.com/PrismarineJS/prismarine-viewer) project, it's possible to display in a browser window what your bot is doing.
|
|
103
100
|
Just run `npm install prismarine-viewer` and add this to your bot:
|
|
104
101
|
```js
|
|
105
102
|
const { mineflayer: mineflayerViewer } = require('prismarine-viewer')
|
|
@@ -118,7 +115,7 @@ And you'll get a *live* view looking like this:
|
|
|
118
115
|
|[viewer](https://github.com/PrismarineJS/mineflayer/tree/master/examples/viewer) | Display your bot world view in the browser |
|
|
119
116
|
|[pathfinder](https://github.com/PrismarineJS/mineflayer/tree/master/examples/pathfinder) | Make your bot go to any location automatically |
|
|
120
117
|
|[chest](https://github.com/PrismarineJS/mineflayer/blob/master/examples/chest.js) | Use chests, furnaces, dispensers, enchantment tables |
|
|
121
|
-
|[digger](https://github.com/PrismarineJS/mineflayer/blob/master/examples/digger.js) | Learn how to create a simple bot that is capable of digging
|
|
118
|
+
|[digger](https://github.com/PrismarineJS/mineflayer/blob/master/examples/digger.js) | Learn how to create a simple bot that is capable of digging blocks |
|
|
122
119
|
|[discord](https://github.com/PrismarineJS/mineflayer/blob/master/examples/discord.js) | Connect a discord bot with a mineflayer bot |
|
|
123
120
|
|[jumper](https://github.com/PrismarineJS/mineflayer/blob/master/examples/jumper.js) | Learn how to move, jump, ride vehicles, attack nearby entities |
|
|
124
121
|
|[ansi](https://github.com/PrismarineJS/mineflayer/blob/master/examples/ansi.js) | Display your bot's chat with all of the chat colors shown in your terminal |
|
|
@@ -182,14 +179,17 @@ The most updated and useful are :
|
|
|
182
179
|
* [pathfinder](https://github.com/Karang/mineflayer-pathfinder) - advanced A* pathfinding with a lot of configurable features
|
|
183
180
|
* [prismarine-viewer](https://github.com/PrismarineJS/prismarine-viewer) - simple web chunk viewer
|
|
184
181
|
* [web-inventory](https://github.com/ImHarvol/mineflayer-web-inventory) - web based inventory viewer
|
|
185
|
-
* [statemachine](https://github.com/TheDudeFromCI/mineflayer-statemachine) - A state machine API for more complex bot
|
|
186
|
-
* [Armor Manager](https://github.com/G07cha/MineflayerArmorManager) - automatic armor
|
|
182
|
+
* [statemachine](https://github.com/TheDudeFromCI/mineflayer-statemachine) - A state machine API for more complex bot behaviors
|
|
183
|
+
* [Armor Manager](https://github.com/G07cha/MineflayerArmorManager) - automatic armor management
|
|
187
184
|
* [Collect Block](https://github.com/TheDudeFromCI/mineflayer-collectblock) - Quick and simple block collection API.
|
|
188
185
|
* [Dashboard](https://github.com/wvffle/mineflayer-dashboard) - Frontend dashboard for mineflayer bot
|
|
189
186
|
* [PVP](https://github.com/TheDudeFromCI/mineflayer-pvp) - Easy API for basic PVP and PVE.
|
|
190
|
-
* [
|
|
187
|
+
* [Auto Eat](https://github.com/link-discord/mineflayer-auto-eat) - Automatic eating of food.
|
|
188
|
+
* [Auto Crystal](https://github.com/link-discord/mineflayer-autocrystal) - Automatic placing & breaking of end crystals.
|
|
191
189
|
* [Tool](https://github.com/TheDudeFromCI/mineflayer-tool) - A utility for automatic tool/weapon selection with a high level API.
|
|
192
190
|
* [Hawkeye](https://github.com/sefirosweb/minecraftHawkEye) - A utility for using auto-aim with bows.
|
|
191
|
+
* [GUI](https://github.com/firejoust/mineflayer-GUI) - Eased navigation & management of nested chest-GUI windows
|
|
192
|
+
* [Projectile](https://github.com/firejoust/mineflayer-projectile) - Configurable tool for projectile based combat
|
|
193
193
|
|
|
194
194
|
|
|
195
195
|
But also check out :
|
|
@@ -204,6 +204,7 @@ The most updated and useful are :
|
|
|
204
204
|
* [Bloodhound](https://github.com/Nixes/mineflayer-bloodhound) - determine who and what is responsible for damage to another entity
|
|
205
205
|
* [tps](https://github.com/SiebeDW/mineflayer-tps) - get the current tps (processed tps)
|
|
206
206
|
* [panorama](https://github.com/IceTank/mineflayer-panorama) - take Panorama Images of your world
|
|
207
|
+
* [player-death-event](https://github.com/tuanzisama/mineflayer-death-event) - emit player death event in Mineflayer.
|
|
207
208
|
|
|
208
209
|
## Projects Using Mineflayer
|
|
209
210
|
|
package/docs/api.md
CHANGED
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
- [bot.username](#botusername)
|
|
87
87
|
- [bot.spawnPoint](#botspawnpoint)
|
|
88
88
|
- [bot.heldItem](#bothelditem)
|
|
89
|
+
- [bot.usingHeldItem](#botusinghelditem)
|
|
89
90
|
- [bot.game.levelType](#botgameleveltype)
|
|
90
91
|
- [bot.game.dimension](#botgamedimension)
|
|
91
92
|
- [bot.game.difficulty](#botgamedifficulty)
|
|
@@ -105,13 +106,13 @@
|
|
|
105
106
|
- [bot.settings.viewDistance](#botsettingsviewdistance)
|
|
106
107
|
- [bot.settings.difficulty](#botsettingsdifficulty)
|
|
107
108
|
- [bot.settings.skinParts](#botsettingsskinparts)
|
|
108
|
-
- [bot.settings.skinParts.showCape](#botsettingsskinpartsshowcape)
|
|
109
|
-
- [bot.settings.skinParts.showJacket](#botsettingsskinpartsshowjacket)
|
|
110
|
-
- [bot.settings.skinParts.showLeftSleeve](#botsettingsskinpartsshowleftsleeve)
|
|
111
|
-
- [bot.settings.skinParts.showRightSleeve](#botsettingsskinpartsshowrightsleeve)
|
|
112
|
-
- [bot.settings.skinParts.showLeftPants](#botsettingsskinpartsshowleftpants)
|
|
113
|
-
- [bot.settings.skinParts.showRightPants](#botsettingsskinpartsshowrightpants)
|
|
114
|
-
- [bot.settings.skinParts.showHat](#botsettingsskinpartsshowhat)
|
|
109
|
+
- [bot.settings.skinParts.showCape - boolean](#botsettingsskinpartsshowcape---boolean)
|
|
110
|
+
- [bot.settings.skinParts.showJacket - boolean](#botsettingsskinpartsshowjacket---boolean)
|
|
111
|
+
- [bot.settings.skinParts.showLeftSleeve - boolean](#botsettingsskinpartsshowleftsleeve---boolean)
|
|
112
|
+
- [bot.settings.skinParts.showRightSleeve - boolean](#botsettingsskinpartsshowrightsleeve---boolean)
|
|
113
|
+
- [bot.settings.skinParts.showLeftPants - boolean](#botsettingsskinpartsshowleftpants---boolean)
|
|
114
|
+
- [bot.settings.skinParts.showRightPants - boolean](#botsettingsskinpartsshowrightpants---boolean)
|
|
115
|
+
- [bot.settings.skinParts.showHat - boolean](#botsettingsskinpartsshowhat---boolean)
|
|
115
116
|
- [bot.experience.level](#botexperiencelevel)
|
|
116
117
|
- [bot.experience.points](#botexperiencepoints)
|
|
117
118
|
- [bot.experience.progress](#botexperienceprogress)
|
|
@@ -157,13 +158,13 @@
|
|
|
157
158
|
- ["weatherUpdate"](#weatherupdate)
|
|
158
159
|
- ["time"](#time)
|
|
159
160
|
- ["kicked" (reason, loggedIn)](#kicked-reason-loggedin)
|
|
160
|
-
- ["end"](#end)
|
|
161
|
+
- ["end" (reason)](#end-reason)
|
|
161
162
|
- ["error" (err)](#error-err)
|
|
162
163
|
- ["spawnReset"](#spawnreset)
|
|
163
164
|
- ["death"](#death)
|
|
164
165
|
- ["health"](#health)
|
|
165
166
|
- ["breath"](#breath)
|
|
166
|
-
- ["entityAttributes"](#entityattributes-entity)
|
|
167
|
+
- ["entityAttributes" (entity)](#entityattributes-entity)
|
|
167
168
|
- ["entitySwingArm" (entity)](#entityswingarm-entity)
|
|
168
169
|
- ["entityHurt" (entity)](#entityhurt-entity)
|
|
169
170
|
- ["entityDead" (entity)](#entitydead-entity)
|
|
@@ -237,6 +238,7 @@
|
|
|
237
238
|
- [bot.waitForChunksToLoad(cb)](#botwaitforchunkstoloadcb)
|
|
238
239
|
- [bot.blockInSight(maxSteps, vectorLength)](#botblockinsightmaxsteps-vectorlength)
|
|
239
240
|
- [bot.blockAtCursor(maxDistance=256)](#botblockatcursormaxdistance256)
|
|
241
|
+
- [bot.blockAtEntityCursor(entity=bot.entity, maxDistance=256)](#botblockatentitycursorentitybotentity-maxdistance256)
|
|
240
242
|
- [bot.canSeeBlock(block)](#botcanseeblockblock)
|
|
241
243
|
- [bot.findBlocks(options)](#botfindblocksoptions)
|
|
242
244
|
- [bot.findBlock(options)](#botfindblockoptions)
|
|
@@ -245,7 +247,7 @@
|
|
|
245
247
|
- [bot.recipesAll(itemType, metadata, craftingTable)](#botrecipesallitemtype-metadata-craftingtable)
|
|
246
248
|
- [bot.nearestEntity(match = (entity) => { return true })](#botnearestentitymatch--entity---return-true-)
|
|
247
249
|
- [Methods](#methods)
|
|
248
|
-
- [bot.end()](#
|
|
250
|
+
- [bot.end(reason)](#botendreason)
|
|
249
251
|
- [bot.quit(reason)](#botquitreason)
|
|
250
252
|
- [bot.tabComplete(str, cb, [assumeCommand], [sendBlockInSight])](#bottabcompletestr-cb-assumecommand-sendblockinsight)
|
|
251
253
|
- [bot.chat(message)](#botchatmessage)
|
|
@@ -264,9 +266,8 @@
|
|
|
264
266
|
- [bot.wake([cb])](#botwakecb)
|
|
265
267
|
- [bot.setControlState(control, state)](#botsetcontrolstatecontrol-state)
|
|
266
268
|
- [bot.getControlState(control)](#botgetcontrolstatecontrol)
|
|
267
|
-
- [bot.getControlState(control)](#botgetcontrolstatecontrol-state)
|
|
268
|
-
- [bot.getExplosionDamages(entity, position, radius, [rawDamages])](#botgetexplosiondamages)
|
|
269
269
|
- [bot.clearControlStates()](#botclearcontrolstates)
|
|
270
|
+
- [bot.getExplosionDamages(entity, position, radius, [rawDamages])](#botgetexplosiondamagesentity-position-radius-rawdamages)
|
|
270
271
|
- [bot.lookAt(point, [force], [callback])](#botlookatpoint-force-callback)
|
|
271
272
|
- [bot.look(yaw, pitch, [force], [callback])](#botlookyaw-pitch-force-callback)
|
|
272
273
|
- [bot.updateSign(block, text)](#botupdatesignblock-text)
|
|
@@ -280,6 +281,7 @@
|
|
|
280
281
|
- [bot.acceptResourcePack()](#botacceptresourcepack)
|
|
281
282
|
- [bot.denyResourcePack()](#botdenyresourcepack)
|
|
282
283
|
- [bot.placeBlock(referenceBlock, faceVector, cb)](#botplaceblockreferenceblock-facevector-cb)
|
|
284
|
+
- [bot.placeEntity(referenceBlock, faceVector)](#botplaceentityreferenceblock-facevector)
|
|
283
285
|
- [bot.activateBlock(block, [callback])](#botactivateblockblock-callback)
|
|
284
286
|
- [bot.activateEntity(entity, [callback])](#botactivateentityentity-callback)
|
|
285
287
|
- [bot.activateEntityAt(entity, position, [callback])](#botactivateentityatentity-position-callback)
|
|
@@ -288,8 +290,8 @@
|
|
|
288
290
|
- [bot.activateItem(offHand=false)](#botactivateitemoffhandfalse)
|
|
289
291
|
- [bot.deactivateItem()](#botdeactivateitem)
|
|
290
292
|
- [bot.useOn(targetEntity)](#botuseontargetentity)
|
|
291
|
-
- [bot.attack(entity)](#botattackentity)
|
|
292
|
-
- [bot.swingArm([hand])](#botswingarmhand)
|
|
293
|
+
- [bot.attack(entity, swing = true)](#botattackentity-swing--true)
|
|
294
|
+
- [bot.swingArm([hand], showHand)](#botswingarmhand-showhand)
|
|
293
295
|
- [bot.mount(entity)](#botmountentity)
|
|
294
296
|
- [bot.dismount()](#botdismount)
|
|
295
297
|
- [bot.moveVehicle(left,forward)](#botmovevehicleleftforward)
|
|
@@ -309,8 +311,8 @@
|
|
|
309
311
|
- [bot.waitForTicks(ticks)](#botwaitforticksticks)
|
|
310
312
|
- [Lower level inventory methods](#lower-level-inventory-methods)
|
|
311
313
|
- [bot.clickWindow(slot, mouseButton, mode, cb)](#botclickwindowslot-mousebutton-mode-cb)
|
|
312
|
-
- [bot.putSelectedItemRange(start, end, window, slot
|
|
313
|
-
- [bot.putAway(slot
|
|
314
|
+
- [bot.putSelectedItemRange(start, end, window, slot)](#botputselecteditemrangestart-end-window-slot)
|
|
315
|
+
- [bot.putAway(slot)](#botputawayslot)
|
|
314
316
|
- [bot.closeWindow(window)](#botclosewindowwindow)
|
|
315
317
|
- [bot.transfer(options, cb)](#bottransferoptions-cb)
|
|
316
318
|
- [bot.openBlock(block)](#botopenblockblock)
|
|
@@ -755,6 +757,7 @@ Create and return an instance of the class bot.
|
|
|
755
757
|
* [difficulty](#bot.settings.difficulty)
|
|
756
758
|
* [skinParts](#bot.settings.skinParts)
|
|
757
759
|
* chatLengthLimit : the maximum amount of characters that can be sent in a single message. If this is not set, it will be 100 in < 1.11 and 256 in >= 1.11.
|
|
760
|
+
* defaultChatPatterns: defaults to true, set to false to not add the patterns such as chat and whisper
|
|
758
761
|
|
|
759
762
|
### Properties
|
|
760
763
|
|
|
@@ -797,6 +800,10 @@ Coordinates to the main spawn point, where all compasses point to.
|
|
|
797
800
|
|
|
798
801
|
The item in the bot's hand, represented as a [prismarine-item](https://github.com/PrismarineJS/prismarine-item) instance specified with arbitrary metadata, nbtdata, etc.
|
|
799
802
|
|
|
803
|
+
#### bot.usingHeldItem
|
|
804
|
+
|
|
805
|
+
Whether the bot is using the item that it's holding, for example eating food or using a shield.
|
|
806
|
+
|
|
800
807
|
#### bot.game.levelType
|
|
801
808
|
|
|
802
809
|
#### bot.game.dimension
|
|
@@ -828,6 +835,8 @@ Bot's player object
|
|
|
828
835
|
}
|
|
829
836
|
```
|
|
830
837
|
|
|
838
|
+
A player's ping starts at 0, you might have to wait a bit for the server to send their actual ping.
|
|
839
|
+
|
|
831
840
|
#### bot.players
|
|
832
841
|
|
|
833
842
|
Map of username to people playing the game.
|
|
@@ -1147,9 +1156,10 @@ is a chat message explaining why you were kicked. `loggedIn`
|
|
|
1147
1156
|
is `true` if the client was kicked after successfully logging in,
|
|
1148
1157
|
or `false` if the kick occurred in the login phase.
|
|
1149
1158
|
|
|
1150
|
-
#### "end"
|
|
1159
|
+
#### "end" (reason)
|
|
1151
1160
|
|
|
1152
1161
|
Emitted when you are no longer connected to the server.
|
|
1162
|
+
`reason` is a string explaining why the client was disconnected. (defaults to 'socketClosed')
|
|
1153
1163
|
|
|
1154
1164
|
#### "error" (err)
|
|
1155
1165
|
|
|
@@ -1441,6 +1451,12 @@ Returns the block at which bot is looking at or `null`
|
|
|
1441
1451
|
Returns the block at which bot is looking at or `null`
|
|
1442
1452
|
* `maxDistance` - The maximum distance the block can be from the eye, defaults to 256.
|
|
1443
1453
|
|
|
1454
|
+
#### bot.blockAtEntityCursor(entity=bot.entity, maxDistance=256)
|
|
1455
|
+
|
|
1456
|
+
Returns the block at which specific entity is looking at or `null`
|
|
1457
|
+
* `entity` - Entity data as `Object`
|
|
1458
|
+
* `maxDistance` - The maximum distance the block can be from the eye, defaults to 256.
|
|
1459
|
+
|
|
1444
1460
|
#### bot.canSeeBlock(block)
|
|
1445
1461
|
|
|
1446
1462
|
Returns true or false depending on whether the bot can see the specified `block`.
|
|
@@ -1489,11 +1505,17 @@ The same as bot.recipesFor except that it does not check wether the bot has enou
|
|
|
1489
1505
|
|
|
1490
1506
|
Return the nearest entity to the bot, matching the function (default to all entities). Return null if no entity is found.
|
|
1491
1507
|
|
|
1508
|
+
Example:
|
|
1509
|
+
```js
|
|
1510
|
+
const cow = bot.nearestEntity(entity => entity.name.toLowerCase() === 'cow') // we use .toLowercase() because in 1.8 cow was capitalized, for newer versions that can be ommitted
|
|
1511
|
+
```
|
|
1512
|
+
|
|
1492
1513
|
### Methods
|
|
1493
1514
|
|
|
1494
|
-
#### bot.end()
|
|
1515
|
+
#### bot.end(reason)
|
|
1495
1516
|
|
|
1496
1517
|
End the connection with the server.
|
|
1518
|
+
* `reason` - Optional string that states the reason of the end.
|
|
1497
1519
|
|
|
1498
1520
|
#### bot.quit(reason)
|
|
1499
1521
|
|
|
@@ -1652,6 +1674,7 @@ Sets all controls to off.
|
|
|
1652
1674
|
#### bot.getExplosionDamages(entity, position, radius, [rawDamages])
|
|
1653
1675
|
|
|
1654
1676
|
Returns how much damage will be done to the entity in a radius around the position of the explosion.
|
|
1677
|
+
It will return `null` if the entity has no armor and rawDamages is not set to true, since the function can't calculate the damage with armor if there is no armor.
|
|
1655
1678
|
|
|
1656
1679
|
* `entity` - Entity instance
|
|
1657
1680
|
* `position` - [Vec3](https://github.com/andrewrk/node-vec3) instance
|
|
@@ -1739,12 +1762,14 @@ dig any other blocks until the block has been broken, or you call
|
|
|
1739
1762
|
`bot.stopDigging()`.
|
|
1740
1763
|
|
|
1741
1764
|
* `block` - the block to start digging into
|
|
1742
|
-
* `forceLook` - (optional) if true, look at the block and start mining instantly. If false, the bot will slowly turn to the block to mine. Additionally, this can be assigned to 'ignore' to prevent the bot from moving it's head at all.
|
|
1765
|
+
* `forceLook` - (optional) if true, look at the block and start mining instantly. If false, the bot will slowly turn to the block to mine. Additionally, this can be assigned to 'ignore' to prevent the bot from moving it's head at all. Also, this can be assigned to 'raycast' to raycast from the bots head to place where the bot is looking.
|
|
1743
1766
|
* `digFace` - (optional) Default is 'auto' looks at the center of the block and mines the top face. Can also be a vec3 vector
|
|
1744
1767
|
of the face the bot should be looking at when digging the block. For example: ```vec3(0, 1, 0)``` when mining the top. Can also be 'raycast' raycast checks if there is a face visible by the bot and mines that face. Useful for servers with anti cheat.
|
|
1745
1768
|
* `callback(err)` - (optional) called when the block is broken or you
|
|
1746
1769
|
are interrupted.
|
|
1747
1770
|
|
|
1771
|
+
If you call bot.dig twice before the first dig is finished, you will get a fatal 'diggingAborted' error.
|
|
1772
|
+
|
|
1748
1773
|
#### bot.stopDigging()
|
|
1749
1774
|
|
|
1750
1775
|
#### bot.digTime(block)
|
|
@@ -1838,10 +1863,13 @@ Deactivates the currently held item. This is how you release an arrow, stop eati
|
|
|
1838
1863
|
Use the currently held item on an `Entity` instance. This is how you apply a saddle and
|
|
1839
1864
|
use shears.
|
|
1840
1865
|
|
|
1841
|
-
#### bot.attack(entity)
|
|
1866
|
+
#### bot.attack(entity, swing = true)
|
|
1842
1867
|
|
|
1843
1868
|
Attack a player or a mob.
|
|
1844
1869
|
|
|
1870
|
+
* `entity` is a type of entity. To get a specific entity use [bot.nearestEntity()](#botnearestentitymatch--entity---return-true-) or [bot.entities](#botentities).
|
|
1871
|
+
* `swing` Default `true`. If false the bot does not swing is arm when attacking.
|
|
1872
|
+
|
|
1845
1873
|
#### bot.swingArm([hand], showHand)
|
|
1846
1874
|
|
|
1847
1875
|
Play an arm swing animation.
|
|
@@ -1963,20 +1991,15 @@ This function also returns a `Promise`, with `void` as its argument upon complet
|
|
|
1963
1991
|
|
|
1964
1992
|
Click on the current window. See details at https://wiki.vg/Protocol#Click_Window
|
|
1965
1993
|
|
|
1966
|
-
#### bot.putSelectedItemRange(start, end, window, slot
|
|
1994
|
+
#### bot.putSelectedItemRange(start, end, window, slot)
|
|
1967
1995
|
|
|
1968
1996
|
This function also returns a `Promise`, with `void` as its argument upon completion.
|
|
1969
1997
|
|
|
1970
1998
|
Put the item at `slot` in the specified range.
|
|
1971
1999
|
|
|
1972
|
-
|
|
1973
|
-
Can be useful in case the client is supposed to simulate without feedback from the server.
|
|
1974
|
-
|
|
1975
|
-
#### bot.putAway(slot, noWaiting)
|
|
2000
|
+
#### bot.putAway(slot)
|
|
1976
2001
|
|
|
1977
2002
|
This function also returns a `Promise`, with `void` as its argument upon completion.
|
|
1978
|
-
`noWaiting` calls putSelectedItemRange with `noWaiting` option: it will not wait for items to be moved.
|
|
1979
|
-
Can be useful in case the client is supposed to simulate without feedback from the server.
|
|
1980
2003
|
|
|
1981
2004
|
Put the item at `slot` in the inventory.
|
|
1982
2005
|
|
package/docs/es/README_ES.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
[](https://gitpod.io/#https://github.com/PrismarineJS/mineflayer)
|
|
10
10
|
|
|
11
|
-
|
|
|
11
|
+
| <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) |
|
|
12
12
|
|-------------------------|----------------------------|----------------------------|----------------------------|----------------------------|
|
|
13
13
|
|
|
14
14
|
Crea bots para Minecraft con una API de JavaScript potente, estable y de alto nivel.
|