Class RandomizableContainerBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BaseContainerBlockEntity
net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
- All Implemented Interfaces:
Clearable
,Container
,MenuConstructor
,MenuProvider
,Nameable
,RandomizableContainer
,IAttachmentHolder
,IMenuProviderExtension
,IBlockEntityExtension
- Direct Known Subclasses:
BarrelBlockEntity
,ChestBlockEntity
,CrafterBlockEntity
,DispenserBlockEntity
,HopperBlockEntity
,ShulkerBoxBlockEntity
public abstract class RandomizableContainerBlockEntity
extends BaseContainerBlockEntity
implements RandomizableContainer
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
BlockEntity.ComponentHelper, BlockEntity.DataComponentInput
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField
-
Field Summary
Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPosition
Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY
Fields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER
Fields inherited from interface net.minecraft.world.RandomizableContainer
LOOT_TABLE_SEED_TAG, LOOT_TABLE_TAG
-
Constructor Summary
ModifierConstructorDescriptionprotected
RandomizableContainerBlockEntity
(BlockEntityType<?> p_155629_, BlockPos p_155630_, BlockState p_155631_) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
boolean
protected void
createMenu
(int p_59637_, Inventory p_59638_, Player p_59639_) getItem
(int p_59611_) long
boolean
isEmpty()
void
removeComponentsFromTag
(CompoundTag p_331200_) removeItem
(int p_59613_, int p_59614_) removeItemNoUpdate
(int p_59630_) void
void
setLootTable
(ResourceKey<LootTable> p_335597_) void
setLootTableSeed
(long p_309615_) Methods inherited from class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
canUnlock, clearContent, createMenu, getCustomName, getDefaultName, getDisplayName, getItems, getName, loadAdditional, saveAdditional, setItems, stillValid
Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeData, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, triggerEvent
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachments
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.world.Clearable
clearContent
Methods inherited from interface net.minecraft.world.Container
canPlaceItem, canTakeItem, countItem, getContainerSize, getMaxStackSize, getMaxStackSize, hasAnyMatching, hasAnyOf, setChanged, startOpen, stillValid, stopOpen
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, hasData, removeData, setData
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate
Methods inherited from interface net.neoforged.neoforge.client.extensions.IMenuProviderExtension
shouldTriggerClientSideContainerClosingOnOpen
Methods inherited from interface net.minecraft.world.Nameable
hasCustomName
Methods inherited from interface net.minecraft.world.RandomizableContainer
getBlockPos, getLevel, setLootTable, tryLoadLootTable, trySaveLootTable, unpackLootTable
-
Field Details
-
lootTable
-
lootTableSeed
protected long lootTableSeed
-
-
Constructor Details
-
RandomizableContainerBlockEntity
protected RandomizableContainerBlockEntity(BlockEntityType<?> p_155629_, BlockPos p_155630_, BlockState p_155631_)
-
-
Method Details
-
getLootTable
- Specified by:
getLootTable
in interfaceRandomizableContainer
-
setLootTable
- Specified by:
setLootTable
in interfaceRandomizableContainer
-
getLootTableSeed
public long getLootTableSeed()- Specified by:
getLootTableSeed
in interfaceRandomizableContainer
-
setLootTableSeed
public void setLootTableSeed(long p_309615_) - Specified by:
setLootTableSeed
in interfaceRandomizableContainer
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceContainer
- Overrides:
isEmpty
in classBaseContainerBlockEntity
-
getItem
- Specified by:
getItem
in interfaceContainer
- Overrides:
getItem
in classBaseContainerBlockEntity
-
removeItem
- Specified by:
removeItem
in interfaceContainer
- Overrides:
removeItem
in classBaseContainerBlockEntity
-
removeItemNoUpdate
- Specified by:
removeItemNoUpdate
in interfaceContainer
- Overrides:
removeItemNoUpdate
in classBaseContainerBlockEntity
-
setItem
- Specified by:
setItem
in interfaceContainer
- Overrides:
setItem
in classBaseContainerBlockEntity
-
canOpen
- Overrides:
canOpen
in classBaseContainerBlockEntity
-
createMenu
@Nullable public AbstractContainerMenu createMenu(int p_59637_, Inventory p_59638_, Player p_59639_) - Specified by:
createMenu
in interfaceMenuConstructor
- Overrides:
createMenu
in classBaseContainerBlockEntity
-
applyImplicitComponents
- Overrides:
applyImplicitComponents
in classBaseContainerBlockEntity
-
collectImplicitComponents
- Overrides:
collectImplicitComponents
in classBaseContainerBlockEntity
-
removeComponentsFromTag
- Overrides:
removeComponentsFromTag
in classBaseContainerBlockEntity
-