Package net.minecraft.inventory
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 aukintermediary net/minecraft/class_5630named net/minecraft/inventory/CommandItemSlot
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionget()Gets the current item stack in this slot.static CommandItemSlotof(LivingEntity entity, EquipmentSlot equipmentSlot)Creates a slot backed by an equipment slot of an living entity.static CommandItemSlotof(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.static CommandItemSlotCreates a slot backed by an index within an inventory.static CommandItemSlotCreates a slot backed by an index within an inventory and guarded by a condition for setting stacks into the inventory.booleanSets thestackto this slot.
-
Field Details
-
EMPTY
An immutable empty slot.- Mappings:
Namespace Name Mixin selector official aLauk;a:Lauk;intermediary field_27860Lnet/minecraft/class_5630;field_27860:Lnet/minecraft/class_5630;named EMPTYLnet/minecraft/inventory/CommandItemSlot;EMPTY:Lnet/minecraft/inventory/CommandItemSlot;
-
-
Method Details
-
of
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 aLauk;a(Lart;ILjava/util/function/Predicate;)Lauk;intermediary method_32329Lnet/minecraft/class_5630;method_32329(Lnet/minecraft/class_1263;ILjava/util/function/Predicate;)Lnet/minecraft/class_5630;named ofLnet/minecraft/inventory/CommandItemSlot;of(Lnet/minecraft/inventory/Inventory;ILjava/util/function/Predicate;)Lnet/minecraft/inventory/CommandItemSlot;
-
of
Creates a slot backed by an index within an inventory.- Mappings:
Namespace Name Mixin selector official aLauk;a(Lart;I)Lauk;intermediary method_32328Lnet/minecraft/class_5630;method_32328(Lnet/minecraft/class_1263;I)Lnet/minecraft/class_5630;named ofLnet/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 aLauk;a(Latt;Latk;Ljava/util/function/Predicate;)Lauk;intermediary method_32331Lnet/minecraft/class_5630;method_32331(Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;Ljava/util/function/Predicate;)Lnet/minecraft/class_5630;named ofLnet/minecraft/inventory/CommandItemSlot;of(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;Ljava/util/function/Predicate;)Lnet/minecraft/inventory/CommandItemSlot;
-
of
Creates a slot backed by an equipment slot of an living entity.- Mappings:
Namespace Name Mixin selector official aLauk;a(Latt;Latk;)Lauk;intermediary method_32330Lnet/minecraft/class_5630;method_32330(Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)Lnet/minecraft/class_5630;named ofLnet/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 aLauk;a()Lbqp;intermediary method_32327Lnet/minecraft/class_5630;method_32327()Lnet/minecraft/class_1799;named getLnet/minecraft/inventory/CommandItemSlot;get()Lnet/minecraft/item/ItemStack;
-
set
Sets thestackto this slot.- Parameters:
stack- the item stack to set- Returns:
trueif the setting is successful,falseif rejected- Mappings:
Namespace Name Mixin selector official aLauk;a(Lbqp;)Zintermediary method_32332Lnet/minecraft/class_5630;method_32332(Lnet/minecraft/class_1799;)Znamed setLnet/minecraft/inventory/CommandItemSlot;set(Lnet/minecraft/item/ItemStack;)Z
-