Class BlockEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
- All Implemented Interfaces:
ICapabilityProvider
,ICapabilityProviderImpl<BlockEntity>
,IForgeBlockEntity
- Direct Known Subclasses:
BannerBlockEntity
,BaseContainerBlockEntity
,BeaconBlockEntity
,BedBlockEntity
,BeehiveBlockEntity
,BellBlockEntity
,BrushableBlockEntity
,CampfireBlockEntity
,ChiseledBookShelfBlockEntity
,CommandBlockEntity
,ComparatorBlockEntity
,ConduitBlockEntity
,DaylightDetectorBlockEntity
,DecoratedPotBlockEntity
,EnchantingTableBlockEntity
,EnderChestBlockEntity
,FluidHandlerBlockEntity
,JigsawBlockEntity
,JukeboxBlockEntity
,LecternBlockEntity
,PistonMovingBlockEntity
,SculkCatalystBlockEntity
,SculkSensorBlockEntity
,SculkShriekerBlockEntity
,SignBlockEntity
,SkullBlockEntity
,SpawnerBlockEntity
,StructureBlockEntity
,TheEndPortalBlockEntity
,TrialSpawnerBlockEntity
,VaultBlockEntity
public abstract class BlockEntity
extends CapabilityProvider<BlockEntity>
implements IForgeBlockEntity
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
protected static interface
Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
CapabilityProvider.AsField<B extends ICapabilityProviderImpl<B>>
-
Field Summary
Modifier and TypeFieldDescriptionprivate BlockState
private DataComponentMap
protected Level
private static final org.slf4j.Logger
protected boolean
private final BlockEntityType
<?> protected final BlockPos
Fields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB
-
Constructor Summary
ConstructorDescriptionBlockEntity
(BlockEntityType<?> p_155228_, BlockPos p_155229_, BlockState p_155230_) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addEntityType
(CompoundTag p_187469_, BlockEntityType<?> p_187470_) final void
applyComponents
(DataComponentMap p_335232_, DataComponentPatch p_331646_) final void
applyComponentsFromItemStack
(ItemStack p_328941_) protected void
void
final DataComponentMap
protected void
void
fillCrashReportCategory
(CrashReportCategory p_58887_) getLevel()
static BlockPos
getPosFromTag
(CompoundTag p_187473_) getType()
getUpdateTag
(HolderLookup.Provider p_329179_) boolean
hasLevel()
boolean
protected void
loadAdditional
(CompoundTag p_331149_, HolderLookup.Provider p_333170_) final void
loadCustomOnly
(CompoundTag p_333694_, HolderLookup.Provider p_332017_) static BlockEntity
loadStatic
(BlockPos p_155242_, BlockState p_155243_, CompoundTag p_155244_, HolderLookup.Provider p_336084_) final void
loadWithComponents
(CompoundTag p_331756_, HolderLookup.Provider p_335164_) void
boolean
static Component
parseCustomNameSafe
(String p_336419_, HolderLookup.Provider p_336417_) void
removeComponentsFromTag
(CompoundTag p_334718_) Deprecated.protected void
saveAdditional
(CompoundTag p_187471_, HolderLookup.Provider p_327783_) final CompoundTag
saveCustomAndMetadata
(HolderLookup.Provider p_334487_) final CompoundTag
saveCustomOnly
(HolderLookup.Provider p_333091_) private void
saveId
(CompoundTag p_187475_) private void
saveMetadata
(CompoundTag p_187479_) void
saveToItem
(ItemStack p_187477_, HolderLookup.Provider p_336381_) final CompoundTag
saveWithFullMetadata
(HolderLookup.Provider p_331193_) final CompoundTag
saveWithId
(HolderLookup.Provider p_332686_) final CompoundTag
saveWithoutMetadata
(HolderLookup.Provider p_332372_) void
setBlockState
(BlockState p_155251_) Deprecated.void
protected static void
setChanged
(Level p_155233_, BlockPos p_155234_, BlockState p_155235_) void
setComponents
(DataComponentMap p_335672_) void
void
boolean
triggerEvent
(int p_58889_, int p_58890_) Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
getModelData, getRenderBoundingBox, handleUpdateTag, hasCustomOutlineRendering, onDataPacket, onLoad, requestModelDataUpdate
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
type
-
level
-
worldPosition
-
remove
protected boolean remove -
blockState
-
components
-
-
Constructor Details
-
BlockEntity
-
-
Method Details
-
getPosFromTag
-
getLevel
-
setLevel
-
hasLevel
public boolean hasLevel() -
loadAdditional
-
loadWithComponents
-
loadCustomOnly
-
saveAdditional
-
saveWithFullMetadata
-
saveWithId
-
saveWithoutMetadata
-
saveCustomOnly
-
saveCustomAndMetadata
-
saveId
-
addEntityType
-
saveToItem
-
saveMetadata
-
loadStatic
@Nullable public static BlockEntity loadStatic(BlockPos p_155242_, BlockState p_155243_, CompoundTag p_155244_, HolderLookup.Provider p_336084_) -
setChanged
public void setChanged() -
setChanged
-
getBlockPos
-
getBlockState
-
getUpdatePacket
-
getUpdateTag
-
isRemoved
public boolean isRemoved() -
setRemoved
public void setRemoved() -
onChunkUnloaded
public void onChunkUnloaded()- Specified by:
onChunkUnloaded
in interfaceIForgeBlockEntity
-
clearRemoved
public void clearRemoved() -
triggerEvent
public boolean triggerEvent(int p_58889_, int p_58890_) -
fillCrashReportCategory
-
onlyOpCanSetNbt
public boolean onlyOpCanSetNbt() -
getType
-
setBlockState
Deprecated. -
applyImplicitComponents
-
applyComponentsFromItemStack
-
applyComponents
-
collectImplicitComponents
-
removeComponentsFromTag
Deprecated. -
collectComponents
-
components
-
setComponents
-
parseCustomNameSafe
@Nullable public static Component parseCustomNameSafe(String p_336419_, HolderLookup.Provider p_336417_)
-