Skip to content

Creating a entity renderer

Olafcio1 edited this page Jul 13, 2026 · 5 revisions

This guide assumes you've already created and setup an Avoid project.


§ Making an entity renderer with the Avoid Framework


  1. Create a java class;
    You can pick any location within your project source code directory.

  2. Paste the following code:

    package com.example.avoidtmpl;
    
    import pl.olafcio.avoid.net.entity_renderer.Baker;
    import pl.olafcio.avoid.net.entity_renderer.LivingEntityRenderer;
    import pl.olafcio.avoid.net.id.Identification;
    
    public class HerobrineEntityRenderer
           extends LivingEntityRenderer<HerobrineEntity, HerobrineEntityState>
    {
        public HerobrineEntityRenderer(Baker baker) {
            super(baker, new HerobrineEntityModel(baker.bakeLayer("minecraft:player", "main")), 0.0f);
        }
    
        @Override
        public Identification getTextureLocation(HerobrineEntityState herobrineEntityState) {
            return new Identification("testmod", "textures/entity/herobrine.png");
        }
    
        @Override
        public void render(HerobrineEntity herobrineEntity, HerobrineEntityState herobrineEntityState, float v) {
        }
    }

    Of course you need to replace the class name and package.
    This creates a living entity:

    • with the HerobrineEntityModel model,
    • with the minecraft:player layer,
    • using the testmod:textures/entity/herobrine.png skin.

    The entity has the shadow radius of 0.
    It doesn't have any additional rendering (default rendering is automatically called before the custom rendering).

  3. Add any additional layers;
    It's possible to add content to another layers, by:

    • adding existing content (e.g. addCustomHead()), or
    • adding new content with modelparts (baker.bakeLayer(/layer/, /element/)).
  4. Register the renderer;
    Go to your mod's main class, and override the onLoad method if you didn't yet.
    Then, paste this into it:

    EntityRenderers.registerLiving(
        EntityType.of("testmod:herobrine"),
        HerobrineEntityRenderer::new,
        HerobrineEntityState::new
    );

    Of course, you need to replace these values.
    Replace:

    • the entity type ID (testmod:herobrine),
    • the entity renderer class ref,
    • the entity state class ref.

    If you don't know what that ID is, it's pretty simple to guess.
    Just look at your mod avoid.mod.json file, take the mod ID, and then add the snake-cased class name of your entity excluding the Entity word to it after a colon.


Avoid Framework


    🏚️ 1. Home
    📽️ 2. Creating your mod
    🌄 3. Adding assets to your mod
    🧊 4. Creating a block
    ✏️ 5. Creating an item
    🎯 6. Creating an entity selector
    🤖 7. Creating a command
    ⌨️ 8. Creating a keybind
    🐺 9. Creating an entity

Clone this wiki locally