mineflayer
Advanced tools
@@ -59,3 +59,4 @@ name: CI | ||
| run: npm install | ||
| - name: Start Tests | ||
| run: npm run mocha_test -- -g ${{ matrix.mcVersion }}v |
+5
-0
@@ -0,1 +1,6 @@ | ||
| ## 4.35.0 | ||
| * [🎈 1.21.11 (#3781)](https://github.com/PrismarineJS/mineflayer/commit/597745c7c061943620fcacba7254bccee05b7a3e) (thanks @rom1504bot) | ||
| * [Fix chat pattern and event listener in tutorial (#3783)](https://github.com/PrismarineJS/mineflayer/commit/48586138f560991de60bea639c71fa82954cf50f) (thanks @brentspine) | ||
| * [Update history.md](https://github.com/PrismarineJS/mineflayer/commit/c9f766513d5bb5a93c5b86c07827128716c0afdb) (thanks @extremeheat) | ||
| ## 4.34.0 | ||
@@ -2,0 +7,0 @@ * [🎈 1.21.9/1.21.10 support (#3754)](https://github.com/PrismarineJS/mineflayer/commit/f0afaf73061c15b67e5d3457b60ed543e711acb6) (thanks @rom1504bot) |
+1
-1
@@ -20,3 +20,3 @@ # Mineflayer | ||
| * Supports Minecraft 1.8 to 1.21.9 (1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.21, 1.21.9) <!--version--> | ||
| * Supports Minecraft 1.8 to 1.21.11 (1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.21, 1.21.9, 1.21.11) <!--version--> | ||
| * Entity knowledge and tracking. | ||
@@ -23,0 +23,0 @@ * Block knowledge. You can query the world around you. Milliseconds to find any block. |
+2
-2
@@ -579,4 +579,4 @@ # Tutorial | ||
| bot.addChatPattern( | ||
| 'hello', | ||
| /(helo|hello|Hello)/, | ||
| 'hello', | ||
| 'Someone says hello' | ||
@@ -589,3 +589,3 @@ ) | ||
| bot.on('hello', hi) | ||
| bot.on('chat:hello', hi) | ||
| ``` | ||
@@ -592,0 +592,0 @@ |
@@ -73,3 +73,3 @@ const { Vec3 } = require('vec3') | ||
| // This makes sure that the bot's real position has been already sent | ||
| if (!bot.entity.height) await onceWithCleanup(bot, 'chunkColumnLoad') | ||
| if (!bot.entity.height) await onceWithCleanup(bot, 'chunkColumnLoad', { timeout: 10000 }) | ||
| const pos = bot.entity.position | ||
@@ -88,6 +88,12 @@ const center = new Vec3(pos.x >> 4 << 4, 0, pos.z >> 4 << 4) | ||
| if (chunkPosToCheck.size) { | ||
| return new Promise((resolve) => { | ||
| return new Promise((resolve, reject) => { | ||
| const timeout = setTimeout(() => { | ||
| bot.world.off('chunkColumnLoad', waitForLoadEvents) | ||
| reject(new Error(`Timeout waiting for ${chunkPosToCheck.size} chunks to load after 10000ms`)) | ||
| }, 10000) | ||
| function waitForLoadEvents (columnCorner) { | ||
| chunkPosToCheck.delete(columnCorner.toString()) | ||
| if (chunkPosToCheck.size === 0) { // no chunks left to find | ||
| clearTimeout(timeout) | ||
| bot.world.off('chunkColumnLoad', waitForLoadEvents) // remove this listener instance | ||
@@ -94,0 +100,0 @@ resolve() |
@@ -209,6 +209,13 @@ const { onceWithCleanup } = require('../promise_utils') | ||
| function awaitMessage (...args) { | ||
| const timeout = typeof args[args.length - 1] === 'number' ? args.pop() : 20000 | ||
| return new Promise((resolve, reject) => { | ||
| const resolveMessages = args.flatMap(x => x) | ||
| const timeoutHandle = setTimeout(() => { | ||
| bot.off('messagestr', messageListener) | ||
| reject(new Error(`Timeout waiting for message after ${timeout}ms`)) | ||
| }, timeout) | ||
| function messageListener (msg) { | ||
| if (resolveMessages.some(x => x instanceof RegExp ? x.test(msg) : msg === x)) { | ||
| clearTimeout(timeoutHandle) | ||
| resolve(msg) | ||
@@ -215,0 +222,0 @@ bot.off('messagestr', messageListener) |
@@ -430,6 +430,13 @@ const { Vec3 } = require('vec3') | ||
| if (ticks <= 0) return | ||
| await new Promise(resolve => { | ||
| await new Promise((resolve, reject) => { | ||
| // Assuming 20 ticks per second, add extra time for lag | ||
| const timeout = setTimeout(() => { | ||
| bot.removeListener('physicsTick', tickListener) | ||
| reject(new Error(`Timeout waiting for ${ticks} ticks after ${(ticks * 50 + 5000)}ms`)) | ||
| }, ticks * 50 + 5000) // 50ms per tick + 5s buffer | ||
| const tickListener = () => { | ||
| ticks-- | ||
| if (ticks === 0) { | ||
| clearTimeout(timeout) | ||
| bot.removeListener('physicsTick', tickListener) | ||
@@ -436,0 +443,0 @@ resolve() |
+1
-1
@@ -1,2 +0,2 @@ | ||
| const testedVersions = ['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', '1.17.1', '1.18.2', '1.19', '1.19.2', '1.19.3', '1.19.4', '1.20.1', '1.20.2', '1.20.4', '1.20.6', '1.21.1', '1.21.3', '1.21.4', '1.21.5', '1.21.6', '1.21.8', '1.21.9'] | ||
| const testedVersions = ['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', '1.17.1', '1.18.2', '1.19', '1.19.2', '1.19.3', '1.19.4', '1.20.1', '1.20.2', '1.20.4', '1.20.6', '1.21.1', '1.21.3', '1.21.4', '1.21.5', '1.21.6', '1.21.8', '1.21.9', '1.21.11'] | ||
| module.exports = { | ||
@@ -3,0 +3,0 @@ |
+2
-2
| { | ||
| "name": "mineflayer", | ||
| "version": "4.34.0", | ||
| "version": "4.35.0", | ||
| "description": "create minecraft bots with a stable, high level API", | ||
@@ -25,3 +25,3 @@ "main": "index.js", | ||
| "minecraft-data": "^3.98.0", | ||
| "minecraft-protocol": "^1.63.0", | ||
| "minecraft-protocol": "^1.64.0", | ||
| "prismarine-biome": "^1.1.1", | ||
@@ -28,0 +28,0 @@ "prismarine-block": "^1.22.0", |
+1
-1
@@ -20,3 +20,3 @@ # Mineflayer | ||
| * Supports Minecraft 1.8 to 1.21.9 (1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.21, 1.21.9) <!--version--> | ||
| * Supports Minecraft 1.8 to 1.21.11 (1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.21, 1.21.9, 1.21.11) <!--version--> | ||
| * Entity knowledge and tracking. | ||
@@ -23,0 +23,0 @@ * Block knowledge. You can query the world around you. Milliseconds to find any block. |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
1246115
0.12%10322
0.17%Updated