-
Notifications
You must be signed in to change notification settings - Fork 0
Client Registration
Moth edited this page Aug 9, 2026
·
4 revisions
Butterfly API provides ClientRegistrar for common client-side registration tasks.
Client registration must only be performed on the physical client.
From your ModContext:
MOD.client();This should normally be used from your Fabric client initializer.
public class ExampleModClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
ClientRegistrar client = ExampleMod.MOD.client();
}
}Calling MOD.client() on a dedicated server will throw an IllegalStateException.
MOD.cutout(EXAMPLE_BLOCK);Multiple blocks can be supplied:
MOD.cutout(
EXAMPLE_BLOCK,
SECOND_BLOCK,
THIRD_BLOCK
);MOD.cutoutMipped(EXAMPLE_BLOCK);In the current 1.21.11 implementation, cutoutMipped(...) uses the same CUTOUT render layer as cutout(...).
MOD.translucent(EXAMPLE_BLOCK);MOD.entityRenderer(
EXAMPLE_ENTITY,
ExampleEntityRenderer::new
);The equivalent ClientRegistrar method is:
MOD.client().entity(...);MOD.blockEntityRenderer(
EXAMPLE_BLOCK_ENTITY,
ExampleBlockEntityRenderer::new
);The equivalent ClientRegistrar method is:
MOD.client().blockEntity(...);Register a handled screen with:
MOD.screen(
EXAMPLE_SCREEN_HANDLER,
ExampleScreen::new
);MOD.modelLayer(
EXAMPLE_MODEL_LAYER,
ExampleModel::getTexturedModelData
);MOD.particleFactory(
EXAMPLE_PARTICLE,
ExampleParticle.Factory::new
);