File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 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' {
3535 width : number ;
3636 onGround : boolean ;
3737 equipment : Array < Item > ;
38- heldItem : Item ;
38+ get heldItem ( ) : Item ;
3939 metadata : Array < object > ;
4040 isValid : boolean ;
4141 health ?: number ;
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ module.exports = (registryOrVersion) => {
1919 this . effects = { }
2020 // 0 = held item, 1-4 = armor slot
2121 this . equipment = new Array ( 5 )
22- this . heldItem = this . equipment [ 0 ] // shortcut to equipment[0]
2322 this . isValid = true
2423 this . metadata = [ ]
2524 }
@@ -44,9 +43,12 @@ module.exports = (registryOrVersion) => {
4443 this . displayName = name
4544 }
4645
46+ get heldItem ( ) {
47+ return this . equipment [ 0 ]
48+ }
49+
4750 setEquipment ( index , item ) {
4851 this . equipment [ index ] = item
49- this . heldItem = this . equipment [ 0 ]
5052 }
5153
5254 getCustomName ( ) {
You can’t perform that action at this time.
0 commit comments