Package net.minecraft.entity.player
Class PlayerInventory
java.lang.Object
net.minecraft.entity.player.PlayerInventory
public class PlayerInventory extends Object implements Inventory, Nameable
- Mappings:
Namespace Name official bhk
intermediary net/minecraft/class_1661
named net/minecraft/entity/player/PlayerInventory
-
Field Summary
Fields Modifier and Type Field Description DefaultedList<ItemStack>
armor
private int
changeCount
private List<DefaultedList<ItemStack>>
combinedInventory
private ItemStack
cursorStack
DefaultedList<ItemStack>
main
DefaultedList<ItemStack>
offHand
PlayerEntity
player
int
selectedSlot
-
Constructor Summary
Constructors Constructor Description PlayerInventory(PlayerEntity player)
-
Method Summary
Modifier and Type Method Description void
addPickBlock(ItemStack stack)
private int
addStack(int slot, ItemStack stack)
private int
addStack(ItemStack stack)
boolean
canPlayerUse(PlayerEntity player)
private boolean
canStackAddMore(ItemStack existingStack, ItemStack stack)
void
clear()
void
clone(PlayerInventory other)
boolean
contains(ItemStack stack)
boolean
contains(Tag<Item> tag)
void
damageArmor(DamageSource damageSource, float float2)
void
deserialize(ListTag tag)
void
dropAll()
ItemStack
getArmorStack(int slot)
float
getBlockBreakingSpeed(BlockState block)
int
getChangeCount()
ItemStack
getCursorStack()
int
getEmptySlot()
static int
getHotbarSize()
ItemStack
getMainHandStack()
Text
getName()
int
getOccupiedSlotWithRoomForStack(ItemStack stack)
int
getSlotWithStack(ItemStack stack)
ItemStack
getStack(int slot)
Fetches the stack currently stored at the given slot.int
getSwappableHotbarSlot()
int
indexOf(ItemStack stack)
boolean
insertStack(int slot, ItemStack stack)
boolean
insertStack(ItemStack stack)
boolean
isEmpty()
static boolean
isValidHotbarIndex(int slot)
void
markDirty()
void
method_32338(ItemStack itemStack, boolean bool)
void
offerOrDrop(ItemStack stack)
void
populateRecipeFinder(RecipeFinder finder)
int
remove(Predicate<ItemStack> shouldRemove, int maxCount, Inventory craftingInventory)
void
removeOne(ItemStack stack)
ItemStack
removeStack(int slot)
Removes the stack currently stored at the indicated slot.ItemStack
removeStack(int slot, int amount)
Removes a specific number of items from the given slot.void
scrollInHotbar(double scrollAmount)
ListTag
serialize(ListTag tag)
void
setCursorStack(ItemStack stack)
void
setStack(int slot, ItemStack stack)
int
size()
void
swapSlotWithHotbar(int slot)
void
updateItems()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.inventory.Inventory
containsAny, count, getMaxCountPerStack, isValid, onClose, onOpen
Methods inherited from interface net.minecraft.util.Nameable
getCustomName, getDisplayName, hasCustomName
-
Field Details
-
main
- Mappings:
Namespace Name Mixin selector official a
Lbhk;a:Lgj;
intermediary field_7547
Lnet/minecraft/class_1661;field_7547:Lnet/minecraft/class_2371;
named main
Lnet/minecraft/entity/player/PlayerInventory;main:Lnet/minecraft/util/collection/DefaultedList;
-
armor
- Mappings:
Namespace Name Mixin selector official b
Lbhk;b:Lgj;
intermediary field_7548
Lnet/minecraft/class_1661;field_7548:Lnet/minecraft/class_2371;
named armor
Lnet/minecraft/entity/player/PlayerInventory;armor:Lnet/minecraft/util/collection/DefaultedList;
-
offHand
- Mappings:
Namespace Name Mixin selector official c
Lbhk;c:Lgj;
intermediary field_7544
Lnet/minecraft/class_1661;field_7544:Lnet/minecraft/class_2371;
named offHand
Lnet/minecraft/entity/player/PlayerInventory;offHand:Lnet/minecraft/util/collection/DefaultedList;
-
combinedInventory
- Mappings:
Namespace Name Mixin selector official f
Lbhk;f:Ljava/util/List;
intermediary field_7543
Lnet/minecraft/class_1661;field_7543:Ljava/util/List;
named combinedInventory
Lnet/minecraft/entity/player/PlayerInventory;combinedInventory:Ljava/util/List;
-
selectedSlot
public int selectedSlot- Mappings:
Namespace Name Mixin selector official d
Lbhk;d:I
intermediary field_7545
Lnet/minecraft/class_1661;field_7545:I
named selectedSlot
Lnet/minecraft/entity/player/PlayerInventory;selectedSlot:I
-
player
- Mappings:
Namespace Name Mixin selector official e
Lbhk;e:Lbhl;
intermediary field_7546
Lnet/minecraft/class_1661;field_7546:Lnet/minecraft/class_1657;
named player
Lnet/minecraft/entity/player/PlayerInventory;player:Lnet/minecraft/entity/player/PlayerEntity;
-
cursorStack
- Mappings:
Namespace Name Mixin selector official g
Lbhk;g:Lbnv;
intermediary field_7549
Lnet/minecraft/class_1661;field_7549:Lnet/minecraft/class_1799;
named cursorStack
Lnet/minecraft/entity/player/PlayerInventory;cursorStack:Lnet/minecraft/item/ItemStack;
-
changeCount
private int changeCount- Mappings:
Namespace Name Mixin selector official h
Lbhk;h:I
intermediary field_7542
Lnet/minecraft/class_1661;field_7542:I
named changeCount
Lnet/minecraft/entity/player/PlayerInventory;changeCount:I
-
-
Constructor Details
-
PlayerInventory
- Mappings:
Namespace Name Mixin selector official <init>
Lbhk;<init>(Lbhl;)V
intermediary <init>
Lnet/minecraft/class_1661;<init>(Lnet/minecraft/class_1657;)V
named <init>
Lnet/minecraft/entity/player/PlayerInventory;<init>(Lnet/minecraft/entity/player/PlayerEntity;)V
-
-
Method Details
-
getMainHandStack
- Mappings:
Namespace Name Mixin selector official f
Lbhk;f()Lbnv;
intermediary method_7391
Lnet/minecraft/class_1661;method_7391()Lnet/minecraft/class_1799;
named getMainHandStack
Lnet/minecraft/entity/player/PlayerInventory;getMainHandStack()Lnet/minecraft/item/ItemStack;
-
getHotbarSize
public static int getHotbarSize()- Mappings:
Namespace Name Mixin selector official g
Lbhk;g()I
intermediary method_7368
Lnet/minecraft/class_1661;method_7368()I
named getHotbarSize
Lnet/minecraft/entity/player/PlayerInventory;getHotbarSize()I
-
canStackAddMore
- Mappings:
Namespace Name Mixin selector official a
Lbhk;a(Lbnv;Lbnv;)Z
intermediary method_7393
Lnet/minecraft/class_1661;method_7393(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Z
named canStackAddMore
Lnet/minecraft/entity/player/PlayerInventory;canStackAddMore(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z
-
getEmptySlot
public int getEmptySlot()- Mappings:
Namespace Name Mixin selector official h
Lbhk;h()I
intermediary method_7376
Lnet/minecraft/class_1661;method_7376()I
named getEmptySlot
Lnet/minecraft/entity/player/PlayerInventory;getEmptySlot()I
-
addPickBlock
- Mappings:
Namespace Name Mixin selector official a
Lbhk;a(Lbnv;)V
intermediary method_7374
Lnet/minecraft/class_1661;method_7374(Lnet/minecraft/class_1799;)V
named addPickBlock
Lnet/minecraft/entity/player/PlayerInventory;addPickBlock(Lnet/minecraft/item/ItemStack;)V
-
swapSlotWithHotbar
public void swapSlotWithHotbar(int slot)- Mappings:
Namespace Name Mixin selector official c
Lbhk;c(I)V
intermediary method_7365
Lnet/minecraft/class_1661;method_7365(I)V
named swapSlotWithHotbar
Lnet/minecraft/entity/player/PlayerInventory;swapSlotWithHotbar(I)V
-
isValidHotbarIndex
public static boolean isValidHotbarIndex(int slot)- Mappings:
Namespace Name Mixin selector official d
Lbhk;d(I)Z
intermediary method_7380
Lnet/minecraft/class_1661;method_7380(I)Z
named isValidHotbarIndex
Lnet/minecraft/entity/player/PlayerInventory;isValidHotbarIndex(I)Z
-
getSlotWithStack
- Mappings:
Namespace Name Mixin selector official b
Lbhk;b(Lbnv;)I
intermediary method_7395
Lnet/minecraft/class_1661;method_7395(Lnet/minecraft/class_1799;)I
named getSlotWithStack
Lnet/minecraft/entity/player/PlayerInventory;getSlotWithStack(Lnet/minecraft/item/ItemStack;)I
-
indexOf
- Mappings:
Namespace Name Mixin selector official c
Lbhk;c(Lbnv;)I
intermediary method_7371
Lnet/minecraft/class_1661;method_7371(Lnet/minecraft/class_1799;)I
named indexOf
Lnet/minecraft/entity/player/PlayerInventory;indexOf(Lnet/minecraft/item/ItemStack;)I
-
getSwappableHotbarSlot
public int getSwappableHotbarSlot()- Mappings:
Namespace Name Mixin selector official i
Lbhk;i()I
intermediary method_7386
Lnet/minecraft/class_1661;method_7386()I
named getSwappableHotbarSlot
Lnet/minecraft/entity/player/PlayerInventory;getSwappableHotbarSlot()I
-
scrollInHotbar
- Mappings:
Namespace Name Mixin selector official a
Lbhk;a(D)V
intermediary method_7373
Lnet/minecraft/class_1661;method_7373(D)V
named scrollInHotbar
Lnet/minecraft/entity/player/PlayerInventory;scrollInHotbar(D)V
-
remove
- Mappings:
Namespace Name Mixin selector official a
Lbhk;a(Ljava/util/function/Predicate;ILapj;)I
intermediary method_29280
Lnet/minecraft/class_1661;method_29280(Ljava/util/function/Predicate;ILnet/minecraft/class_1263;)I
named remove
Lnet/minecraft/entity/player/PlayerInventory;remove(Ljava/util/function/Predicate;ILnet/minecraft/inventory/Inventory;)I
-
addStack
- Mappings:
Namespace Name Mixin selector official j
Lbhk;j(Lbnv;)I
intermediary method_7366
Lnet/minecraft/class_1661;method_7366(Lnet/minecraft/class_1799;)I
named addStack
Lnet/minecraft/entity/player/PlayerInventory;addStack(Lnet/minecraft/item/ItemStack;)I
-
addStack
- Mappings:
Namespace Name Mixin selector official d
Lbhk;d(ILbnv;)I
intermediary method_7385
Lnet/minecraft/class_1661;method_7385(ILnet/minecraft/class_1799;)I
named addStack
Lnet/minecraft/entity/player/PlayerInventory;addStack(ILnet/minecraft/item/ItemStack;)I
-
getOccupiedSlotWithRoomForStack
- Mappings:
Namespace Name Mixin selector official d
Lbhk;d(Lbnv;)I
intermediary method_7390
Lnet/minecraft/class_1661;method_7390(Lnet/minecraft/class_1799;)I
named getOccupiedSlotWithRoomForStack
Lnet/minecraft/entity/player/PlayerInventory;getOccupiedSlotWithRoomForStack(Lnet/minecraft/item/ItemStack;)I
-
updateItems
public void updateItems()- Mappings:
Namespace Name Mixin selector official j
Lbhk;j()V
intermediary method_7381
Lnet/minecraft/class_1661;method_7381()V
named updateItems
Lnet/minecraft/entity/player/PlayerInventory;updateItems()V
-
insertStack
- Mappings:
Namespace Name Mixin selector official e
Lbhk;e(Lbnv;)Z
intermediary method_7394
Lnet/minecraft/class_1661;method_7394(Lnet/minecraft/class_1799;)Z
named insertStack
Lnet/minecraft/entity/player/PlayerInventory;insertStack(Lnet/minecraft/item/ItemStack;)Z
-
insertStack
- Mappings:
Namespace Name Mixin selector official c
Lbhk;c(ILbnv;)Z
intermediary method_7367
Lnet/minecraft/class_1661;method_7367(ILnet/minecraft/class_1799;)Z
named insertStack
Lnet/minecraft/entity/player/PlayerInventory;insertStack(ILnet/minecraft/item/ItemStack;)Z
-
offerOrDrop
- Mappings:
Namespace Name Mixin selector official f
Lbhk;f(Lbnv;)V
intermediary method_7398
Lnet/minecraft/class_1661;method_7398(Lnet/minecraft/class_1799;)V
named offerOrDrop
Lnet/minecraft/entity/player/PlayerInventory;offerOrDrop(Lnet/minecraft/item/ItemStack;)V
-
method_32338
- Mappings:
Namespace Name Mixin selector official a
Lbhk;a(Lbnv;Z)V
intermediary method_32338
Lnet/minecraft/class_1661;method_32338(Lnet/minecraft/class_1799;Z)V
named method_32338
Lnet/minecraft/entity/player/PlayerInventory;method_32338(Lnet/minecraft/item/ItemStack;Z)V
-
removeStack
Removes a specific number of items from the given slot.- Specified by:
removeStack
in interfaceInventory
- Returns:
- the removed items as a stack
- Mappings:
Namespace Name Mixin selector official a
Lapj;a(II)Lbnv;
intermediary method_5434
Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;
named removeStack
Lnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;
-
removeOne
- Mappings:
Namespace Name Mixin selector official g
Lbhk;g(Lbnv;)V
intermediary method_7378
Lnet/minecraft/class_1661;method_7378(Lnet/minecraft/class_1799;)V
named removeOne
Lnet/minecraft/entity/player/PlayerInventory;removeOne(Lnet/minecraft/item/ItemStack;)V
-
removeStack
Removes the stack currently stored at the indicated slot.- Specified by:
removeStack
in interfaceInventory
- Returns:
- the stack previously stored at the indicated slot.
- Mappings:
Namespace Name Mixin selector official b
Lapj;b(I)Lbnv;
intermediary method_5441
Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;
named removeStack
Lnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;
-
setStack
-
getBlockBreakingSpeed
- Mappings:
Namespace Name Mixin selector official a
Lbhk;a(Lcht;)F
intermediary method_7370
Lnet/minecraft/class_1661;method_7370(Lnet/minecraft/class_2680;)F
named getBlockBreakingSpeed
Lnet/minecraft/entity/player/PlayerInventory;getBlockBreakingSpeed(Lnet/minecraft/block/BlockState;)F
-
serialize
- Mappings:
Namespace Name Mixin selector official a
Lbhk;a(Lmw;)Lmw;
intermediary method_7384
Lnet/minecraft/class_1661;method_7384(Lnet/minecraft/class_2499;)Lnet/minecraft/class_2499;
named serialize
Lnet/minecraft/entity/player/PlayerInventory;serialize(Lnet/minecraft/nbt/ListTag;)Lnet/minecraft/nbt/ListTag;
-
deserialize
- Mappings:
Namespace Name Mixin selector official b
Lbhk;b(Lmw;)V
intermediary method_7397
Lnet/minecraft/class_1661;method_7397(Lnet/minecraft/class_2499;)V
named deserialize
Lnet/minecraft/entity/player/PlayerInventory;deserialize(Lnet/minecraft/nbt/ListTag;)V
-
size
public int size() -
isEmpty
public boolean isEmpty() -
getStack
Fetches the stack currently stored at the given slot. If the slot is empty, or is outside the bounds of this inventory, returns seeItemStack.EMPTY
. -
getName
-
getArmorStack
- Mappings:
Namespace Name Mixin selector official e
Lbhk;e(I)Lbnv;
intermediary method_7372
Lnet/minecraft/class_1661;method_7372(I)Lnet/minecraft/class_1799;
named getArmorStack
Lnet/minecraft/entity/player/PlayerInventory;getArmorStack(I)Lnet/minecraft/item/ItemStack;
-
damageArmor
- Mappings:
Namespace Name Mixin selector official a
Lbhk;a(Laqf;F)V
intermediary method_7375
Lnet/minecraft/class_1661;method_7375(Lnet/minecraft/class_1282;F)V
named damageArmor
Lnet/minecraft/entity/player/PlayerInventory;damageArmor(Lnet/minecraft/entity/damage/DamageSource;F)V
-
dropAll
public void dropAll()- Mappings:
Namespace Name Mixin selector official k
Lbhk;k()V
intermediary method_7388
Lnet/minecraft/class_1661;method_7388()V
named dropAll
Lnet/minecraft/entity/player/PlayerInventory;dropAll()V
-
markDirty
public void markDirty() -
getChangeCount
- Mappings:
Namespace Name Mixin selector official l
Lbhk;l()I
intermediary method_7364
Lnet/minecraft/class_1661;method_7364()I
named getChangeCount
Lnet/minecraft/entity/player/PlayerInventory;getChangeCount()I
-
setCursorStack
- Mappings:
Namespace Name Mixin selector official h
Lbhk;h(Lbnv;)V
intermediary method_7396
Lnet/minecraft/class_1661;method_7396(Lnet/minecraft/class_1799;)V
named setCursorStack
Lnet/minecraft/entity/player/PlayerInventory;setCursorStack(Lnet/minecraft/item/ItemStack;)V
-
getCursorStack
- Mappings:
Namespace Name Mixin selector official m
Lbhk;m()Lbnv;
intermediary method_7399
Lnet/minecraft/class_1661;method_7399()Lnet/minecraft/class_1799;
named getCursorStack
Lnet/minecraft/entity/player/PlayerInventory;getCursorStack()Lnet/minecraft/item/ItemStack;
-
canPlayerUse
- Specified by:
canPlayerUse
in interfaceInventory
- Mappings:
Namespace Name Mixin selector official a
Lapj;a(Lbhl;)Z
intermediary method_5443
Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Z
named canPlayerUse
Lnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
-
contains
- Mappings:
Namespace Name Mixin selector official i
Lbhk;i(Lbnv;)Z
intermediary method_7379
Lnet/minecraft/class_1661;method_7379(Lnet/minecraft/class_1799;)Z
named contains
Lnet/minecraft/entity/player/PlayerInventory;contains(Lnet/minecraft/item/ItemStack;)Z
-
contains
- Mappings:
Namespace Name Mixin selector official a
Lbhk;a(Lafc;)Z
intermediary method_7382
Lnet/minecraft/class_1661;method_7382(Lnet/minecraft/class_3494;)Z
named contains
Lnet/minecraft/entity/player/PlayerInventory;contains(Lnet/minecraft/tag/Tag;)Z
-
clone
- Mappings:
Namespace Name Mixin selector official a
Lbhk;a(Lbhk;)V
intermediary method_7377
Lnet/minecraft/class_1661;method_7377(Lnet/minecraft/class_1661;)V
named clone
Lnet/minecraft/entity/player/PlayerInventory;clone(Lnet/minecraft/entity/player/PlayerInventory;)V
-
clear
public void clear() -
populateRecipeFinder
- Mappings:
Namespace Name Mixin selector official a
Lbhk;a(Lbhn;)V
intermediary method_7387
Lnet/minecraft/class_1661;method_7387(Lnet/minecraft/class_1662;)V
named populateRecipeFinder
Lnet/minecraft/entity/player/PlayerInventory;populateRecipeFinder(Lnet/minecraft/recipe/RecipeFinder;)V
-