类 PlayerInventory

  • 所有已实现的接口:
    Inventory, Clearable, Nameable

    public class PlayerInventory
    extends Object
    implements Inventory, Nameable
    Mappings:
    Namespace Name
    official bje
    intermediary net/minecraft/class_1661
    named net/minecraft/entity/player/PlayerInventory
    • 字段详细资料

      • ITEM_USAGE_COOLDOWN

        public static final int ITEM_USAGE_COOLDOWN
        The maximum cooldown (5 ticks) applied to timed use items such as the Eye of Ender.
        另请参阅:
        常量字段值
        Mappings:
        Namespace Name Mixin selector
        official b Lbje;b:I
        intermediary field_30637 Lnet/minecraft/class_1661;field_30637:I
        named ITEM_USAGE_COOLDOWN Lnet/minecraft/entity/player/PlayerInventory;ITEM_USAGE_COOLDOWN:I
      • MAIN_SIZE

        public static final int MAIN_SIZE
        The number of slots (36) in the main (non-hotbar) section of the inventory.
        另请参阅:
        常量字段值
        Mappings:
        Namespace Name Mixin selector
        official c Lbje;c:I
        intermediary field_30638 Lnet/minecraft/class_1661;field_30638:I
        named MAIN_SIZE Lnet/minecraft/entity/player/PlayerInventory;MAIN_SIZE:I
      • HOTBAR_SIZE

        private static final int HOTBAR_SIZE
        The number of columns (9) in the inventory.

        The same value dictates the size of the player's hotbar, excluding the offhand slot.

        另请参阅:
        常量字段值
        Mappings:
        Namespace Name Mixin selector
        official k Lbje;k:I
        intermediary field_30641 Lnet/minecraft/class_1661;field_30641:I
        named HOTBAR_SIZE Lnet/minecraft/entity/player/PlayerInventory;HOTBAR_SIZE:I
      • OFF_HAND_SLOT

        public static final int OFF_HAND_SLOT
        Zero-based index of the offhand slot.

        This value is the result of the sum MAIN_SIZE (36) + ARMOR_SIZE (4).

        另请参阅:
        常量字段值
        Mappings:
        Namespace Name Mixin selector
        official d Lbje;d:I
        intermediary field_30639 Lnet/minecraft/class_1661;field_30639:I
        named OFF_HAND_SLOT Lnet/minecraft/entity/player/PlayerInventory;OFF_HAND_SLOT:I
      • NOT_FOUND

        public static final int NOT_FOUND
        The slot index (-1) used to indicate no result (item not present / no available space) when querying the inventory's contents or to indicate no preference when inserting an item into the inventory.
        另请参阅:
        常量字段值
        Mappings:
        Namespace Name Mixin selector
        official e Lbje;e:I
        intermediary field_30640 Lnet/minecraft/class_1661;field_30640:I
        named NOT_FOUND Lnet/minecraft/entity/player/PlayerInventory;NOT_FOUND:I
      • main

        public final DefaultedList<ItemStack> main
        Mappings:
        Namespace Name Mixin selector
        official f Lbje;f:Lgn;
        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

        public final DefaultedList<ItemStack> armor
        Mappings:
        Namespace Name Mixin selector
        official g Lbje;g:Lgn;
        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

        public final DefaultedList<ItemStack> offHand
        Mappings:
        Namespace Name Mixin selector
        official h Lbje;h:Lgn;
        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

        private final List<DefaultedList<ItemStack>> combinedInventory
        Mappings:
        Namespace Name Mixin selector
        official l Lbje;l: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 i Lbje;i:I
        intermediary field_7545 Lnet/minecraft/class_1661;field_7545:I
        named selectedSlot Lnet/minecraft/entity/player/PlayerInventory;selectedSlot:I
      • player

        public final PlayerEntity player
        Mappings:
        Namespace Name Mixin selector
        official j Lbje;j:Lbjf;
        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;
      • changeCount

        private int changeCount
        Mappings:
        Namespace Name Mixin selector
        official m Lbje;m:I
        intermediary field_7542 Lnet/minecraft/class_1661;field_7542:I
        named changeCount Lnet/minecraft/entity/player/PlayerInventory;changeCount:I
    • 构造器详细资料

      • PlayerInventory

        public PlayerInventory​(PlayerEntity player)
        Mappings:
        Namespace Name Mixin selector
        official <init> Lbje;<init>(Lbjf;)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
    • 方法详细资料

      • getMainHandStack

        public ItemStack getMainHandStack()
        Mappings:
        Namespace Name Mixin selector
        official f Lbje;f()Lbpr;
        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 Lbje;g()I
        intermediary method_7368 Lnet/minecraft/class_1661;method_7368()I
        named getHotbarSize Lnet/minecraft/entity/player/PlayerInventory;getHotbarSize()I
      • canStackAddMore

        private boolean canStackAddMore​(ItemStack existingStack,
                                        ItemStack stack)
        Mappings:
        Namespace Name Mixin selector
        official a Lbje;a(Lbpr;Lbpr;)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 Lbje;h()I
        intermediary method_7376 Lnet/minecraft/class_1661;method_7376()I
        named getEmptySlot Lnet/minecraft/entity/player/PlayerInventory;getEmptySlot()I
      • addPickBlock

        public void addPickBlock​(ItemStack stack)
        Mappings:
        Namespace Name Mixin selector
        official a Lbje;a(Lbpr;)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 Lbje;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 Lbje;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

        public int getSlotWithStack​(ItemStack stack)
        Mappings:
        Namespace Name Mixin selector
        official b Lbje;b(Lbpr;)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

        public int indexOf​(ItemStack stack)
        Mappings:
        Namespace Name Mixin selector
        official c Lbje;c(Lbpr;)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 Lbje;i()I
        intermediary method_7386 Lnet/minecraft/class_1661;method_7386()I
        named getSwappableHotbarSlot Lnet/minecraft/entity/player/PlayerInventory;getSwappableHotbarSlot()I
      • scrollInHotbar

        public void scrollInHotbar​(double scrollAmount)
        Mappings:
        Namespace Name Mixin selector
        official a Lbje;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

        public int remove​(Predicate<ItemStack> shouldRemove,
                          int maxCount,
                          Inventory craftingInventory)
        Mappings:
        Namespace Name Mixin selector
        official a Lbje;a(Ljava/util/function/Predicate;ILaqz;)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

        private int addStack​(ItemStack stack)
        Mappings:
        Namespace Name Mixin selector
        official i Lbje;i(Lbpr;)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

        private int addStack​(int slot,
                             ItemStack stack)
        Mappings:
        Namespace Name Mixin selector
        official d Lbje;d(ILbpr;)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

        public int getOccupiedSlotWithRoomForStack​(ItemStack stack)
        Mappings:
        Namespace Name Mixin selector
        official d Lbje;d(Lbpr;)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 Lbje;j()V
        intermediary method_7381 Lnet/minecraft/class_1661;method_7381()V
        named updateItems Lnet/minecraft/entity/player/PlayerInventory;updateItems()V
      • insertStack

        public boolean insertStack​(ItemStack stack)
        Mappings:
        Namespace Name Mixin selector
        official e Lbje;e(Lbpr;)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

        public boolean insertStack​(int slot,
                                   ItemStack stack)
        Mappings:
        Namespace Name Mixin selector
        official c Lbje;c(ILbpr;)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

        public void offerOrDrop​(ItemStack stack)
        Mappings:
        Namespace Name Mixin selector
        official f Lbje;f(Lbpr;)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
      • offer

        public void offer​(ItemStack stack,
                          boolean notifiesClient)
        Mappings:
        Namespace Name Mixin selector
        official a Lbje;a(Lbpr;Z)V
        intermediary method_32338 Lnet/minecraft/class_1661;method_32338(Lnet/minecraft/class_1799;Z)V
        named offer Lnet/minecraft/entity/player/PlayerInventory;offer(Lnet/minecraft/item/ItemStack;Z)V
      • removeStack

        public ItemStack removeStack​(int slot,
                                     int amount)
        Removes a specific number of items from the given slot.
        指定者:
        removeStack 在接口中 Inventory
        返回:
        the removed items as a stack
        Mappings:
        Namespace Name Mixin selector
        official a Laqz;a(II)Lbpr;
        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

        public void removeOne​(ItemStack stack)
        Mappings:
        Namespace Name Mixin selector
        official g Lbje;g(Lbpr;)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

        public ItemStack removeStack​(int slot)
        Removes the stack currently stored at the indicated slot.
        指定者:
        removeStack 在接口中 Inventory
        返回:
        the stack previously stored at the indicated slot.
        Mappings:
        Namespace Name Mixin selector
        official b Laqz;b(I)Lbpr;
        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

        public void setStack​(int slot,
                             ItemStack stack)
        指定者:
        setStack 在接口中 Inventory
        Mappings:
        Namespace Name Mixin selector
        official a Laqz;a(ILbpr;)V
        intermediary method_5447 Lnet/minecraft/class_1263;method_5447(ILnet/minecraft/class_1799;)V
        named setStack Lnet/minecraft/inventory/Inventory;setStack(ILnet/minecraft/item/ItemStack;)V
      • getBlockBreakingSpeed

        public float getBlockBreakingSpeed​(BlockState block)
        Mappings:
        Namespace Name Mixin selector
        official a Lbje;a(Lcjr;)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
      • writeNbt

        public ListTag writeNbt​(ListTag nbtList)
        Mappings:
        Namespace Name Mixin selector
        official a Lbje;a(Lnb;)Lnb;
        intermediary method_7384 Lnet/minecraft/class_1661;method_7384(Lnet/minecraft/class_2499;)Lnet/minecraft/class_2499;
        named writeNbt Lnet/minecraft/entity/player/PlayerInventory;writeNbt(Lnet/minecraft/nbt/ListTag;)Lnet/minecraft/nbt/ListTag;
      • readNbt

        public void readNbt​(ListTag nbtList)
        Mappings:
        Namespace Name Mixin selector
        official b Lbje;b(Lnb;)V
        intermediary method_7397 Lnet/minecraft/class_1661;method_7397(Lnet/minecraft/class_2499;)V
        named readNbt Lnet/minecraft/entity/player/PlayerInventory;readNbt(Lnet/minecraft/nbt/ListTag;)V
      • size

        public int size()
        指定者:
        size 在接口中 Inventory
        Mappings:
        Namespace Name Mixin selector
        official ab_ Laqz;ab_()I
        intermediary method_5439 Lnet/minecraft/class_1263;method_5439()I
        named size Lnet/minecraft/inventory/Inventory;size()I
      • isEmpty

        public boolean isEmpty()
        指定者:
        isEmpty 在接口中 Inventory
        Mappings:
        Namespace Name Mixin selector
        official c Laqz;c()Z
        intermediary method_5442 Lnet/minecraft/class_1263;method_5442()Z
        named isEmpty Lnet/minecraft/inventory/Inventory;isEmpty()Z
      • getStack

        public ItemStack getStack​(int slot)
        Fetches the stack currently stored at the given slot. If the slot is empty, or is outside the bounds of this inventory, returns see ItemStack.EMPTY.
        指定者:
        getStack 在接口中 Inventory
        Mappings:
        Namespace Name Mixin selector
        official a Laqz;a(I)Lbpr;
        intermediary method_5438 Lnet/minecraft/class_1263;method_5438(I)Lnet/minecraft/class_1799;
        named getStack Lnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;
      • getName

        public Text getName()
        指定者:
        getName 在接口中 Nameable
        Mappings:
        Namespace Name Mixin selector
        official R Lark;R()Lon;
        intermediary method_5477 Lnet/minecraft/class_1275;method_5477()Lnet/minecraft/class_2561;
        named getName Lnet/minecraft/util/Nameable;getName()Lnet/minecraft/text/Text;
      • getArmorStack

        public ItemStack getArmorStack​(int slot)
        Mappings:
        Namespace Name Mixin selector
        official e Lbje;e(I)Lbpr;
        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

        public void damageArmor​(DamageSource damageSource,
                                float amount)
        Mappings:
        Namespace Name Mixin selector
        official a Lbje;a(Larv;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 Lbje;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()
        指定者:
        markDirty 在接口中 Inventory
        Mappings:
        Namespace Name Mixin selector
        official Z_ Laqz;Z_()V
        intermediary method_5431 Lnet/minecraft/class_1263;method_5431()V
        named markDirty Lnet/minecraft/inventory/Inventory;markDirty()V
      • getChangeCount

        public int getChangeCount()
        Mappings:
        Namespace Name Mixin selector
        official l Lbje;l()I
        intermediary method_7364 Lnet/minecraft/class_1661;method_7364()I
        named getChangeCount Lnet/minecraft/entity/player/PlayerInventory;getChangeCount()I
      • canPlayerUse

        public boolean canPlayerUse​(PlayerEntity player)
        指定者:
        canPlayerUse 在接口中 Inventory
        Mappings:
        Namespace Name Mixin selector
        official a Laqz;a(Lbjf;)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

        public boolean contains​(ItemStack stack)
        Mappings:
        Namespace Name Mixin selector
        official h Lbje;h(Lbpr;)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

        public boolean contains​(Tag<Item> tag)
        Mappings:
        Namespace Name Mixin selector
        official a Lbje;a(Lafs;)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

        public void clone​(PlayerInventory other)
        Mappings:
        Namespace Name Mixin selector
        official a Lbje;a(Lbje;)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()
        指定者:
        clear 在接口中 Clearable
        Mappings:
        Namespace Name Mixin selector
        official aa_ Laqx;aa_()V
        intermediary method_5448 Lnet/minecraft/class_3829;method_5448()V
        named clear Lnet/minecraft/util/Clearable;clear()V
      • populateRecipeFinder

        public void populateRecipeFinder​(RecipeFinder finder)
        Mappings:
        Namespace Name Mixin selector
        official a Lbje;a(Lbjh;)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