Skip to content

Commit b8eef44

Browse files
Merge pull request #14 from PrismarineJS/master
sync to upstream
2 parents d459d2e + cab65b1 commit b8eef44

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ higher level API on top of Mineflayer.
205205

206206
The most updated and useful are :
207207

208+
* [minecraft-mcp-server](https://github.com/yuniko-software/minecraft-mcp-server) A MCP server for mineflayer, allowing using mineflayer from an LLM
208209
* [pathfinder](https://github.com/Karang/mineflayer-pathfinder) - advanced A* pathfinding with a lot of configurable features
209210
* [prismarine-viewer](https://github.com/PrismarineJS/prismarine-viewer) - simple web chunk viewer
210211
* [web-inventory](https://github.com/ImHarvol/mineflayer-web-inventory) - web based inventory viewer

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export interface BotEvents {
8282
health: () => Promise<void> | void
8383
breath: () => Promise<void> | void
8484
entitySwingArm: (entity: Entity) => Promise<void> | void
85-
entityHurt: (entity: Entity) => Promise<void> | void
85+
entityHurt: (entity: Entity, source: Entity) => Promise<void> | void
8686
entityDead: (entity: Entity) => Promise<void> | void
8787
entityTaming: (entity: Entity) => Promise<void> | void
8888
entityTamed: (entity: Entity) => Promise<void> | void

lib/plugins/entities.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,8 @@ function inject (bot) {
397397

398398
bot._client.on('damage_event', (packet) => { // 1.20+
399399
const entity = bot.entities[packet.entityId]
400-
bot.emit('entityHurt', entity)
400+
const source = bot.entities[packet.sourceCauseId - 1] // damage_event : SourceCauseId : The ID + 1 of the entity responsible for the damage, if present. If not present, the value is 0
401+
bot.emit('entityHurt', entity, source)
401402
})
402403

403404
bot._client.on('attach_entity', (packet) => {

0 commit comments

Comments
 (0)