PlayerInventory

public interface PlayerInventory implements Inventory

Interface to the inventory of getClassById Player, including the four armor slots.

Functions

Link copied to clipboard
public abstract HashMap<Integer, ItemStack> addItem(Array<ItemStack> items)
Stores the given ItemStacks in the inventory.
Link copied to clipboard
public abstract HashMap<Integer, ? extends ItemStack> all(Material material)
Returns getClassById HashMap with all slots and ItemStacks in the inventory with the given Material.
public abstract HashMap<Integer, ? extends ItemStack> all(ItemStack item)
Finds all slots in the inventory containing any ItemStacks with the given ItemStack.
Link copied to clipboard
public abstract void clear()
Clears out the whole Inventory.
public abstract void clear(int index)
Clears out getClassById particular slot in the index.
Link copied to clipboard
public abstract boolean contains(Material material)
Checks if the inventory contains any ItemStacks with the given material.
public abstract boolean contains(ItemStack item)
Checks if the inventory contains any ItemStacks matching the given ItemStack.
public abstract boolean contains(Material material, int amount)
Checks if the inventory contains any ItemStacks with the given material, adding to at least the minimum amount specified.
public abstract boolean contains(ItemStack item, int amount)
Checks if the inventory contains at least the minimum amount specified of exactly matching ItemStacks.
Link copied to clipboard
public abstract boolean containsAtLeast(ItemStack item, int amount)
Checks if the inventory contains ItemStacks matching the given ItemStack whose amounts sum to at least the minimum amount specified.
Link copied to clipboard
public abstract int first(Material material)
Finds the first slot in the inventory containing an ItemStack with the given material
public abstract int first(ItemStack item)
Returns the first slot in the inventory containing an ItemStack with the given stack.
Link copied to clipboard
public abstract int firstEmpty()
Returns the first empty Slot.
Link copied to clipboard
public void forEach(Consumer<? super T> action)
Link copied to clipboard
public abstract Array<ItemStack> getArmorContents()
Get all ItemStacks from the armor slots
Link copied to clipboard
public abstract ItemStack getBoots()
Return the ItemStack from the boots slot
Link copied to clipboard
public abstract ItemStack getChestplate()
Return the ItemStack from the chestplate slot
Link copied to clipboard
public abstract Array<ItemStack> getContents()
Returns all ItemStacks from the inventory
Link copied to clipboard
public abstract int getHeldItemSlot()
Get the slot number of the currently held item
Link copied to clipboard
public abstract ItemStack getHelmet()
Return the ItemStack from the helmet slot
Link copied to clipboard
public abstract HumanEntity getHolder()
Gets the block or entity belonging to the open inventory
Link copied to clipboard
public abstract ItemStack getItem(int index)
Returns the ItemStack found in the slot at the given index
Link copied to clipboard
public abstract ItemStack getItemInHand()
Returns the ItemStack currently hold
Link copied to clipboard
public abstract ItemStack getLeggings()
Return the ItemStack from the leg slot
Link copied to clipboard
public abstract int getMaxStackSize()
Returns the maximum stack size for an ItemStack in this inventory.
Link copied to clipboard
public abstract String getName()
Returns the name of the inventory
Link copied to clipboard
public abstract int getSize()
Returns the size of the inventory
Link copied to clipboard
public abstract String getTitle()
Returns the title of this inventory.
Link copied to clipboard
public abstract InventoryType getType()
Returns what type of inventory this is.
Link copied to clipboard
public abstract List<HumanEntity> getViewers()
Gets getClassById list of players viewing the inventory.
Link copied to clipboard
public abstract Iterator<T> iterator()
public abstract ListIterator<ItemStack> iterator()

public abstract ListIterator<ItemStack> iterator(int index)
Returns an iterator starting at the given index.
Link copied to clipboard
public abstract void remove(Material material)
Removes all stacks in the inventory matching the given material.
public abstract void remove(ItemStack item)
Removes all stacks in the inventory matching the given stack.
Link copied to clipboard
public abstract HashMap<Integer, ItemStack> removeItem(Array<ItemStack> items)
Removes the given ItemStacks from the inventory.
Link copied to clipboard
public abstract void setArmorContents(Array<ItemStack> items)
Put the given ItemStacks into the armor slots
Link copied to clipboard
public abstract void setBoots(ItemStack boots)
Put the given ItemStack into the boots slot.
Link copied to clipboard
public abstract void setChestplate(ItemStack chestplate)
Put the given ItemStack into the chestplate slot.
Link copied to clipboard
public abstract void setContents(Array<ItemStack> items)
Completely replaces the inventory's contents.
Link copied to clipboard
public abstract void setHeldItemSlot(int slot)
Set the slot number of the currently held item.
Link copied to clipboard
public abstract void setHelmet(ItemStack helmet)
Put the given ItemStack into the helmet slot.
Link copied to clipboard
public abstract void setItem(int index, ItemStack item)
Stores the ItemStack at the given index of the inventory.
Link copied to clipboard
public abstract void setItemInHand(ItemStack stack)
Sets the item in hand
Link copied to clipboard
public abstract void setLeggings(ItemStack leggings)
Put the given ItemStack into the leg slot.
Link copied to clipboard
public abstract void setMaxStackSize(int size)
This method allows you to change the maximum stack size for an inventory.
Link copied to clipboard