Class Slot

java.lang.Object
net.minecraft.screen.slot.Slot
Direct Known Subclasses:
ArmorSlot, BeaconScreenHandler.PaymentSlot, BrewingStandScreenHandler.FuelSlot, BrewingStandScreenHandler.IngredientSlot, BrewingStandScreenHandler.PotionSlot, CrafterInputSlot, CrafterOutputSlot, CraftingResultSlot, CreativeInventoryScreen.CreativeSlot, CreativeInventoryScreen.LockableSlot, FurnaceFuelSlot, FurnaceOutputSlot, ShulkerBoxSlot, TradeOutputSlot

public class Slot extends Object
A slot of a screen handler that holds an item stack. A slot is temporary holder that holds the stack for the lifetime of the screen handler. They are backed by an inventory, which implements the persistent storage if necessary.

To add slots, call ScreenHandler.addSlot(net.minecraft.screen.slot.Slot) inside the screen handler's constructor.

Mappings:
Namespace Name
named net/minecraft/screen/slot/Slot
intermediary net/minecraft/class_1735
official cua
  • Field Details Link icon

    • index Link icon

      private final int index
      Mappings:
      Namespace Name Mixin selector
      named index Lnet/minecraft/screen/slot/Slot;index:I
      intermediary field_7875 Lnet/minecraft/class_1735;field_7875:I
      official a Lcua;a:I
    • inventory Link icon

      public final Inventory inventory
      Mappings:
      Namespace Name Mixin selector
      named inventory Lnet/minecraft/screen/slot/Slot;inventory:Lnet/minecraft/inventory/Inventory;
      intermediary field_7871 Lnet/minecraft/class_1735;field_7871:Lnet/minecraft/class_1263;
      official c Lcua;c:Lbse;
    • id Link icon

      public int id
      Mappings:
      Namespace Name Mixin selector
      named id Lnet/minecraft/screen/slot/Slot;id:I
      intermediary field_7874 Lnet/minecraft/class_1735;field_7874:I
      official d Lcua;d:I
    • x Link icon

      public final int x
      Mappings:
      Namespace Name Mixin selector
      named x Lnet/minecraft/screen/slot/Slot;x:I
      intermediary field_7873 Lnet/minecraft/class_1735;field_7873:I
      official e Lcua;e:I
    • y Link icon

      public final int y
      Mappings:
      Namespace Name Mixin selector
      named y Lnet/minecraft/screen/slot/Slot;y:I
      intermediary field_7872 Lnet/minecraft/class_1735;field_7872:I
      official f Lcua;f:I
  • Constructor Details Link icon

    • Slot Link icon

      public Slot(Inventory inventory, int index, int x, int y)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/screen/slot/Slot;<init>(Lnet/minecraft/inventory/Inventory;III)V
      intermediary <init> Lnet/minecraft/class_1735;<init>(Lnet/minecraft/class_1263;III)V
      official <init> Lcua;<init>(Lbse;III)V
  • Method Details Link icon

    • onQuickTransfer Link icon

      public void onQuickTransfer(ItemStack newItem, ItemStack original)
      Mappings:
      Namespace Name Mixin selector
      named onQuickTransfer Lnet/minecraft/screen/slot/Slot;onQuickTransfer(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)V
      intermediary method_7670 Lnet/minecraft/class_1735;method_7670(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)V
      official b Lcua;b(Lcwq;Lcwq;)V
    • onCrafted Link icon

      protected void onCrafted(ItemStack stack, int amount)
      Mappings:
      Namespace Name Mixin selector
      named onCrafted Lnet/minecraft/screen/slot/Slot;onCrafted(Lnet/minecraft/item/ItemStack;I)V
      intermediary method_7678 Lnet/minecraft/class_1735;method_7678(Lnet/minecraft/class_1799;I)V
      official a Lcua;a(Lcwq;I)V
    • onTake Link icon

      protected void onTake(int amount)
      Mappings:
      Namespace Name Mixin selector
      named onTake Lnet/minecraft/screen/slot/Slot;onTake(I)V
      intermediary method_7672 Lnet/minecraft/class_1735;method_7672(I)V
      official b Lcua;b(I)V
    • onCrafted Link icon

      protected void onCrafted(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named onCrafted Lnet/minecraft/screen/slot/Slot;onCrafted(Lnet/minecraft/item/ItemStack;)V
      intermediary method_7669 Lnet/minecraft/class_1735;method_7669(Lnet/minecraft/class_1799;)V
      official b_ Lcua;b_(Lcwq;)V
    • onTakeItem Link icon

      public void onTakeItem(PlayerEntity player, ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named onTakeItem Lnet/minecraft/screen/slot/Slot;onTakeItem(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;)V
      intermediary method_7667 Lnet/minecraft/class_1735;method_7667(Lnet/minecraft/class_1657;Lnet/minecraft/class_1799;)V
      official a Lcua;a(Lcoy;Lcwq;)V
    • canInsert Link icon

      public boolean canInsert(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named canInsert Lnet/minecraft/screen/slot/Slot;canInsert(Lnet/minecraft/item/ItemStack;)Z
      intermediary method_7680 Lnet/minecraft/class_1735;method_7680(Lnet/minecraft/class_1799;)Z
      official a Lcua;a(Lcwq;)Z
    • getStack Link icon

      public ItemStack getStack()
      Mappings:
      Namespace Name Mixin selector
      named getStack Lnet/minecraft/screen/slot/Slot;getStack()Lnet/minecraft/item/ItemStack;
      intermediary method_7677 Lnet/minecraft/class_1735;method_7677()Lnet/minecraft/class_1799;
      official g Lcua;g()Lcwq;
    • hasStack Link icon

      public boolean hasStack()
      Mappings:
      Namespace Name Mixin selector
      named hasStack Lnet/minecraft/screen/slot/Slot;hasStack()Z
      intermediary method_7681 Lnet/minecraft/class_1735;method_7681()Z
      official h Lcua;h()Z
    • setStack Link icon

      public void setStack(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named setStack Lnet/minecraft/screen/slot/Slot;setStack(Lnet/minecraft/item/ItemStack;)V
      intermediary method_53512 Lnet/minecraft/class_1735;method_53512(Lnet/minecraft/class_1799;)V
      official e Lcua;e(Lcwq;)V
    • setStack Link icon

      public void setStack(ItemStack stack, ItemStack previousStack)
      Sets the slot's stack to stack and marks the slot as dirty. Subclasses may override this method to perform additional operations.
      Mappings:
      Namespace Name Mixin selector
      named setStack Lnet/minecraft/screen/slot/Slot;setStack(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)V
      intermediary method_48931 Lnet/minecraft/class_1735;method_48931(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)V
      official a Lcua;a(Lcwq;Lcwq;)V
    • setStackNoCallbacks Link icon

      public void setStackNoCallbacks(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named setStackNoCallbacks Lnet/minecraft/screen/slot/Slot;setStackNoCallbacks(Lnet/minecraft/item/ItemStack;)V
      intermediary method_7673 Lnet/minecraft/class_1735;method_7673(Lnet/minecraft/class_1799;)V
      official f Lcua;f(Lcwq;)V
    • markDirty Link icon

      public void markDirty()
      Mappings:
      Namespace Name Mixin selector
      named markDirty Lnet/minecraft/screen/slot/Slot;markDirty()V
      intermediary method_7668 Lnet/minecraft/class_1735;method_7668()V
      official c Lcua;c()V
    • getMaxItemCount Link icon

      public int getMaxItemCount()
      Mappings:
      Namespace Name Mixin selector
      named getMaxItemCount Lnet/minecraft/screen/slot/Slot;getMaxItemCount()I
      intermediary method_7675 Lnet/minecraft/class_1735;method_7675()I
      official a Lcua;a()I
    • getMaxItemCount Link icon

      public int getMaxItemCount(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named getMaxItemCount Lnet/minecraft/screen/slot/Slot;getMaxItemCount(Lnet/minecraft/item/ItemStack;)I
      intermediary method_7676 Lnet/minecraft/class_1735;method_7676(Lnet/minecraft/class_1799;)I
      official a_ Lcua;a_(Lcwq;)I
    • getBackgroundSprite Link icon

      @Nullable public @Nullable Identifier getBackgroundSprite()
      Mappings:
      Namespace Name Mixin selector
      named getBackgroundSprite Lnet/minecraft/screen/slot/Slot;getBackgroundSprite()Lnet/minecraft/util/Identifier;
      intermediary method_7679 Lnet/minecraft/class_1735;method_7679()Lnet/minecraft/class_2960;
      official b Lcua;b()Lakv;
    • takeStack Link icon

      public ItemStack takeStack(int amount)
      Mappings:
      Namespace Name Mixin selector
      named takeStack Lnet/minecraft/screen/slot/Slot;takeStack(I)Lnet/minecraft/item/ItemStack;
      intermediary method_7671 Lnet/minecraft/class_1735;method_7671(I)Lnet/minecraft/class_1799;
      official a Lcua;a(I)Lcwq;
    • canTakeItems Link icon

      public boolean canTakeItems(PlayerEntity playerEntity)
      Mappings:
      Namespace Name Mixin selector
      named canTakeItems Lnet/minecraft/screen/slot/Slot;canTakeItems(Lnet/minecraft/entity/player/PlayerEntity;)Z
      intermediary method_7674 Lnet/minecraft/class_1735;method_7674(Lnet/minecraft/class_1657;)Z
      official a Lcua;a(Lcoy;)Z
    • isEnabled Link icon

      public boolean isEnabled()
      Mappings:
      Namespace Name Mixin selector
      named isEnabled Lnet/minecraft/screen/slot/Slot;isEnabled()Z
      intermediary method_7682 Lnet/minecraft/class_1735;method_7682()Z
      official d Lcua;d()Z
    • tryTakeStackRange Link icon

      public Optional<ItemStack> tryTakeStackRange(int min, int max, PlayerEntity player)
      Mappings:
      Namespace Name Mixin selector
      named tryTakeStackRange Lnet/minecraft/screen/slot/Slot;tryTakeStackRange(IILnet/minecraft/entity/player/PlayerEntity;)Ljava/util/Optional;
      intermediary method_34264 Lnet/minecraft/class_1735;method_34264(IILnet/minecraft/class_1657;)Ljava/util/Optional;
      official a Lcua;a(IILcoy;)Ljava/util/Optional;
    • takeStackRange Link icon

      public ItemStack takeStackRange(int min, int max, PlayerEntity player)
      Mappings:
      Namespace Name Mixin selector
      named takeStackRange Lnet/minecraft/screen/slot/Slot;takeStackRange(IILnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/item/ItemStack;
      intermediary method_32753 Lnet/minecraft/class_1735;method_32753(IILnet/minecraft/class_1657;)Lnet/minecraft/class_1799;
      official b Lcua;b(IILcoy;)Lcwq;
    • insertStack Link icon

      public ItemStack insertStack(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named insertStack Lnet/minecraft/screen/slot/Slot;insertStack(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;
      intermediary method_32756 Lnet/minecraft/class_1735;method_32756(Lnet/minecraft/class_1799;)Lnet/minecraft/class_1799;
      official d Lcua;d(Lcwq;)Lcwq;
    • insertStack Link icon

      public ItemStack insertStack(ItemStack stack, int count)
      Mappings:
      Namespace Name Mixin selector
      named insertStack Lnet/minecraft/screen/slot/Slot;insertStack(Lnet/minecraft/item/ItemStack;I)Lnet/minecraft/item/ItemStack;
      intermediary method_32755 Lnet/minecraft/class_1735;method_32755(Lnet/minecraft/class_1799;I)Lnet/minecraft/class_1799;
      official b Lcua;b(Lcwq;I)Lcwq;
    • canTakePartial Link icon

      public boolean canTakePartial(PlayerEntity player)
      Mappings:
      Namespace Name Mixin selector
      named canTakePartial Lnet/minecraft/screen/slot/Slot;canTakePartial(Lnet/minecraft/entity/player/PlayerEntity;)Z
      intermediary method_32754 Lnet/minecraft/class_1735;method_32754(Lnet/minecraft/class_1657;)Z
      official b Lcua;b(Lcoy;)Z
    • getIndex Link icon

      public int getIndex()
      Mappings:
      Namespace Name Mixin selector
      named getIndex Lnet/minecraft/screen/slot/Slot;getIndex()I
      intermediary method_34266 Lnet/minecraft/class_1735;method_34266()I
      official i Lcua;i()I
    • canBeHighlighted Link icon

      public boolean canBeHighlighted()
      Mappings:
      Namespace Name Mixin selector
      named canBeHighlighted Lnet/minecraft/screen/slot/Slot;canBeHighlighted()Z
      intermediary method_51306 Lnet/minecraft/class_1735;method_51306()Z
      official e Lcua;e()Z
    • disablesDynamicDisplay Link icon

      public boolean disablesDynamicDisplay()
      Returns true to disable dynamic display for clocks and compasses.
      Returns:
      true to disable dynamic display for clocks and compasses
      Mappings:
      Namespace Name Mixin selector
      named disablesDynamicDisplay Lnet/minecraft/screen/slot/Slot;disablesDynamicDisplay()Z
      intermediary method_55059 Lnet/minecraft/class_1735;method_55059()Z
      official f Lcua;f()Z