prismarine-entity 2.3.1 → 2.4.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/README.md +3 -0
- package/index.d.ts +1 -1
- package/index.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -144,6 +144,9 @@ returns a `prismarine-item` Item object for the dropped item, if this is a dropp
|
|
|
144
144
|
|
|
145
145
|
## History
|
|
146
146
|
|
|
147
|
+
### 2.4.0
|
|
148
|
+
* [use getter for `.heldItem` (#73)](https://github.com/PrismarineJS/prismarine-entity/commit/4694438ab733ea3e2d5414d3330ae295ff85b660) (thanks @szdytom)
|
|
149
|
+
|
|
147
150
|
### 2.3.1
|
|
148
151
|
* [Use console.trace instead of console.log for deprecation message (#71)](https://github.com/PrismarineJS/prismarine-entity/commit/7262fcf02d6656c663f876d513d84cc7266a3903) (thanks @extremeheat)
|
|
149
152
|
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -19,7 +19,6 @@ module.exports = (registryOrVersion) => {
|
|
|
19
19
|
this.effects = {}
|
|
20
20
|
// 0 = held item, 1-4 = armor slot
|
|
21
21
|
this.equipment = new Array(5)
|
|
22
|
-
this.heldItem = this.equipment[0] // shortcut to equipment[0]
|
|
23
22
|
this.isValid = true
|
|
24
23
|
this.metadata = []
|
|
25
24
|
}
|
|
@@ -44,9 +43,12 @@ module.exports = (registryOrVersion) => {
|
|
|
44
43
|
this.displayName = name
|
|
45
44
|
}
|
|
46
45
|
|
|
46
|
+
get heldItem () {
|
|
47
|
+
return this.equipment[0]
|
|
48
|
+
}
|
|
49
|
+
|
|
47
50
|
setEquipment (index, item) {
|
|
48
51
|
this.equipment[index] = item
|
|
49
|
-
this.heldItem = this.equipment[0]
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
getCustomName () {
|