Interface RenderAttachmentBlockEntity

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface RenderAttachmentBlockEntity
Interface for BlockEntitys which provide dynamic model state data.

Dynamic model state data is separate from BlockState, and will be cached during render chunk building on the main thread (safely) and accessible during chunk rendering on non-main threads.

To access the dynamic data, cast the BlockRenderView to RenderAttachedBlockView, and then call getRenderAttachmentData() with the correct position.

Due to chunk meshing happening on non-main threads, please ensure that all accesses to the passed model data are thread-safe. This can be achieved by, for example, passing a pre-generated immutable object, or ensuring all gets performed on the passed object are atomic and well-checked for unusual states.

  • Method Details

    • getRenderAttachmentData

      @Nullable @Nullable Object getRenderAttachmentData()
      Returns:
      The model state data provided by this block entity. Can be null.