We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a04e459 commit 53b149dCopy full SHA for 53b149d
1 file changed
src/main/java/org/mcmonkey/sentinel/SentinelItemHelper.java
@@ -176,12 +176,14 @@ public boolean swapToShield() {
176
break;
177
}
178
179
- // Index 40 is offhand.
+ // Index 40 is offhand on some versions, but it later changed to be a non-inventory magic slot.
180
if (index != -1 && index != 40) {
181
ItemStack oldItem = SentinelUtilities.getOffhandItem(sentinel.getLivingEntity()).clone();
182
ItemStack newItem = items[index].clone();
183
items[index] = oldItem;
184
- items[40] = newItem;
+ if (items.length >= 40) {
185
+ items[40] = newItem;
186
+ }
187
inv.setContents(items);
188
sentinel.getLivingEntity().getEquipment().setItemInOffHand(newItem);
189
return true;
0 commit comments