Class Inventory
java.lang.Object
net.minecraft.world.entity.player.Inventory
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final int[]final NonNullList<ItemStack>private final List<NonNullList<ItemStack>>static final int[]static final intfinal NonNullList<ItemStack>static final intfinal NonNullList<ItemStack>final Playerstatic final intintprivate static final intstatic final intprivate intFields inherited from interface net.minecraft.world.ContainerDEFAULT_DISTANCE_LIMIT, LARGE_MAX_STACK_SIZE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanbooleanprivate intaddResource(int p_36048_, ItemStack p_36049_) private intaddResource(ItemStack p_36067_) voidintclearOrCountMatchingItems(Predicate<ItemStack> p_36023_, int p_36024_, Container p_36025_) booleanbooleanvoiddropAll()voidfillStackedContents(StackedContents p_36011_) intfindSlotMatchingItem(ItemStack p_36031_) intfindSlotMatchingUnusedItem(ItemStack p_36044_) getArmor(int p_36053_) intfloatgetDestroySpeed(BlockState p_36021_) intgetItem(int p_35991_) getName()static intintgetSlotWithRemainingSpace(ItemStack p_36051_) intintprivate booleanhasRemainingSpaceForItem(ItemStack p_36015_, ItemStack p_36016_) voidhurtArmor(DamageSource p_150073_, float p_150074_, int[] p_150075_) booleanisEmpty()static booleanisHotbarSlot(int p_36046_) voidvoidpickSlot(int p_36039_) voidplaceItemBackInInventory(ItemStack p_150080_) voidplaceItemBackInInventory(ItemStack p_150077_, boolean p_150078_) removeFromSelected(boolean p_182404_) removeItem(int p_35993_, int p_35994_) voidremoveItem(ItemStack p_36058_) removeItemNoUpdate(int p_36029_) voidreplaceWith(Inventory p_36007_) voidvoidvoidsetPickedItem(ItemStack p_36013_) booleanstillValid(Player p_36009_) voidswapPaint(double p_35989_) voidtick()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.ContainercanPlaceItem, canTakeItem, countItem, getMaxStackSize, hasAnyMatching, hasAnyOf, startOpen, stopOpenMethods inherited from interface net.minecraft.world.NameablegetCustomName, getDisplayName, hasCustomName
- 
Field Details- 
POP_TIME_DURATIONpublic static final int POP_TIME_DURATION- See Also:
 
- 
INVENTORY_SIZEpublic static final int INVENTORY_SIZE- See Also:
 
- 
SELECTION_SIZEprivate static final int SELECTION_SIZE- See Also:
 
- 
SLOT_OFFHANDpublic static final int SLOT_OFFHAND- See Also:
 
- 
NOT_FOUND_INDEXpublic static final int NOT_FOUND_INDEX- See Also:
 
- 
ALL_ARMOR_SLOTSpublic static final int[] ALL_ARMOR_SLOTS
- 
HELMET_SLOT_ONLYpublic static final int[] HELMET_SLOT_ONLY
- 
items
- 
armor
- 
offhand
- 
compartments
- 
selectedpublic int selected
- 
player
- 
timesChangedprivate int timesChanged
 
- 
- 
Constructor Details- 
Inventory
 
- 
- 
Method Details- 
getSelected
- 
getSelectionSizepublic static int getSelectionSize()
- 
hasRemainingSpaceForItem
- 
getFreeSlotpublic int getFreeSlot()
- 
setPickedItem
- 
pickSlotpublic void pickSlot(int p_36039_) 
- 
isHotbarSlotpublic static boolean isHotbarSlot(int p_36046_) 
- 
findSlotMatchingItem
- 
findSlotMatchingUnusedItem
- 
getSuitableHotbarSlotpublic int getSuitableHotbarSlot()
- 
swapPaintpublic void swapPaint(double p_35989_) 
- 
clearOrCountMatchingItems
- 
addResource
- 
addResource
- 
getSlotWithRemainingSpace
- 
tickpublic void tick()
- 
add
- 
add
- 
placeItemBackInInventory
- 
placeItemBackInInventory
- 
removeItem- Specified by:
- removeItemin interface- Container
 
- 
removeItem
- 
removeItemNoUpdate- Specified by:
- removeItemNoUpdatein interface- Container
 
- 
setItem
- 
getDestroySpeed
- 
save
- 
load
- 
getContainerSizepublic int getContainerSize()- Specified by:
- getContainerSizein interface- Container
 
- 
isEmptypublic boolean isEmpty()
- 
getItem
- 
getName
- 
getArmor
- 
hurtArmor
- 
dropAllpublic void dropAll()
- 
setChangedpublic void setChanged()- Specified by:
- setChangedin interface- Container
 
- 
getTimesChangedpublic int getTimesChanged()
- 
stillValid- Specified by:
- stillValidin interface- Container
 
- 
contains
- 
contains
- 
replaceWith
- 
clearContentpublic void clearContent()- Specified by:
- clearContentin interface- Clearable
 
- 
fillStackedContents
- 
removeFromSelected
 
-