Skip to main content
Version: GeckoLib5

Creating & Registering the Renderer

Once you've made your BlockEntity class and registered your BlockEntityType, you can now create the renderer and register it.

Making the class​

Simple Renderer Class​

By default, GeckoLib does not require a custom renderer class, and you can instead just pass a new instance of GeoBlockRenderer when registering your renderer.

If you do not require any custom handling of your block's rendering, this is the recommended approach.

E.G.

// Registering the renderer
context -> new GeoBlockRenderer<>(context, BlockEntityRegistry.EXAMPLE_BLOCK_ENTITY.get());

Registering the renderer​

Once you have created your renderer class, you then need to register it. This differs depending on the modloader you are using.

Select your loader below for a link to that loader's documentation for registering BlockEntity renderers.

The asset files​

If you followed the above instructions, GeckoLib will be looking for your asset files (.geo.json, .animation.json, .png) in the /block/ subdirectory, named the same as your BlockEntity's registered id.

For example, if your BlockEntityType was registered as example_block, your files should be:

  • Model: resources/assets/<mod_id>/geckolib/models/block/example_block.geo.json
  • Animations: resources/assets/<mod_id>/geckolib/animations/block/example_block.animation.json
  • Texture: resources/assets/<mod_id>/textures/block/example_block.png

Where <mod_id> is the id of your mod.

See the Placing the Files page for more information on where to place these files.