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:
Iterable<ItemStack>,Inventory,LootableInventory,NamedScreenHandlerFactory,ScreenHandlerFactory,Clearable,Nameable,DebugTrackable
- Direct Known Subclasses:
BarrelBlockEntity,ChestBlockEntity,CrafterBlockEntity,DispenserBlockEntity,HopperBlockEntity,ShulkerBoxBlockEntity
public abstract class LootableContainerBlockEntity
extends LockableContainerBlockEntity
implements LootableInventory
- Mappings:
Namespace Name named net/minecraft/block/entity/LootableContainerBlockEntityintermediary net/minecraft/class_2621official ejs
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.debug.DebugTrackable
DebugTrackable.DebugDataSupplier<T>, DebugTrackable.TrackerNested classes/interfaces inherited from interface net.minecraft.inventory.Inventory
Inventory.Iterator -
Field Summary
FieldsFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, worldFields inherited from interface net.minecraft.inventory.Inventory
DEFAULT_MAX_INTERACTION_RANGEFields 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 TypeMethodDescriptionprotected voidaddComponents(ComponentMap.Builder builder) booleancheckUnlocked(PlayerEntity player) createMenu(int syncId, PlayerInventory playerInventory, PlayerEntity player) 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.protected voidreadComponents(ComponentsAccess components) voidremoveStack(int slot) Removes the stack currently stored atslot.removeStack(int slot, int amount) Removes a specific number of items fromslot.voidsetLootTable(@Nullable RegistryKey<LootTable> lootTable) voidsetLootTableSeed(long lootTableSeed) Sets the loot table's seed.voidSets the stack stored atslottostack.Methods inherited from class net.minecraft.block.entity.LockableContainerBlockEntity
canPlayerUse, checkUnlocked, clear, createScreenHandler, getContainerName, getCustomName, getDisplayName, getHeldStacks, getName, isLocked, readData, setHeldStacks, writeDataMethods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, createComponentlessNbt, createComponentMap, createFromNbt, createNbt, createNbtWithIdentifyingData, getCachedState, getComponents, getNameForReport, getPos, getReporterContext, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onBlockReplaced, onSyncedBlockEvent, populateCrashReport, posFromNbt, read, readComponentlessData, readComponents, readComponents, registerTracking, setCachedState, setComponents, setWorld, supports, toInitialChunkDataNbt, toUpdatePacket, tryParseCustomName, writeComponentlessData, writeDataWithId, writeDataWithoutId, writeFullData, writeIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.inventory.Inventory
canPlayerUse, canTransferTo, containsAny, containsAny, count, getMaxCount, getMaxCountPerStack, getViewingUsers, isValid, iterator, markDirty, onClose, onOpen, sizeMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface net.minecraft.inventory.LootableInventory
generateLoot, getPos, getWorld, readLootTable, setLootTable, writeLootTableMethods inherited from interface net.minecraft.util.Nameable
getStringifiedName, hasCustomName
-
Field Details
-
lootTable
- Mappings:
Namespace Name Mixin selector named lootTableLnet/minecraft/block/entity/LootableContainerBlockEntity;lootTable:Lnet/minecraft/registry/RegistryKey;intermediary field_12037Lnet/minecraft/class_2621;field_12037:Lnet/minecraft/class_5321;official lLejs;l:Lamx;
-
lootTableSeed
protected long lootTableSeed- Mappings:
Namespace Name Mixin selector named lootTableSeedLnet/minecraft/block/entity/LootableContainerBlockEntity;lootTableSeed:Jintermediary field_12036Lnet/minecraft/class_2621;field_12036:Jofficial mLejs;m:J
-
-
Constructor Details
-
LootableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/block/entity/BlockEntity;<init>(Lnet/minecraft/block/entity/BlockEntityType;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary <init>Lnet/minecraft/class_2586;<init>(Lnet/minecraft/class_2591;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial <init>Leih;<init>(Leij;Liz;Leln;)V
-
-
Method Details
-
getLootTable
- Specified by:
getLootTablein interfaceLootableInventory- Mappings:
Namespace Name Mixin selector named getLootTableLnet/minecraft/inventory/LootableInventory;getLootTable()Lnet/minecraft/registry/RegistryKey;intermediary method_54869Lnet/minecraft/class_8934;method_54869()Lnet/minecraft/class_5321;official ay_Lcdg;ay_()Lamx;
-
setLootTable
- Specified by:
setLootTablein interfaceLootableInventory- Mappings:
Namespace Name Mixin selector named setLootTableLnet/minecraft/inventory/LootableInventory;setLootTable(Lnet/minecraft/registry/RegistryKey;)Vintermediary method_11285Lnet/minecraft/class_8934;method_11285(Lnet/minecraft/class_5321;)Vofficial aLcdg;a(Lamx;)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 named getLootTableSeedLnet/minecraft/inventory/LootableInventory;getLootTableSeed()Jintermediary method_54870Lnet/minecraft/class_8934;method_54870()Jofficial aB_Lcdg;aB_()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 named setLootTableSeedLnet/minecraft/inventory/LootableInventory;setLootTableSeed(J)Vintermediary method_54866Lnet/minecraft/class_8934;method_54866(J)Vofficial aLcdg;a(J)V
-
isEmpty
public boolean isEmpty()Returns whether the inventory consists entirely of empty item stacks.- Specified by:
isEmptyin interfaceInventory- Overrides:
isEmptyin classLockableContainerBlockEntity- Returns:
- whether the inventory consists entirely of empty item stacks
- Mappings:
Namespace Name Mixin selector named isEmptyLnet/minecraft/inventory/Inventory;isEmpty()Zintermediary method_5442Lnet/minecraft/class_1263;method_5442()Zofficial cLccs;c()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- Overrides:
getStackin classLockableContainerBlockEntity- Returns:
- the stack currently stored at
slot - Mappings:
Namespace Name Mixin selector named getStackLnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;intermediary method_5438Lnet/minecraft/class_1263;method_5438(I)Lnet/minecraft/class_1799;official aLccs;a(I)Ldji;
-
removeStack
Removes a specific number of items fromslot.- Specified by:
removeStackin interfaceInventory- Overrides:
removeStackin classLockableContainerBlockEntity- Returns:
- the removed items as a stack
- Mappings:
Namespace Name Mixin selector named removeStackLnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;intermediary method_5434Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;official aLccs;a(II)Ldji;
-
removeStack
Removes the stack currently stored atslot.- Specified by:
removeStackin interfaceInventory- Overrides:
removeStackin classLockableContainerBlockEntity- Returns:
- the stack previously stored at the indicated slot
- Mappings:
Namespace Name Mixin selector named removeStackLnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;intermediary method_5441Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;official bLccs;b(I)Ldji;
-
setStack
Sets the stack stored atslottostack.- Specified by:
setStackin interfaceInventory- Overrides:
setStackin classLockableContainerBlockEntity- Mappings:
Namespace Name Mixin selector named setStackLnet/minecraft/inventory/Inventory;setStack(ILnet/minecraft/item/ItemStack;)Vintermediary method_5447Lnet/minecraft/class_1263;method_5447(ILnet/minecraft/class_1799;)Vofficial aLccs;a(ILdji;)V
-
checkUnlocked
- Overrides:
checkUnlockedin classLockableContainerBlockEntity- Mappings:
Namespace Name Mixin selector named checkUnlockedLnet/minecraft/block/entity/LockableContainerBlockEntity;checkUnlocked(Lnet/minecraft/entity/player/PlayerEntity;)Zintermediary method_17489Lnet/minecraft/class_2624;method_17489(Lnet/minecraft/class_1657;)Zofficial bLeia;b(Ldbe;)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 named createMenuLnet/minecraft/screen/ScreenHandlerFactory;createMenu(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/screen/ScreenHandler;intermediary createMenuLnet/minecraft/class_1270;createMenu(ILnet/minecraft/class_1661;Lnet/minecraft/class_1657;)Lnet/minecraft/class_1703;official createMenuLdgh;createMenu(ILdbd;Ldbe;)Ldez;
-
readComponents
- Overrides:
readComponentsin classLockableContainerBlockEntity- Mappings:
Namespace Name Mixin selector named readComponentsLnet/minecraft/block/entity/BlockEntity;readComponents(Lnet/minecraft/component/ComponentsAccess;)Vintermediary method_57568Lnet/minecraft/class_2586;method_57568(Lnet/minecraft/class_9473;)Vofficial aLeih;a(Lkj;)V
-
addComponents
- Overrides:
addComponentsin classLockableContainerBlockEntity- Mappings:
Namespace Name Mixin selector named addComponentsLnet/minecraft/block/entity/BlockEntity;addComponents(Lnet/minecraft/component/ComponentMap$Builder;)Vintermediary method_57567Lnet/minecraft/class_2586;method_57567(Lnet/minecraft/class_9323$class_9324;)Vofficial aLeih;a(Lkl$a;)V
-
removeFromCopiedStackData
- Overrides:
removeFromCopiedStackDatain classLockableContainerBlockEntity- Mappings:
Namespace Name Mixin selector named removeFromCopiedStackDataLnet/minecraft/block/entity/BlockEntity;removeFromCopiedStackData(Lnet/minecraft/storage/WriteView;)Vintermediary method_57569Lnet/minecraft/class_2586;method_57569(Lnet/minecraft/class_11372;)Vofficial bLeih;b(Lfks;)V
-