Class Slot

java.lang.Object
net.minecraft.screen.slot.Slot
Direct Known Subclasses:
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 crr
  • Field Details

    • index

      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 Lcrr;a:I
    • inventory

      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 Lcrr;c:Lbqp;
    • id

      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 Lcrr;d:I
    • x

      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 Lcrr;e:I
    • y

      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 Lcrr;f:I
  • Constructor Details

    • Slot

      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> Lcrr;<init>(Lbqp;III)V
  • Method Details

    • onQuickTransfer

      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 Lcrr;b(Lcur;Lcur;)V
    • onCrafted

      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 Lcrr;a(Lcur;I)V
    • onTake

      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 Lcrr;b(I)V
    • onCrafted

      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_ Lcrr;b_(Lcur;)V
    • onTakeItem

      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 Lcrr;a(Lcmz;Lcur;)V
    • canInsert

      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 Lcrr;a(Lcur;)Z
    • getStack

      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 Lcrr;g()Lcur;
    • hasStack

      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 Lcrr;h()Z
    • setStack

      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 Lcrr;e(Lcur;)V
    • setStack

      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 Lcrr;a(Lcur;Lcur;)V
    • setStackNoCallbacks

      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 Lcrr;f(Lcur;)V
    • markDirty

      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 b Lcrr;b()V
    • getMaxItemCount

      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 Lcrr;a()I
    • getMaxItemCount

      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_ Lcrr;a_(Lcur;)I
    • getBackgroundSprite

      @Nullable public @Nullable com.mojang.datafixers.util.Pair<Identifier,Identifier> getBackgroundSprite()
      Mappings:
      Namespace Name Mixin selector
      named getBackgroundSprite Lnet/minecraft/screen/slot/Slot;getBackgroundSprite()Lcom/mojang/datafixers/util/Pair;
      intermediary method_7679 Lnet/minecraft/class_1735;method_7679()Lcom/mojang/datafixers/util/Pair;
      official c Lcrr;c()Lcom/mojang/datafixers/util/Pair;
    • takeStack

      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 Lcrr;a(I)Lcur;
    • canTakeItems

      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 Lcrr;a(Lcmz;)Z
    • isEnabled

      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 Lcrr;d()Z
    • tryTakeStackRange

      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 Lcrr;a(IILcmz;)Ljava/util/Optional;
    • takeStackRange

      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 Lcrr;b(IILcmz;)Lcur;
    • insertStack

      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 Lcrr;d(Lcur;)Lcur;
    • insertStack

      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 Lcrr;b(Lcur;I)Lcur;
    • canTakePartial

      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 Lcrr;b(Lcmz;)Z
    • getIndex

      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 Lcrr;i()I
    • canBeHighlighted

      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 Lcrr;e()Z
    • disablesDynamicDisplay

      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 Lcrr;f()Z