@nxg-org/mineflayer-util-plugin 1.2.1 → 1.2.5

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.
@@ -75,9 +75,10 @@ class EntityFunctions {
75
75
  * @returns
76
76
  */
77
77
  getHealthChange(packetMetadata, entity) {
78
+ console.log("test");
78
79
  const oldMetadata = entity.metadata;
79
- const newMetadata = this.parseMetadata(packetMetadata, oldMetadata);
80
- return this.getHealthFromMetadata(newMetadata) - this.getHealthFromMetadata(oldMetadata);
80
+ const newMetadata = this.parseMetadata(packetMetadata, JSON.parse(JSON.stringify(oldMetadata)));
81
+ return -(this.getHealthFromMetadata(oldMetadata) - this.getHealthFromMetadata(newMetadata));
81
82
  }
82
83
  getDistanceToEntity(entity) {
83
84
  return this.getDistanceBetweenEntities(this.bot.entity, entity);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxg-org/mineflayer-util-plugin",
3
- "version": "1.2.1",
3
+ "version": "1.2.5",
4
4
  "description": "mineflayer utils for NextGEN mineflayer plugins.",
5
5
  "keywords": [
6
6
  "mineflayer",
@@ -19,7 +19,6 @@
19
19
  "prepublish": "npm run build"
20
20
  },
21
21
  "dependencies": {
22
- "@nxg-org/mineflayer-util-plugin": "^1.0.1",
23
22
  "minecraft-data": "^2.97.0",
24
23
  "mineflayer": "^3.11.2",
25
24
  "mineflayer-pathfinder": "^1.8.0",