get Item
Retrieves the item in the specified slot of the virtual inventory. If the slot index is out of bounds (not between 0 and size-1), this method will return null. Otherwise, it returns a clone of the ItemStack at the specified slot, allowing callers to safely modify the returned ItemStack without affecting the inventory's internal state. If the slot is empty (null), this method will also return null.
Parameters
slot
The index of the slot to retrieve, which should be between 0 and size-1. If the slot index is out of bounds, the method will return null.