diff --git a/src/pocketmine/inventory/transaction/InventoryTransaction.php b/src/pocketmine/inventory/transaction/InventoryTransaction.php index 91103f20ed0..21885bdcbc4 100644 --- a/src/pocketmine/inventory/transaction/InventoryTransaction.php +++ b/src/pocketmine/inventory/transaction/InventoryTransaction.php @@ -173,6 +173,9 @@ protected function squashDuplicateSlotChanges() : void{ $inventory = $inventories[$hash]; $slot = $slots[$hash]; + if(!$inventory->slotExists($slot)){ //this can get hit for crafting tables because the validation happens after this compaction + throw new TransactionValidationException("Slot $slot does not exist in inventory " . get_class($inventory)); + } $sourceItem = $inventory->getItem($slot); $targetItem = $this->findResultItem($sourceItem, $list);