Class BlockEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
- All Implemented Interfaces:
ICapabilityProvider
,ICapabilitySerializable<CompoundTag>
,IForgeBlockEntity
,INBTSerializable<CompoundTag>
- Direct Known Subclasses:
BannerBlockEntity
,BaseContainerBlockEntity
,BeaconBlockEntity
,BedBlockEntity
,BeehiveBlockEntity
,BellBlockEntity
,BlockEntityOnLoadTest.TestBlockEntity
,CampfireBlockEntity
,CommandBlockEntity
,ComparatorBlockEntity
,ConduitBlockEntity
,DaylightDetectorBlockEntity
,EnchantmentTableBlockEntity
,EnderChestBlockEntity
,FullPotsAccessorDemo.DioriteFlowerPotBlockEntity
,JigsawBlockEntity
,JukeboxBlockEntity
,LecternBlockEntity
,PistonMovingBlockEntity
,SculkSensorBlockEntity
,SignBlockEntity
,SkullBlockEntity
,SpawnerBlockEntity
,StructureBlockEntity
,TheEndPortalBlockEntity
,TileFluidHandler
public abstract class BlockEntity
extends CapabilityProvider<BlockEntity>
implements IForgeBlockEntity
-
Field Summary
Modifier and TypeFieldDescriptionprivate BlockState
private CompoundTag
protected Level
private static org.apache.logging.log4j.Logger
protected boolean
private BlockEntityType<?>
protected 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 TypeMethodDescriptionvoid
void
fillCrashReportCategory(CrashReportCategory p_58887_)
getLevel()
Gets aCompoundTag
that can be used to store custom data for this tile entity.getType()
boolean
hasLevel()
boolean
void
load(CompoundTag p_155245_)
static BlockEntity
loadStatic(BlockPos p_155242_, BlockState p_155243_, CompoundTag p_155244_)
void
boolean
save(CompoundTag p_58888_)
private CompoundTag
saveMetadata(CompoundTag p_58895_)
void
setBlockState(BlockState p_155251_)
Deprecated.void
protected static void
setChanged(Level p_155233_, BlockPos p_155234_, BlockState p_155235_)
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
deserializeNBT, getModelData, getRenderBoundingBox, handleUpdateTag, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
type
-
level
-
worldPosition
-
remove
protected boolean remove -
blockState
-
customTileData
-
-
Constructor Details
-
BlockEntity
-
-
Method Details
-
getLevel
-
setLevel
-
hasLevel
public boolean hasLevel() -
load
-
save
-
saveMetadata
-
loadStatic
@Nullable public static BlockEntity loadStatic(BlockPos p_155242_, BlockState p_155243_, CompoundTag p_155244_) -
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
-
getTileData
Description copied from interface:IForgeBlockEntity
Gets aCompoundTag
that can be used to store custom data for this tile entity. It will be written, and read from disc, so it persists over world saves.- Specified by:
getTileData
in interfaceIForgeBlockEntity
- Returns:
- A compound tag for custom data
-
setBlockState
Deprecated.
-