Effective Inventory Utils
Inventory helpers. Item matching uses EffectiveItem.equalByNamespacedKeyIfExistElseByMaterial, so custom items match by their key and vanilla items by material.
Types
Outcome of giveItem: fully added, or overflow dropped on the ground.
Outcome of removeItems: all removed, or not enough were present (nothing removed).
Functions
Which hand holds item (EquipmentSlot.HAND/EquipmentSlot.OFF_HAND), or null if neither.
Given that one hand holds item, returns the item in the other hand, or null if neither matches.
The main-hand item if not empty, otherwise the off-hand item.
Whether the inventory's storage slots are all occupied (ignores armor/offhand for player inventories).
Removes count of item from inventory; if fewer are present, removes nothing and returns RemoveResult.NOT_ENOUGH.