Class LootableContainerBlockEntity

All Implemented Interfaces:
Inventory, LootableInventory, NamedScreenHandlerFactory, ScreenHandlerFactory, Clearable, Nameable
Direct Known Subclasses:
BarrelBlockEntity, ChestBlockEntity, CrafterBlockEntity, DispenserBlockEntity, HopperBlockEntity, ShulkerBoxBlockEntity

public abstract class LootableContainerBlockEntity extends LockableContainerBlockEntity implements LootableInventory
Mappings:
Namespace Name
official dhz
intermediary net/minecraft/class_2621
named net/minecraft/block/entity/LootableContainerBlockEntity
  • Field Details

    • lootTableId

      @Nullable protected @Nullable Identifier lootTableId
      Mappings:
      Namespace Name Mixin selector
      official m Ldhz;m:Lahg;
      intermediary field_12037 Lnet/minecraft/class_2621;field_12037:Lnet/minecraft/class_2960;
      named lootTableId Lnet/minecraft/block/entity/LootableContainerBlockEntity;lootTableId:Lnet/minecraft/util/Identifier;
    • lootTableSeed

      protected long lootTableSeed
      Mappings:
      Namespace Name Mixin selector
      official n Ldhz;n:J
      intermediary field_12036 Lnet/minecraft/class_2621;field_12036:J
      named lootTableSeed Lnet/minecraft/block/entity/LootableContainerBlockEntity;lootTableSeed:J
  • Constructor Details

    • LootableContainerBlockEntity

      protected LootableContainerBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official <init> Ldgv;<init>(Ldgx;Lhx;Ldjh;)V
      intermediary <init> Lnet/minecraft/class_2586;<init>(Lnet/minecraft/class_2591;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named <init> Lnet/minecraft/block/entity/BlockEntity;<init>(Lnet/minecraft/block/entity/BlockEntityType;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
  • Method Details

    • getLootTableId

      @Nullable public @Nullable Identifier getLootTableId()
      Returns the loot table ID, or null if there is no associated loot table.

      This is usually stored under the "LootTable" NBT key.

      Specified by:
      getLootTableId in interface LootableInventory
      Returns:
      the loot table ID, or null if there is no associated loot table
      Mappings:
      Namespace Name Mixin selector
      official az_ Lbki;az_()Lahg;
      intermediary method_54869 Lnet/minecraft/class_8934;method_54869()Lnet/minecraft/class_2960;
      named getLootTableId Lnet/minecraft/inventory/LootableInventory;getLootTableId()Lnet/minecraft/util/Identifier;
    • setLootTableId

      public void setLootTableId(@Nullable @Nullable Identifier lootTableId)
      Sets the loot table ID.

      This is usually stored under the "LootTable" NBT key.

      Specified by:
      setLootTableId in interface LootableInventory
      Parameters:
      lootTableId - the loot table ID, or null to remove the loot table
      Mappings:
      Namespace Name Mixin selector
      official a Lbki;a(Lahg;)V
      intermediary method_11285 Lnet/minecraft/class_8934;method_11285(Lnet/minecraft/class_2960;)V
      named setLootTableId Lnet/minecraft/inventory/LootableInventory;setLootTableId(Lnet/minecraft/util/Identifier;)V
    • getLootTableSeed

      public long getLootTableSeed()
      Returns the loot table's seed.

      Vanilla implementations return 0 when there is no loot table associated with the inventory, although it is not necessary.

      This is usually stored under the "LootTableSeed" NBT key.

      Specified by:
      getLootTableSeed in interface LootableInventory
      Returns:
      the loot table's seed
      Mappings:
      Namespace Name Mixin selector
      official aA_ Lbki;aA_()J
      intermediary method_54870 Lnet/minecraft/class_8934;method_54870()J
      named getLootTableSeed Lnet/minecraft/inventory/LootableInventory;getLootTableSeed()J
    • setLootTableSeed

      public void setLootTableSeed(long lootTableSeed)
      Sets the loot table's seed.

      Vanilla implementations return 0 when there is no loot table associated with the inventory, although it is not necessary.

      This is usually stored under the "LootTableSeed" NBT key.

      Specified by:
      setLootTableSeed in interface LootableInventory
      Mappings:
      Namespace Name Mixin selector
      official a Lbki;a(J)V
      intermediary method_54866 Lnet/minecraft/class_8934;method_54866(J)V
      named setLootTableSeed Lnet/minecraft/inventory/LootableInventory;setLootTableSeed(J)V
    • isEmpty

      public boolean isEmpty()
      Returns whether the inventory consists entirely of empty item stacks.
      Specified by:
      isEmpty in interface Inventory
      Returns:
      whether the inventory consists entirely of empty item stacks
      Mappings:
      Namespace Name Mixin selector
      official ai_ Lbju;ai_()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)
      Returns the stack currently stored at slot.

      If the slot is empty, or is outside the bounds of this inventory, this returns ItemStack.EMPTY.

      Specified by:
      getStack in interface Inventory
      Returns:
      the stack currently stored at slot
      Mappings:
      Namespace Name Mixin selector
      official a Lbju;a(I)Lcmy;
      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;
    • removeStack

      public ItemStack removeStack(int slot, int amount)
      Removes a specific number of items from slot.
      Specified by:
      removeStack in interface Inventory
      Returns:
      the removed items as a stack
      Mappings:
      Namespace Name Mixin selector
      official a Lbju;a(II)Lcmy;
      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;
    • removeStack

      public ItemStack removeStack(int slot)
      Removes the stack currently stored at slot.
      Specified by:
      removeStack in interface Inventory
      Returns:
      the stack previously stored at the indicated slot
      Mappings:
      Namespace Name Mixin selector
      official b Lbju;b(I)Lcmy;
      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)
      Sets the stack stored at slot to stack.
      Specified by:
      setStack in interface Inventory
      Mappings:
      Namespace Name Mixin selector
      official a Lbju;a(ILcmy;)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
    • canPlayerUse

      public boolean canPlayerUse(PlayerEntity player)
      Specified by:
      canPlayerUse in interface Inventory
      Returns:
      whether player can use this inventory
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lbju;a(Lcfi;)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
    • clear

      public void clear()
      Specified by:
      clear in interface Clearable
      Mappings:
      Namespace Name Mixin selector
      official a Lbjs;a()V
      intermediary method_5448 Lnet/minecraft/class_3829;method_5448()V
      named clear Lnet/minecraft/util/Clearable;clear()V
    • getHeldStacks

      protected abstract DefaultedList<ItemStack> getHeldStacks()
    • setInvStackList

      protected abstract void setInvStackList(DefaultedList<ItemStack> list)
      Mappings:
      Namespace Name Mixin selector
      official a Ldhz;a(Liq;)V
      intermediary method_11281 Lnet/minecraft/class_2621;method_11281(Lnet/minecraft/class_2371;)V
      named setInvStackList Lnet/minecraft/block/entity/LootableContainerBlockEntity;setInvStackList(Lnet/minecraft/util/collection/DefaultedList;)V
    • checkUnlocked

      public boolean checkUnlocked(PlayerEntity player)
      Overrides:
      checkUnlocked in class LockableContainerBlockEntity
      Mappings:
      Namespace Name Mixin selector
      official d Ldgp;d(Lcfi;)Z
      intermediary method_17489 Lnet/minecraft/class_2624;method_17489(Lnet/minecraft/class_1657;)Z
      named checkUnlocked Lnet/minecraft/block/entity/LockableContainerBlockEntity;checkUnlocked(Lnet/minecraft/entity/player/PlayerEntity;)Z
    • createMenu

      @Nullable public @Nullable ScreenHandler createMenu(int syncId, PlayerInventory playerInventory, PlayerEntity player)
      Specified by:
      createMenu in interface ScreenHandlerFactory
      Overrides:
      createMenu in class LockableContainerBlockEntity
      Mappings:
      Namespace Name Mixin selector
      official createMenu Lcjh;createMenu(ILcfh;Lcfi;)Lcib;
      intermediary createMenu Lnet/minecraft/class_1270;createMenu(ILnet/minecraft/class_1661;Lnet/minecraft/class_1657;)Lnet/minecraft/class_1703;
      named createMenu Lnet/minecraft/screen/ScreenHandlerFactory;createMenu(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/screen/ScreenHandler;