File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ declare module 'prismarine-entity' {
35
35
width : number ;
36
36
onGround : boolean ;
37
37
equipment : Array < Item > ;
38
- heldItem : Item ;
38
+ get heldItem ( ) : Item ;
39
39
metadata : Array < object > ;
40
40
isValid : boolean ;
41
41
health ?: number ;
Original file line number Diff line number Diff line change @@ -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 ( ) {
You can’t perform that action at this time.
0 commit comments