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 dor
intermediary net/minecraft/class_2621
named net/minecraft/block/entity/LootableContainerBlockEntity
-
Field Summary
FieldsFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world
Fields inherited from interface net.minecraft.inventory.Inventory
DEFAULT_MAX_INTERACTION_RANGE
Fields inherited from interface net.minecraft.inventory.LootableInventory
LOOT_TABLE_KEY, LOOT_TABLE_SEED_KEY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
LootableContainerBlockEntity
(BlockEntityType<?> type, BlockPos pos, BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addComponents
(ComponentMap.Builder componentMapBuilder) boolean
checkUnlocked
(PlayerEntity player) createMenu
(int syncId, PlayerInventory playerInventory, PlayerEntity player) long
Returns the loot table's seed.getStack
(int slot) Returns the stack currently stored atslot
.boolean
isEmpty()
Returns whether the inventory consists entirely of empty item stacks.void
readComponents
(ComponentMap components) void
removeStack
(int slot) Removes the stack currently stored atslot
.removeStack
(int slot, int amount) Removes a specific number of items fromslot
.void
setLootTable
(@Nullable RegistryKey<LootTable> lootTable) void
setLootTableSeed
(long lootTableSeed) Sets the loot table's seed.void
Sets the stack stored atslot
tostack
.Methods inherited from class net.minecraft.block.entity.LockableContainerBlockEntity
canPlayerUse, checkUnlocked, clear, createScreenHandler, getContainerName, getCustomName, getDisplayName, getHeldStacks, getName, readNbt, setHeldStacks, writeNbt
Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, copyItemDataRequiresOperator, createComponentMap, createFromNbt, createNbt, createNbtWithId, createNbtWithIdentifyingData, getCachedState, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, setCachedState, setStackNbt, setWorld, toInitialChunkDataNbt, toUpdatePacket, writeIdToNbt
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.inventory.Inventory
canPlayerUse, canTransferTo, containsAny, containsAny, count, getMaxCount, getMaxCountPerStack, isValid, markDirty, onClose, onOpen, size
Methods inherited from interface net.minecraft.inventory.LootableInventory
generateLoot, getPos, getWorld, readLootTable, setLootTable, writeLootTable
Methods inherited from interface net.minecraft.util.Nameable
hasCustomName
-
Field Details
-
lootTable
- Mappings:
Namespace Name Mixin selector official l
Ldor;l:Lakg;
intermediary field_12037
Lnet/minecraft/class_2621;field_12037:Lnet/minecraft/class_5321;
named lootTable
Lnet/minecraft/block/entity/LootableContainerBlockEntity;lootTable:Lnet/minecraft/registry/RegistryKey;
-
lootTableSeed
protected long lootTableSeed- Mappings:
Namespace Name Mixin selector official m
Ldor;m:J
intermediary field_12036
Lnet/minecraft/class_2621;field_12036:J
named lootTableSeed
Lnet/minecraft/block/entity/LootableContainerBlockEntity;lootTableSeed:J
-
-
Constructor Details
-
LootableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector official <init>
Ldnm;<init>(Ldno;Lin;Ldqh;)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
-
getLootTable
- Specified by:
getLootTable
in interfaceLootableInventory
- Mappings:
Namespace Name Mixin selector official ax_
Lbpu;ax_()Lakg;
intermediary method_54869
Lnet/minecraft/class_8934;method_54869()Lnet/minecraft/class_5321;
named getLootTable
Lnet/minecraft/inventory/LootableInventory;getLootTable()Lnet/minecraft/registry/RegistryKey;
-
setLootTable
- Specified by:
setLootTable
in interfaceLootableInventory
- Mappings:
Namespace Name Mixin selector official a
Lbpu;a(Lakg;)V
intermediary method_11285
Lnet/minecraft/class_8934;method_11285(Lnet/minecraft/class_5321;)V
named setLootTable
Lnet/minecraft/inventory/LootableInventory;setLootTable(Lnet/minecraft/registry/RegistryKey;)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 interfaceLootableInventory
- Returns:
- the loot table's seed
- Mappings:
Namespace Name Mixin selector official ay_
Lbpu;ay_()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 interfaceLootableInventory
- Mappings:
Namespace Name Mixin selector official a
Lbpu;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 interfaceInventory
- Overrides:
isEmpty
in classLockableContainerBlockEntity
- Returns:
- whether the inventory consists entirely of empty item stacks
- Mappings:
Namespace Name Mixin selector official c
Lbpf;c()Z
intermediary method_5442
Lnet/minecraft/class_1263;method_5442()Z
named isEmpty
Lnet/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:
getStack
in interfaceInventory
- Overrides:
getStack
in classLockableContainerBlockEntity
- Returns:
- the stack currently stored at
slot
- Mappings:
Namespace Name Mixin selector official a
Lbpf;a(I)Lcsz;
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
Removes a specific number of items fromslot
.- Specified by:
removeStack
in interfaceInventory
- Overrides:
removeStack
in classLockableContainerBlockEntity
- Returns:
- the removed items as a stack
- Mappings:
Namespace Name Mixin selector official a
Lbpf;a(II)Lcsz;
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
Removes the stack currently stored atslot
.- Specified by:
removeStack
in interfaceInventory
- Overrides:
removeStack
in classLockableContainerBlockEntity
- Returns:
- the stack previously stored at the indicated slot
- Mappings:
Namespace Name Mixin selector official b
Lbpf;b(I)Lcsz;
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
Sets the stack stored atslot
tostack
.- Specified by:
setStack
in interfaceInventory
- Overrides:
setStack
in classLockableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector official a
Lbpf;a(ILcsz;)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
-
checkUnlocked
- Overrides:
checkUnlocked
in classLockableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector official d
Ldng;d(Lclh;)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 interfaceScreenHandlerFactory
- Overrides:
createMenu
in classLockableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector official createMenu
Lcpk;createMenu(ILclg;Lclh;)Lcod;
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;
-
readComponents
- Overrides:
readComponents
in classLockableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector official a
Ldnm;a(Ljw;)V
intermediary method_57568
Lnet/minecraft/class_2586;method_57568(Lnet/minecraft/class_9323;)V
named readComponents
Lnet/minecraft/block/entity/BlockEntity;readComponents(Lnet/minecraft/component/ComponentMap;)V
-
addComponents
- Overrides:
addComponents
in classLockableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector official a
Ldnm;a(Ljw$a;)V
intermediary method_57567
Lnet/minecraft/class_2586;method_57567(Lnet/minecraft/class_9323$class_9324;)V
named addComponents
Lnet/minecraft/block/entity/BlockEntity;addComponents(Lnet/minecraft/component/ComponentMap$Builder;)V
-
removeFromCopiedStackNbt
- Overrides:
removeFromCopiedStackNbt
in classLockableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector official a
Ldnm;a(Lua;)V
intermediary method_57569
Lnet/minecraft/class_2586;method_57569(Lnet/minecraft/class_2487;)V
named removeFromCopiedStackNbt
Lnet/minecraft/block/entity/BlockEntity;removeFromCopiedStackNbt(Lnet/minecraft/nbt/NbtCompound;)V
-