Interface CommandItemSlot


public interface CommandItemSlot
Represents an item slot for command access. Usually obtained from entities.

Some dispenser behaviors also use this to simulate commands' behavior of equipping items.

See Also:
Entity.getCommandItemSlot(int)
Mappings:
Namespace Name
official auk
intermediary net/minecraft/class_5630
named net/minecraft/inventory/CommandItemSlot
  • Field Details

    • EMPTY

      static final CommandItemSlot EMPTY
      An immutable empty slot.
      Mappings:
      Namespace Name Mixin selector
      official a Lauk;a:Lauk;
      intermediary field_27860 Lnet/minecraft/class_5630;field_27860:Lnet/minecraft/class_5630;
      named EMPTY Lnet/minecraft/inventory/CommandItemSlot;EMPTY:Lnet/minecraft/inventory/CommandItemSlot;
  • Method Details

    • of

      static CommandItemSlot of(Inventory inventory, int index, Predicate<ItemStack> stackFilter)
      Creates a slot backed by an index within an inventory and guarded by a condition for setting stacks into the inventory.
      Parameters:
      stackFilter - the condition to guard stack setting
      Mappings:
      Namespace Name Mixin selector
      official a Lauk;a(Lart;ILjava/util/function/Predicate;)Lauk;
      intermediary method_32329 Lnet/minecraft/class_5630;method_32329(Lnet/minecraft/class_1263;ILjava/util/function/Predicate;)Lnet/minecraft/class_5630;
      named of Lnet/minecraft/inventory/CommandItemSlot;of(Lnet/minecraft/inventory/Inventory;ILjava/util/function/Predicate;)Lnet/minecraft/inventory/CommandItemSlot;
    • of

      static CommandItemSlot of(Inventory inventory, int index)
      Creates a slot backed by an index within an inventory.
      Mappings:
      Namespace Name Mixin selector
      official a Lauk;a(Lart;I)Lauk;
      intermediary method_32328 Lnet/minecraft/class_5630;method_32328(Lnet/minecraft/class_1263;I)Lnet/minecraft/class_5630;
      named of Lnet/minecraft/inventory/CommandItemSlot;of(Lnet/minecraft/inventory/Inventory;I)Lnet/minecraft/inventory/CommandItemSlot;
    • of

      static CommandItemSlot of(LivingEntity entity, EquipmentSlot equipmentSlot, Predicate<ItemStack> stackFilter)
      Creates a slot backed by an equipment slot of an living entity and guarded by a condition for setting stacks into the inventory.
      Parameters:
      stackFilter - the condition to guard stack setting
      Mappings:
      Namespace Name Mixin selector
      official a Lauk;a(Latt;Latk;Ljava/util/function/Predicate;)Lauk;
      intermediary method_32331 Lnet/minecraft/class_5630;method_32331(Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;Ljava/util/function/Predicate;)Lnet/minecraft/class_5630;
      named of Lnet/minecraft/inventory/CommandItemSlot;of(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;Ljava/util/function/Predicate;)Lnet/minecraft/inventory/CommandItemSlot;
    • of

      static CommandItemSlot of(LivingEntity entity, EquipmentSlot equipmentSlot)
      Creates a slot backed by an equipment slot of an living entity.
      Mappings:
      Namespace Name Mixin selector
      official a Lauk;a(Latt;Latk;)Lauk;
      intermediary method_32330 Lnet/minecraft/class_5630;method_32330(Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)Lnet/minecraft/class_5630;
      named of Lnet/minecraft/inventory/CommandItemSlot;of(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;)Lnet/minecraft/inventory/CommandItemSlot;
    • get

      ItemStack get()
      Gets the current item stack in this slot.
      Mappings:
      Namespace Name Mixin selector
      official a Lauk;a()Lbqp;
      intermediary method_32327 Lnet/minecraft/class_5630;method_32327()Lnet/minecraft/class_1799;
      named get Lnet/minecraft/inventory/CommandItemSlot;get()Lnet/minecraft/item/ItemStack;
    • set

      boolean set(ItemStack stack)
      Sets the stack to this slot.
      Parameters:
      stack - the item stack to set
      Returns:
      true if the setting is successful, false if rejected
      Mappings:
      Namespace Name Mixin selector
      official a Lauk;a(Lbqp;)Z
      intermediary method_32332 Lnet/minecraft/class_5630;method_32332(Lnet/minecraft/class_1799;)Z
      named set Lnet/minecraft/inventory/CommandItemSlot;set(Lnet/minecraft/item/ItemStack;)Z