-
Notifications
You must be signed in to change notification settings - Fork 0
Creating a entity renderer
This guide assumes you've already created and setup an Avoid project.
§ Making an entity renderer with the Avoid Framework
-
Create a java class;
You can pick any location within your project source code directory. -
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
HerobrineEntityModelmodel, - with the
minecraft:playerlayer, - using the
testmod:textures/entity/herobrine.pngskin.
The entity has the shadow radius of
0.
It doesn't have any additional rendering (default rendering is automatically called before the custom rendering for entities). - with the
-
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/)).
- adding existing content (e.g.
-
Register the renderer;
Go to your mod's main class, and override theonLoadmethod 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 modavoid.mod.jsonfile, take the mod ID, and then add the snake-cased class name of your entity excluding theEntityword to it after a colon. - the entity type ID (
©️ Copyright 2026 Olafcio (on behalf of the AvoidLib org)
📝 Licensed with CC BY-NC (Attribution-NonCommercial)