From e96b7b4610441603bc29e118a36c539903e96d78 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Wed, 19 Jan 2022 07:40:53 +0800 Subject: fix --- features/events/index.js | 2 +- utils/utils.js | 2 +- 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]; -- cgit