blockTextureEntity

val blockTextureEntity: WrapperEntity?(source)

A packet based ItemDisplay sent to players with customBlockTextures enabled.

Being lazily initialized, if you do not access the entity directly it will only be created when a player with customBlockTextures comes within range for the first time. This is to avoid unnecessary entity creation, memory usage, and entity update overhead when no players can actually see it.

Upon initialization the entity is set up by setupBlockTexture (which can be overridden), and modifications afterward can be done using updateBlockTexture.

For example, if you have a block that faces different directions, you can override setupBlockTexture and rotate the entity based on the block's facing direction.

Or let's say you have a furnace block that changes texture based on whether it's lit or not, you can use updateBlockTexture to change the entity's item to reflect the lit/unlit state.