Class Inventory

java.lang.Object
net.minecraft.world.entity.player.Inventory
All Implemented Interfaces:
Clearable, Container, Nameable

public class Inventory extends Object implements Container, Nameable
  • Field Details

  • Constructor Details

    • Inventory

      public Inventory(Player p_35983_)
  • Method Details

    • getSelected

      public ItemStack getSelected()
    • getSelectionSize

      public static int getSelectionSize()
    • hasRemainingSpaceForItem

      private boolean hasRemainingSpaceForItem(ItemStack p_36015_, ItemStack p_36016_)
    • getFreeSlot

      public int getFreeSlot()
    • setPickedItem

      public void setPickedItem(ItemStack p_36013_)
    • pickSlot

      public void pickSlot(int p_36039_)
    • isHotbarSlot

      public static boolean isHotbarSlot(int p_36046_)
    • findSlotMatchingItem

      public int findSlotMatchingItem(ItemStack p_36031_)
    • findSlotMatchingUnusedItem

      public int findSlotMatchingUnusedItem(ItemStack p_36044_)
    • getSuitableHotbarSlot

      public int getSuitableHotbarSlot()
    • swapPaint

      public void swapPaint(double p_35989_)
    • clearOrCountMatchingItems

      public int clearOrCountMatchingItems(Predicate<ItemStack> p_36023_, int p_36024_, Container p_36025_)
    • addResource

      private int addResource(ItemStack p_36067_)
    • addResource

      private int addResource(int p_36048_, ItemStack p_36049_)
    • getSlotWithRemainingSpace

      public int getSlotWithRemainingSpace(ItemStack p_36051_)
    • tick

      public void tick()
    • add

      public boolean add(ItemStack p_36055_)
    • add

      public boolean add(int p_36041_, ItemStack p_36042_)
    • placeItemBackInInventory

      public void placeItemBackInInventory(ItemStack p_150080_)
    • placeItemBackInInventory

      public void placeItemBackInInventory(ItemStack p_150077_, boolean p_150078_)
    • removeItem

      public ItemStack removeItem(int p_35993_, int p_35994_)
      Specified by:
      removeItem in interface Container
    • removeItem

      public void removeItem(ItemStack p_36058_)
    • removeItemNoUpdate

      public ItemStack removeItemNoUpdate(int p_36029_)
      Specified by:
      removeItemNoUpdate in interface Container
    • setItem

      public void setItem(int p_35999_, ItemStack p_36000_)
      Specified by:
      setItem in interface Container
    • getDestroySpeed

      public float getDestroySpeed(BlockState p_36021_)
    • save

      public ListTag save(ListTag p_36027_)
    • load

      public void load(ListTag p_36036_)
    • getContainerSize

      public int getContainerSize()
      Specified by:
      getContainerSize in interface Container
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Container
    • getItem

      public ItemStack getItem(int p_35991_)
      Specified by:
      getItem in interface Container
    • getName

      public Component getName()
      Specified by:
      getName in interface Nameable
    • getArmor

      public ItemStack getArmor(int p_36053_)
    • hurtArmor

      public void hurtArmor(DamageSource p_150073_, float p_150074_, int[] p_150075_)
    • dropAll

      public void dropAll()
    • setChanged

      public void setChanged()
      Specified by:
      setChanged in interface Container
    • getTimesChanged

      public int getTimesChanged()
    • stillValid

      public boolean stillValid(Player p_36009_)
      Specified by:
      stillValid in interface Container
    • contains

      public boolean contains(ItemStack p_36064_)
    • contains

      public boolean contains(TagKey<Item> p_204076_)
    • replaceWith

      public void replaceWith(Inventory p_36007_)
    • clearContent

      public void clearContent()
      Specified by:
      clearContent in interface Clearable
    • fillStackedContents

      public void fillStackedContents(StackedContents p_36011_)
    • removeFromSelected

      public ItemStack removeFromSelected(boolean p_182404_)