aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--features/events/index.js2
-rw-r--r--utils/utils.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/features/events/index.js b/features/events/index.js
index 67add66..48b43ec 100644
--- a/features/events/index.js
+++ b/features/events/index.js
@@ -126,10 +126,10 @@ class Events extends Feature {
}
step(){
+ if(!Player.getInventory()) return
hasDianaShovle = false
let slots = [0, 1, 2, 3, 4, 5, 6, 7, 8]
-
slots.forEach(a=>{
item = Player.getInventory().getStackInSlot(a)
if(!item) return
diff --git a/utils/utils.js b/utils/utils.js
index bbef8ce..33aa83c 100644
--- a/utils/utils.js
+++ b/utils/utils.js
@@ -30,7 +30,7 @@ let utils = {
.func_74782_a("Lore", list);
},
getSBID: function(item){
- return item.getNBT()?.getCompoundTag("tag")?.getCompoundTag("ExtraAttributes")?.getString("id") || null
+ return item?.getNBT()?.getCompoundTag("tag")?.getCompoundTag("ExtraAttributes")?.getString("id") || null
},
calculateDistance: function(p1, p2) {
var a = p2[0] - p1[0];