-
Notifications
You must be signed in to change notification settings - Fork 0
Block Renderers
Lyof429 edited this page Jun 9, 2026
·
1 revision
Main class to register custom rendering for blocks.
Registers a custom dynamic renderer for blocks.
Any BlockState which satisfies @param condition will be affected.
This method is automatically called for any Block implementing IAddedRenderBlock.
If using a PoseStack based rendering, they will automatically be pushed and then popped.
// Renders an extra azalea bush on fully grown bamboos
SolClientRegistries.Render.BLOCK.register(state -> state.is(Blocks.BAMBOO)
&& state.getValue(BlockStateProperties.BAMBOO_LEAVES).equals(BambooLeaves.LARGE),
(renderer, state, pos, getter, poseStack, vertexConsumer, random) -> {
BlockState azaleaState = Blocks.AZALEA.defaultBlockState();
renderer.renderBlock(pos, azaleaState);
});void render(BiConsumer<BlockPos, BlockState> renderer, BlockState state, BlockPos pos, BlockAndTintGetter getter, RandomSource random, @Nullable PoseStack poseStack, @Nullable VertexConsumer vertexConsumer);A functional interface for block rendering.
-
rendererRenders the given BlockState at the given BlockPos. Implementation varies depending on Sodium presence. -
stateThe currently rendered BlockState, for eventual extra checks or processing. -
posThe BlockPos of the currently rendered BlockState. -
getterA world access valid in the chunk aroundpos. -
randomA random access. -
poseStackCurrently used PoseStack. Will be null if Sodium rendering is used. -
vertexConsumerCurrently used VertexConsumer. Will be null if Sodium rendering is used.
void render(BiConsumer<BlockPos, BlockState> renderer, BlockState state, BlockPos pos, BlockAndTintGetter getter, RandomSource random, @Nullable PoseStack poseStack, @Nullable VertexConsumer vertexConsumer);
boolean shouldAddRender(BlockState state);An extension of IBlockRenderer with a built in rendering predicate.
Any Block implementing this will have their renderer automatically registered.