Package net.minecraft.block.entity
Class LootableContainerBlockEntity
java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.LockableContainerBlockEntity
net.minecraft.block.entity.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 dhzintermediary net/minecraft/class_2621named net/minecraft/block/entity/LootableContainerBlockEntity
-
Field Summary
FieldsFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, worldFields inherited from interface net.minecraft.inventory.Inventory
field_42619, MAX_COUNT_PER_STACKFields inherited from interface net.minecraft.inventory.LootableInventory
LOOT_TABLE_KEY, LOOT_TABLE_SEED_KEY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLootableContainerBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanPlayerUse(PlayerEntity player) Returns whetherplayercan use this inventory.booleancheckUnlocked(PlayerEntity player) voidclear()createMenu(int syncId, PlayerInventory playerInventory, PlayerEntity player) protected abstract DefaultedList<ItemStack>Returns the loot table ID, ornullif there is no associated loot table.longReturns the loot table's seed.getStack(int slot) Returns the stack currently stored atslot.booleanisEmpty()Returns whether the inventory consists entirely of empty item stacks.removeStack(int slot) Removes the stack currently stored atslot.removeStack(int slot, int amount) Removes a specific number of items fromslot.protected abstract voidvoidsetLootTableId(@Nullable Identifier lootTableId) Sets the loot table ID.voidsetLootTableSeed(long lootTableSeed) Sets the loot table's seed.voidSets the stack stored atslottostack.Methods inherited from class net.minecraft.block.entity.LockableContainerBlockEntity
checkUnlocked, createScreenHandler, getContainerName, getCustomName, getDisplayName, getName, readNbt, setCustomName, writeNbtMethods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, copyItemDataRequiresOperator, createFromNbt, createNbt, createNbtWithId, createNbtWithIdentifyingData, getCachedState, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, setCachedState, setStackNbt, setWorld, toInitialChunkDataNbt, toUpdatePacket, writeIdToNbtMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.inventory.Inventory
canTransferTo, containsAny, containsAny, count, getMaxCountPerStack, isValid, markDirty, onClose, onOpen, sizeMethods inherited from interface net.minecraft.inventory.LootableInventory
generateLoot, getPos, getWorld, readLootTable, setLootTable, writeLootTableMethods inherited from interface net.minecraft.util.Nameable
hasCustomName
-
Field Details
-
lootTableId
- Mappings:
Namespace Name Mixin selector official mLdhz;m:Lahg;intermediary field_12037Lnet/minecraft/class_2621;field_12037:Lnet/minecraft/class_2960;named lootTableIdLnet/minecraft/block/entity/LootableContainerBlockEntity;lootTableId:Lnet/minecraft/util/Identifier;
-
lootTableSeed
protected long lootTableSeed- Mappings:
Namespace Name Mixin selector official nLdhz;n:Jintermediary field_12036Lnet/minecraft/class_2621;field_12036:Jnamed lootTableSeedLnet/minecraft/block/entity/LootableContainerBlockEntity;lootTableSeed:J
-
-
Constructor Details
-
LootableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector official <init>Ldgv;<init>(Ldgx;Lhx;Ldjh;)Vintermediary <init>Lnet/minecraft/class_2586;<init>(Lnet/minecraft/class_2591;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vnamed <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
Returns the loot table ID, ornullif there is no associated loot table.This is usually stored under the "LootTable" NBT key.
- Specified by:
getLootTableIdin interfaceLootableInventory- Returns:
- the loot table ID, or
nullif there is no associated loot table - Mappings:
Namespace Name Mixin selector official az_Lbki;az_()Lahg;intermediary method_54869Lnet/minecraft/class_8934;method_54869()Lnet/minecraft/class_2960;named getLootTableIdLnet/minecraft/inventory/LootableInventory;getLootTableId()Lnet/minecraft/util/Identifier;
-
setLootTableId
Sets the loot table ID.This is usually stored under the "LootTable" NBT key.
- Specified by:
setLootTableIdin interfaceLootableInventory- Parameters:
lootTableId- the loot table ID, ornullto remove the loot table- Mappings:
Namespace Name Mixin selector official aLbki;a(Lahg;)Vintermediary method_11285Lnet/minecraft/class_8934;method_11285(Lnet/minecraft/class_2960;)Vnamed setLootTableIdLnet/minecraft/inventory/LootableInventory;setLootTableId(Lnet/minecraft/util/Identifier;)V
-
getLootTableSeed
public long getLootTableSeed()Returns the loot table's seed.Vanilla implementations return
0when 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:
getLootTableSeedin interfaceLootableInventory- Returns:
- the loot table's seed
- Mappings:
Namespace Name Mixin selector official aA_Lbki;aA_()Jintermediary method_54870Lnet/minecraft/class_8934;method_54870()Jnamed getLootTableSeedLnet/minecraft/inventory/LootableInventory;getLootTableSeed()J
-
setLootTableSeed
public void setLootTableSeed(long lootTableSeed) Sets the loot table's seed.Vanilla implementations return
0when 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:
setLootTableSeedin interfaceLootableInventory- Mappings:
Namespace Name Mixin selector official aLbki;a(J)Vintermediary method_54866Lnet/minecraft/class_8934;method_54866(J)Vnamed setLootTableSeedLnet/minecraft/inventory/LootableInventory;setLootTableSeed(J)V
-
isEmpty
public boolean isEmpty()Returns whether the inventory consists entirely of empty item stacks.- Specified by:
isEmptyin interfaceInventory- Returns:
- whether the inventory consists entirely of empty item stacks
- Mappings:
Namespace Name Mixin selector official ai_Lbju;ai_()Zintermediary method_5442Lnet/minecraft/class_1263;method_5442()Znamed isEmptyLnet/minecraft/inventory/Inventory;isEmpty()Z
-
getStack
Returns the stack currently stored atslot.If the slot is empty, or is outside the bounds of this inventory, this returns
ItemStack.EMPTY.- Specified by:
getStackin interfaceInventory- Returns:
- the stack currently stored at
slot - Mappings:
Namespace Name Mixin selector official aLbju;a(I)Lcmy;intermediary method_5438Lnet/minecraft/class_1263;method_5438(I)Lnet/minecraft/class_1799;named getStackLnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;
-
removeStack
Removes a specific number of items fromslot.- Specified by:
removeStackin interfaceInventory- Returns:
- the removed items as a stack
- Mappings:
Namespace Name Mixin selector official aLbju;a(II)Lcmy;intermediary method_5434Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;named removeStackLnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;
-
removeStack
Removes the stack currently stored atslot.- Specified by:
removeStackin interfaceInventory- Returns:
- the stack previously stored at the indicated slot
- Mappings:
Namespace Name Mixin selector official bLbju;b(I)Lcmy;intermediary method_5441Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;named removeStackLnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;
-
setStack
Sets the stack stored atslottostack. -
canPlayerUse
Returns whetherplayercan use this inventory.This is called by
ScreenHandler.canUse(net.minecraft.screen.ScreenHandlerContext, net.minecraft.entity.player.PlayerEntity, net.minecraft.block.Block).- Specified by:
canPlayerUsein interfaceInventory- Returns:
- whether
playercan use this inventory - See Also:
- Mappings:
Namespace Name Mixin selector official aLbju;a(Lcfi;)Zintermediary method_5443Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Znamed canPlayerUseLnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
-
clear
public void clear() -
getHeldStacks
-
setInvStackList
- Mappings:
Namespace Name Mixin selector official aLdhz;a(Liq;)Vintermediary method_11281Lnet/minecraft/class_2621;method_11281(Lnet/minecraft/class_2371;)Vnamed setInvStackListLnet/minecraft/block/entity/LootableContainerBlockEntity;setInvStackList(Lnet/minecraft/util/collection/DefaultedList;)V
-
checkUnlocked
- Overrides:
checkUnlockedin classLockableContainerBlockEntity- Mappings:
Namespace Name Mixin selector official dLdgp;d(Lcfi;)Zintermediary method_17489Lnet/minecraft/class_2624;method_17489(Lnet/minecraft/class_1657;)Znamed checkUnlockedLnet/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:
createMenuin interfaceScreenHandlerFactory- Overrides:
createMenuin classLockableContainerBlockEntity- Mappings:
Namespace Name Mixin selector official createMenuLcjh;createMenu(ILcfh;Lcfi;)Lcib;intermediary createMenuLnet/minecraft/class_1270;createMenu(ILnet/minecraft/class_1661;Lnet/minecraft/class_1657;)Lnet/minecraft/class_1703;named createMenuLnet/minecraft/screen/ScreenHandlerFactory;createMenu(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/screen/ScreenHandler;
-