Class BlockEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
- All Implemented Interfaces:
- ICapabilityProvider,- ICapabilityProviderImpl<BlockEntity>,- ICapabilitySerializable<CompoundTag>,- IForgeBlockEntity,- INBTSerializable<CompoundTag>
- Direct Known Subclasses:
- BannerBlockEntity,- BaseContainerBlockEntity,- BeaconBlockEntity,- BedBlockEntity,- BeehiveBlockEntity,- BellBlockEntity,- BrushableBlockEntity,- CampfireBlockEntity,- ChiseledBookShelfBlockEntity,- CommandBlockEntity,- ComparatorBlockEntity,- ConduitBlockEntity,- DaylightDetectorBlockEntity,- DecoratedPotBlockEntity,- EnchantmentTableBlockEntity,- EnderChestBlockEntity,- FluidHandlerBlockEntity,- JigsawBlockEntity,- JukeboxBlockEntity,- LecternBlockEntity,- PistonMovingBlockEntity,- SculkCatalystBlockEntity,- SculkSensorBlockEntity,- SculkShriekerBlockEntity,- SignBlockEntity,- SkullBlockEntity,- SpawnerBlockEntity,- StructureBlockEntity,- TheEndPortalBlockEntity
public abstract class BlockEntity
extends CapabilityProvider<BlockEntity>
implements IForgeBlockEntity
- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProviderCapabilityProvider.AsField<B extends ICapabilityProviderImpl<B>>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate BlockStateprivate CompoundTagprotected Levelprivate static final org.slf4j.Loggerprotected booleanprivate final BlockEntityType<?>protected final BlockPosFields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntityINFINITE_EXTENT_AABB
- 
Constructor SummaryConstructorsConstructorDescriptionBlockEntity(BlockEntityType<?> p_155228_, BlockPos p_155229_, BlockState p_155230_) 
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidaddEntityType(CompoundTag p_187469_, BlockEntityType<?> p_187470_) voidvoidfillCrashReportCategory(CrashReportCategory p_58887_) getLevel()Gets aCompoundTagthat can be used to store custom data for this block entity.static BlockPosgetPosFromTag(CompoundTag p_187473_) getType()booleanhasLevel()booleanvoidload(CompoundTag p_155245_) static BlockEntityloadStatic(BlockPos p_155242_, BlockState p_155243_, CompoundTag p_155244_) voidbooleanprotected voidsaveAdditional(CompoundTag p_187471_) private voidsaveId(CompoundTag p_187475_) private voidsaveMetadata(CompoundTag p_187479_) voidsaveToItem(ItemStack p_187477_) final CompoundTagfinal CompoundTagfinal CompoundTagvoidsetBlockState(BlockState p_155251_) Deprecated.voidprotected static voidsetChanged(Level p_155233_, BlockPos p_155234_, BlockState p_155235_) voidvoidbooleantriggerEvent(int p_58889_, int p_58890_) Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProviderareCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCapsMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvidergetCapability, getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntitydeserializeNBT, getModelData, getRenderBoundingBox, handleUpdateTag, hasCustomOutlineRendering, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
- 
Field Details- 
LOGGERprivate static final org.slf4j.Logger LOGGER
- 
type
- 
level
- 
worldPosition
- 
removeprotected boolean remove
- 
blockState
- 
customPersistentData
 
- 
- 
Constructor Details- 
BlockEntity
 
- 
- 
Method Details- 
getPosFromTag
- 
getLevel
- 
setLevel
- 
hasLevelpublic boolean hasLevel()
- 
load
- 
saveAdditional
- 
saveWithFullMetadata
- 
saveWithId
- 
saveWithoutMetadata
- 
saveId
- 
addEntityType
- 
saveToItem
- 
saveMetadata
- 
loadStatic@Nullable public static BlockEntity loadStatic(BlockPos p_155242_, BlockState p_155243_, CompoundTag p_155244_) 
- 
setChangedpublic void setChanged()
- 
setChanged
- 
getBlockPos
- 
getBlockState
- 
getUpdatePacket
- 
getUpdateTag
- 
isRemovedpublic boolean isRemoved()
- 
setRemovedpublic void setRemoved()
- 
onChunkUnloadedpublic void onChunkUnloaded()- Specified by:
- onChunkUnloadedin interface- IForgeBlockEntity
 
- 
clearRemovedpublic void clearRemoved()
- 
triggerEventpublic boolean triggerEvent(int p_58889_, int p_58890_) 
- 
fillCrashReportCategory
- 
onlyOpCanSetNbtpublic boolean onlyOpCanSetNbt()
- 
getType
- 
getPersistentDataDescription copied from interface:IForgeBlockEntityGets aCompoundTagthat can be used to store custom data for this block entity. It will be written, and read from disc, so it persists over world saves.- Specified by:
- getPersistentDatain interface- IForgeBlockEntity
- Returns:
- A compound tag for custom persistent data
 
- 
setBlockStateDeprecated.
 
-