40 lines
1.3 KiB
Diff
40 lines
1.3 KiB
Diff
diff --git a/node_modules/prismarine-entity/index.d.ts b/node_modules/prismarine-entity/index.d.ts
|
|
index b5ca0ad..1ee66c4 100644
|
|
--- a/node_modules/prismarine-entity/index.d.ts
|
|
+++ b/node_modules/prismarine-entity/index.d.ts
|
|
@@ -35,7 +35,7 @@ declare module 'prismarine-entity' {
|
|
width: number;
|
|
onGround: boolean;
|
|
equipment: Array<Item>;
|
|
- heldItem: Item;
|
|
+ get heldItem(): Item;
|
|
metadata: Array<object>;
|
|
isValid: boolean;
|
|
health?: number;
|
|
diff --git a/node_modules/prismarine-entity/index.js b/node_modules/prismarine-entity/index.js
|
|
index bbbbbd4..bc36b6b 100644
|
|
--- a/node_modules/prismarine-entity/index.js
|
|
+++ b/node_modules/prismarine-entity/index.js
|
|
@@ -19,7 +19,6 @@ module.exports = (registryOrVersion) => {
|
|
this.effects = {}
|
|
// 0 = held item, 1-4 = armor slot
|
|
this.equipment = new Array(5)
|
|
- this.heldItem = this.equipment[0] // shortcut to equipment[0]
|
|
this.isValid = true
|
|
this.metadata = []
|
|
}
|
|
@@ -44,9 +43,12 @@ module.exports = (registryOrVersion) => {
|
|
this.displayName = name
|
|
}
|
|
|
|
+ get heldItem() {
|
|
+ return this.equipment[0]
|
|
+ }
|
|
+
|
|
setEquipment (index, item) {
|
|
this.equipment[index] = item
|
|
- this.heldItem = this.equipment[0]
|
|
}
|
|
|
|
getCustomName () {
|