Package net.minecraft.block.entity
Class BlockEntity
java.lang.Object
net.minecraft.block.entity.BlockEntity
- Direct Known Subclasses:
BannerBlockEntity
,BeaconBlockEntity
,BedBlockEntity
,BeehiveBlockEntity
,BellBlockEntity
,CampfireBlockEntity
,CommandBlockBlockEntity
,ComparatorBlockEntity
,ConduitBlockEntity
,DaylightDetectorBlockEntity
,EnchantingTableBlockEntity
,EnderChestBlockEntity
,EndPortalBlockEntity
,JigsawBlockEntity
,JukeboxBlockEntity
,LecternBlockEntity
,LockableContainerBlockEntity
,MobSpawnerBlockEntity
,PistonBlockEntity
,SignBlockEntity
,SkullBlockEntity
,StructureBlockBlockEntity
public abstract class BlockEntity extends Object
-
Field Summary
Fields Modifier and Type Field Description private BlockState
cachedState
private boolean
invalid
private static Logger
LOGGER
protected BlockPos
pos
protected boolean
removed
private BlockEntityType<?>
type
protected World
world
-
Constructor Summary
Constructors Constructor Description BlockEntity(BlockEntityType<?> type)
-
Method Summary
Modifier and Type Method Description void
applyMirror(BlockMirror mirror)
void
applyRotation(BlockRotation rotation)
void
cancelRemoval()
boolean
copyItemDataRequiresOperator()
static BlockEntity
createFromTag(BlockState state, CompoundTag tag)
void
fromTag(BlockState state, CompoundTag tag)
BlockState
getCachedState()
BlockPos
getPos()
double
getSquaredRenderDistance()
BlockEntityType<?>
getType()
World
getWorld()
boolean
hasWorld()
boolean
isRemoved()
void
markDirty()
void
markInvalid()
void
markRemoved()
boolean
onSyncedBlockEvent(int type, int data)
void
populateCrashReport(CrashReportSection crashReportSection)
void
resetBlock()
void
setLocation(World world, BlockPos pos)
void
setPos(BlockPos pos)
CompoundTag
toInitialChunkDataTag()
CompoundTag
toTag(CompoundTag tag)
BlockEntityUpdateS2CPacket
toUpdatePacket()
private CompoundTag
writeIdentifyingData(CompoundTag tag)
-
Field Details
-
LOGGER
-
type
-
world
-
pos
-
removed
protected boolean removed -
cachedState
-
invalid
private boolean invalid
-
-
Constructor Details
-
BlockEntity
-
-
Method Details
-
getWorld
-
setLocation
-
hasWorld
public boolean hasWorld() -
fromTag
-
toTag
-
writeIdentifyingData
-
createFromTag
-
markDirty
public void markDirty() -
getSquaredRenderDistance
@Environment(CLIENT) public double getSquaredRenderDistance() -
getPos
-
getCachedState
-
toUpdatePacket
-
toInitialChunkDataTag
-
isRemoved
public boolean isRemoved() -
markRemoved
public void markRemoved() -
cancelRemoval
public void cancelRemoval() -
onSyncedBlockEvent
public boolean onSyncedBlockEvent(int type, int data) -
resetBlock
public void resetBlock() -
populateCrashReport
-
setPos
-
copyItemDataRequiresOperator
public boolean copyItemDataRequiresOperator() -
applyRotation
-
applyMirror
-
getType
-
markInvalid
public void markInvalid()
-