Jump to content

I have created an abomination (custom entity model)


Recommended Posts

I don't really feel like this needs much of an explanation...


Model as it appears in Techne (sorry, dropbox images broke, have to post links):




Model as it appears in-game:




And my code:



public class ModelGoblinModel extends ModelBase
    ModelRenderer Head;
    ModelRenderer RightEar;
    ModelRenderer LeftEar;
    ModelRenderer Nose;
    ModelRenderer NosePart2;
    ModelRenderer UpperArm2;
    ModelRenderer UpperArm1;
    ModelRenderer LowerArm2;
    ModelRenderer LowerArm1;
    ModelRenderer UpperBody;
    ModelRenderer LowerBody;
    ModelRenderer Leg2;
    ModelRenderer Leg1;
    ModelRenderer Foot2;
    ModelRenderer Foot1;
    ModelRenderer UpperLeg1;
    ModelRenderer UpperLeg2;
    ModelRenderer hilt;
    ModelRenderer CrossGuard;
    ModelRenderer CrossGuardLeft;
    ModelRenderer CrossGuardRight;
    ModelRenderer Blade;
    ModelRenderer BladePart3;
    ModelRenderer BladePart2;
  public ModelGoblinModel()
    textureWidth = 64;
    textureHeight = 32;
      Head = new ModelRenderer(this, 42, 0);
      Head.addBox(-3F, -5F, -2.5F, 6, 5, 5);
      Head.setRotationPoint(0F, 5F, 0F);
      Head.setTextureSize(64, 32);
      setRotation(Head, 0F, 0F, 0F);
      Nose = new ModelRenderer(this, 50, 26);
      Nose.addBox(-0.5F, -0.5F, -1F, 1, 1, 1);
      Nose.setRotationPoint(0F, 3F, -2F);
      Nose.setTextureSize(64, 32);
      setRotation(Nose, 0.1745329F, 0F, 0F);
      NosePart2 = new ModelRenderer(this, 50, 29);
      NosePart2.addBox(-0.5F, -0.5F, -1F, 1, 2, 1);
      NosePart2.setRotationPoint(0F, 3.7F, -2.5F);
      NosePart2.setTextureSize(64, 32);
      setRotation(NosePart2, -0.5948578F, 0F, 0F);
      RightEar = new ModelRenderer(this, 54, 29);
      RightEar.addBox(-4F, -1F, -0.5F, 4, 2, 1);
      RightEar.setRotationPoint(-2.5F, 2F, 0F);
      RightEar.setTextureSize(64, 32);
      setRotation(RightEar, 0.3490659F, 0.7853982F, 0.3490659F);
      LeftEar = new ModelRenderer(this, 54, 26);
      LeftEar.addBox(0F, -1F, -0.5F, 4, 2, 1);
      LeftEar.setRotationPoint(2.5F, 2F, 0F);
      LeftEar.setTextureSize(64, 32);
      setRotation(LeftEar, 0.3490659F, -0.7853982F, -0.3490659F);
      UpperArm2 = new ModelRenderer(this, 28, 24);
      UpperArm2.addBox(-1F, 0F, -1.5F, 2, 5, 3);
      UpperArm2.setRotationPoint(3F, 5F, 0.5F);
      UpperArm2.setTextureSize(64, 32);
      setRotation(UpperArm2, 0.4014257F, 0.1483529F, -0.3665191F);
      UpperArm1 = new ModelRenderer(this, 38, 24);
      UpperArm1.addBox(-1F, 0F, -1.5F, 2, 5, 3);
      UpperArm1.setRotationPoint(-3F, 5F, 0.5F);
      UpperArm1.setTextureSize(64, 32);
      setRotation(UpperArm1, 0.4014257F, -0.1483529F, 03665191F);
      LowerArm2 = new ModelRenderer(this, 26, 6);
      LowerArm2.addBox(-1F, 0F, -1F, 2, 6, 2);
      LowerArm2.setRotationPoint(3F, 10F, 0.5F);
      LowerArm2.setTextureSize(64, 32);
      setRotation(LowerArm2, -0.7853981F, 0F, 0F);
      LowerArm1 = new ModelRenderer(this, 34, 6);
      LowerArm1.addBox(-1F, 0F, -1F, 2, 6, 2);
      LowerArm1.setRotationPoint(-3F, 10F, 0.5F);
      LowerArm1.setTextureSize(64, 32);
      setRotation(LowerArm1, -0.7853981F, 0F, 0F);
      UpperLeg1 = new ModelRenderer(this, 26, 0);
      UpperLeg1.addBox(-1F, 0F, -1F, 2, 4, 2);
      UpperLeg1.setRotationPoint(-2F, 15F, 0.5F);
      UpperLeg1.setTextureSize(64, 32);
      setRotation(UpperLeg1, -0.5235988F, 0F, 0F);
      Leg1 = new ModelRenderer(this, 30, 14);
      Leg1.addBox(-1F, 0F, -1F, 2, 6, 2);
      Leg1.setRotationPoint(-2F, 18F, -1.5F);
      Leg1.setTextureSize(64, 32);
      setRotation(Leg1, 0.4014257F, 0F, 0F);
      Foot1 = new ModelRenderer(this, 20, 29);
      Foot1.addBox(-1F, 0F, -1F, 2, 1, 2);
      Foot1.setRotationPoint(-2F, 23F, -0.5F);
      Foot1.setTextureSize(64, 32);
      setRotation(Foot1, 0F, 0F, 0F);
      UpperLeg2 = new ModelRenderer(this, 34, 0);
      UpperLeg2.addBox(-1F, 0F, -1F, 2, 4, 2);
      UpperLeg2.setRotationPoint(2F, 15F, 0.5F);
      UpperLeg2.setTextureSize(64, 32);
      setRotation(UpperLeg2, -0.5235988F, 0F, 0F);
      Leg2 = new ModelRenderer(this, 38, 14);
      Leg2.addBox(-1F, 0F, -1F, 2, 6, 2);
      Leg2.setRotationPoint(2F, 18F, -1.5F);
      Leg2.setTextureSize(64, 32);
      setRotation(Leg2, 0.4014257F, 0F, 0F);
      Foot2 = new ModelRenderer(this, 20, 26);
      Foot2.addBox(-1F, 0F, -1F, 2, 1, 2);
      Foot2.setRotationPoint(2F, 23F, -0.5F);
      Foot2.setTextureSize(64, 32);
      setRotation(Foot2, 0F, 0F, 0F);
      UpperBody = new ModelRenderer(this, 46, 10);
      UpperBody.addBox(-3F, -5F, -1F, 6, 5, 3);
      UpperBody.setRotationPoint(0F, 10F, 0F);
      UpperBody.setTextureSize(64, 32);
      setRotation(UpperBody, 0F, 0F, 0F);
      LowerBody = new ModelRenderer(this, 48, 18);
      LowerBody.addBox(-2.5F, -2F, -1F, 5, 5, 3);
      LowerBody.setRotationPoint(0F, 12F, 0F);
      LowerBody.setTextureSize(64, 32);
      setRotation(LowerBody, 0F, 0F, 0F);
      hilt = new ModelRenderer(this, 0, 28);
      hilt.addBox(0F, 0F, 0F, 1, 1, 3);
      hilt.setRotationPoint(-4F, 14F, -1F);
      hilt.setTextureSize(64, 32);
      setRotation(hilt, 0F, 0F, 0F);
      CrossGuard = new ModelRenderer(this, 0, 0);
      CrossGuard.addBox(0F, 0F, 0F, 1, 3, 1);
      CrossGuard.setRotationPoint(-4F, 13F, -2F);
      CrossGuard.setTextureSize(64, 32);
      setRotation(CrossGuard, 0F, 0F, 0F);
      CrossGuardLeft = new ModelRenderer(this, 8, 26);
      CrossGuardLeft.addBox(0F, 0F, 0F, 1, 2, 1);
      CrossGuardLeft.setRotationPoint(-4F, 15.4F, -1.7F);
      CrossGuardLeft.setTextureSize(64, 32);
      setRotation(CrossGuardLeft, -0.5948578F, 0F, 0F);
      Blade = new ModelRenderer(this, 0, 11);
      Blade.addBox(0F, 0F, 0F, 1, 3, 12);
      Blade.setRotationPoint(-4F, 13F, -14F);
      Blade.setTextureSize(64, 32);
      setRotation(Blade, 0F, 0F, 0F);
      CrossGuardRight = new ModelRenderer(this, 8, 29);
      CrossGuardRight.addBox(0F, 0F, 0F, 1, 2, 1);
      CrossGuardRight.setRotationPoint(-4F, 13.1F, -0.9F);
      CrossGuardRight.setTextureSize(64, 32);
      setRotation(CrossGuardRight, 3.735005F, 0F, 0F);
      BladePart3 = new ModelRenderer(this, 15, 4);
      BladePart3.addBox(0F, 0F, 0F, 1, 1, 1);
      BladePart3.setRotationPoint(-4F, 12F, -13F);
      BladePart3.setTextureSize(64, 32);
      setRotation(BladePart3, 0F, 0F, 0F);
      BladePart2 = new ModelRenderer(this, 4, 0);
      BladePart2.addBox(0F, 0F, 0F, 1, 2, 1);
      BladePart2.setRotationPoint(-4F, 11F, -14F);
      BladePart2.setTextureSize(64, 32);
      setRotation(BladePart2, 0F, 0F, 0F);
  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5, entity);
  protected void setRotation(ModelRenderer model, float x, float y, float z)
    model.rotateAngleX = x;
    model.rotateAngleY = y;
    model.rotateAngleZ = z;
  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
    super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    this.Head.rotateAngleY = f3 / (180F / (float)Math.PI);
    this.Head.rotateAngleX = f3 / (180F / (float)Math.PI);

    this.UpperArm1.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 2.0F * f1 * 0.5F;
    this.UpperArm2.rotateAngleX = MathHelper.cos(f * 0.6662F) * 2.0F * f1 * 0.5F;
    this.UpperArm1.rotateAngleZ = 0.0F;
    this.UpperArm2.rotateAngleZ = 0.0F;
    this.UpperLeg1.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1;
    this.UpperLeg2.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f1;
    this.UpperLeg1.rotateAngleY = 0.0F;
    this.UpperLeg2.rotateAngleY = 0.0F;

    float f6;
    float f7;




public class GoblinRenderer extends RenderLiving {

private static final ResourceLocation texLoc = new ResourceLocation(Reference.MODID + ":" + "textures/models/goblin.png");

public GoblinRenderer(ModelGoblinModel model, float shadowSize)
	super(model, shadowSize);

protected ResourceLocation getEntityTexture(Entity entity)
	return texLoc;




Link to comment
Share on other sites

eugh what a mess :)


It looks to me like the body parts aren't grouping together correctly, so whenever you rotate bits of the model, they don't stay stuck together.  Or something to do with the choice of rotation points perhaps.


I've never used Techne so I can't be of much help.  Trial and error on a simpler model might help, i.e. start from a very simple base that works, then add one bit at a time - for example just the nose - and tweak either your Techne model or the generated code until the nose moves properly with the head rotation. 



Link to comment
Share on other sites

@TheGreyGhost I already have another custom model working fine, but it does seem to be the addChild part which is breaking things. What you can't see in the image is that it's actually cloned some parts of the model 2-3 times under the ground.


@jabelar I already took a look at that, not entirely sure which part you're referring to.

Link to comment
Share on other sites

@TheGreyGhost I already have another custom model working fine, but it does seem to be the addChild part which is breaking things. What you can't see in the image is that it's actually cloned some parts of the model 2-3 times under the ground.


@jabelar I already took a look at that, not entirely sure which part you're referring to.


Well, for example the part where I mention that if you use addChild() you should only render the parent.  In your case, you are rendering the children like the ears and such.  That will cause a double rendering effect (or triple if they are children of children) and each render will be offset by the relative rotation point).


So my first suggestion is that you should only be rendering the parent parts -- the children get rendered automatically.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Depending on how you are moving things around, it also matter what order you make things children.


I found the angles and the way it works shift around if you do tail1, tail2, tail3 vs tail3, tail2, tail1.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

Alright, I'm putting this on a back burner for now and focusing on other things - I just tried a very simple model, just adding one cube to the head of a biped and adding it as a child, but every time I add a child it messes it up in-game


Link to comment
Share on other sites

it may be tedious but this might help

rightleg.setRotationPoint(-2F, 12F, 0F);

the first float determins the left and right positions of the model, the second determins the height, and the third determines depth, you could try use these to position the parts where you want, you may be better not rendering the parts all at once but one at a time and positioning them until everyone is loaded and in place.

Link to comment
Share on other sites

Alright, I'm putting this on a back burner for now and focusing on other things - I just tried a very simple model, just adding one cube to the head of a biped and adding it as a child, but every time I add a child it messes it up in-game


There are only two things that can really mess up.  Once you get the idea it will be easy.


First, you should not render the child if you render the parent.  Rendering both will cause duplicate in different positions.


The second thing is that the rotation point of the child has to be *relative* to the parent's rotation point.  So if you made a Techne model that had the parent rotation point at (0, 12, 0) then in Java you have to subtract that amount from the rotation point of the child's rotation point (if you got the values from Techne).


The other tip I will give you is to ensure that the rotation points in Techne are correct (i.e. at the joint or connection point that you want) because a lot of people erroneously use offsets to make it look right but then it will go really wrong when you rotate.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

the rotation point of the child has to be *relative* to the parent's rotation point.


Now this I did not know. Thanks so much for that, just adjusted the rotation points of the arms and it's fixed it.


LAST UPDATE: Yup. Fixed now, thanks to Jabelar. Just a thought, you might want to put that thing about offsetting the rotation point relative to that of the parents in your tutorial if it's not already on there (not sure, was 3am when I read it). Anyway, the final, less possessed/deformed product:



Link to comment
Share on other sites



Yeah, I think the concept of what a child is needs more explaining.  I'm actually going to do more to add the convertToChild() method that I came up with while helping delpi on a similar issue.


I really wish Techne just handled child parts better...  Techne is so close to being fully useful, but their Java export has a few nagging issues.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • version used : minecraft forge 1.20.1 Logs : https://bytebin.lucko.me/rtG4EA0vfb hi! so when i try to create a new minecraft world in single player, it just crashes?? does anyone has an idea what could be causing this ?
    • Hey today I was trying to play in 1.21 modpack that I made on fabric (my version of fabric is in 0.16.0) with this list of mods : - Entity Model Features (by traben_0) - Entity Texture Features (by traben_0) - Advanced Chat (by Wesley8081) - Ambient Environment (by Jaredlll08) - Ambient Souds 6 (by CreativeMD) - Animatica (by FoundationGames) - Armor Statues (by Fuzs) - Auto HUD (by Crendgrim) - Bad Packets (by badasintended) - Balm (by BlayTheNinth) - Better Beds (by Motschen) - Better Chunk Loading (by someaddon) - Better Compatibility Checker (by Gaz-) - Better FPS [Render Distance] (by someaddon) - Better Ping Display (by Quintinity) - Better Statistics Screen (by TheCSDev) - Better Armor HUD (by efekos) - Better F3 ( by cominixo) - Blur + (by Motschen) - Bobby (by Johni0702) - Cat Jam (by shmove) - Catalogue (by MrCrayfish) - Chat Heads (by dzwdz) - Cherished Worlds (by TheIllusiveC4) - Chunk Sending (by someaddon) - Chunks Fade In (by kerudion) - Chunky (by pop4959) - Cloth Config (by shedaniel) - Clumps (by Jaredlll08) - Cobweb (CrystalSpider) - Collective (by Serilum) - Configured (by MrCrayfish) - Connectivity (by someaddon) - Continuity (by Pepper_Bell) - Creative Core (by CreativeMD) - Cupboard (by someaddon) - Cut Through (by Fuzs) - Dark Loading Screen (by Neecko5b84) - Debugify (by XanderIsDev) - Double Doors (by Serilum) - Dynamic FPS (by juliand665) - Dynamic Lights (by Tschipcraft) - Easy Anvils (by Fuzs) - Easy Magic (by Fuzs) - Easy Shulker Boxes (by Fuzs) - Eating Animation (by theone-ss) - Enhanced Attack Indicator (by Mineash) - Enhanced Block Entities (by FoundationGames) - Enhanced Visuals (by CreativeMD) - Entity Culling (by tr7zw) - Environmental Water (by AgentMindStorm) - Essential (by SparkUniverse_) - Extra Thicc Packets (by JaselUmena) - Fabric (by modmuss50) - Fabric Language Kotlin (by modmuss50) - Falling Leaves (by RandomMcSomethin) - Fancy Block Particles (by Hantonik) - Fancy Health Bar (by efekos) - Farsight (by someaddon) - Fast IP Ping (by Fallen_Breath) - Ferrite Core (by  malte0811) - Fish On The Line (by Serilum) - Fix GPU Memory Leak  (by someaddon) - Forge Config API Port (by Fuzs) - FPS Reducer (by bre2el) - Freecam (by hashalite) - Fzzy Config (by fzzyhmstrs) - Get It Together (by bl4ckscor3) - Global Packs (by JTK222) - Harvest With Ease (by CrystalSpider) - Ichuntil Util (by iChun) - Immediately Fast (by RaphilMC) - Immersive UI (by SSKirillSS) - Indium (by comp500) - Inventory HUD+ (by dmitrylovin) - Iris Shaders (by coderbot) - Item Physic Full (by CreativeMD) - Jade (by Snownee) - Journey Map (by techbrew) - Just Enough Breeding (by Christofmeg) - Just Enough Items (by mezz) - Just Enough Professions (by Mrbysco) - Language Reload (by Jerozgen) - Leaves Be Gone (by Fuzs) - Let Me Despawn (by frikinjay) - Let Sleeping Dogs Lie (by iChun) - Lithium (by JellySquid) - Loading Backgrounds (by Lupin) - Mineblock's Repeated Utilities (by itsmineblock11) - Menulogue (by MrCrayfish) - Mob Plaques (by Fuzs) - Mod Menu (by Prospector) - Model Gap Fix (by MehVahdJukaar) - Mouse Tweaks (by YaLTeR) - Nether Portal Fix (by BlayTheNinth) - Nicer Skies (by ztereohype) - Noisium (by Steveplays28) - Not Enough Animations (by tr7zw) - Opti GUI (by opekope2) - Packet Fixer (by TonimatasDEV) - Particle Core (by fzzyhmstrs) - Passive Shields (by Serilum) - Pick Up Notifier (by Fuzs) - Ping Wheel (by LukenSkyne) - Puzzle (by Motschen) - Puzzles LIB (by Fuzs) - Reese's Sodium Options (by FlashyReese) - Resource Pack Overrides (by Fuzs) - Server Country Flags (by khajiitos) - Server Performance (by someaddon) - Skin Layer 3D (by tr7zw) - Sodium (by JellySquid) - Sodium Extra (by FlashyReese) - Sodium Shadowy Path Blocks (by Rynnavinx) - Sound Physics Remastered (by henkelmax) - Sounds (by itsmineblock11) - Spark (by lucko) - Stack Refill (by Serilum) - Structure Essentials (by someaddon) - TCD Commons API (by TheCSDev) - Text Placeholder API (by Patbox) - Villager Names (by Serilum) - Visual Overhaul (by Motschen) - Visual Workbench (by Fuzs) - Visuality (by PinkGoosik) - Wakes (by Goby56) - Wavey Capes (by tr7zw) - YDM'S Weapon Master  (by YourDailyModderx) - Yet Another Config LIB (by XanderIsDev) - Zoomify (by XanderIsDev) And When I load it it work, I can create a world and even let him open forever at least I didn't move cause if so the game just crash and tell me this message :   Encountered an unexpected exception net.minecraft.class_148: Ticking entity at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:1025) at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:912) at net.minecraft.class_1132.method_3748(class_1132.java:114) at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:697) at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:281) at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.class_4706.isEmpty()" because "tickets" is null at net.minecraft.class_3204.canNoneExpire(class_3204.java:1034) at net.minecraft.class_3204.handler$dln000$lithium$unregisterExpiringTicket(class_3204.java:1075) at net.minecraft.class_3204.method_17645(class_3204.java:172) at net.minecraft.class_3204.method_17292(class_3204.java:194) at net.minecraft.class_3215.method_17300(class_3215.java:443) at com.betterchunkloading.chunk.PlayerChunkData.checkPrediction(PlayerChunkData.java:406) at com.betterchunkloading.chunk.PlayerChunkData.checkDirection(PlayerChunkData.java:353) at com.betterchunkloading.chunk.PlayerChunkData.trackPlayerMovement(PlayerChunkData.java:177) at com.betterchunkloading.chunk.PlayerChunkData.onChunkChanged(PlayerChunkData.java:130) at com.betterchunkloading.event.EventHandler.onPlayerTick(EventHandler.java:200) at net.minecraft.class_3222.handler$zed000$betterchunkloading$onPlayerTick(class_3222.java:2618) at net.minecraft.class_3222.method_5773(class_3222.java:564) at net.minecraft.class_3218.mixinextras$bridge$method_5773$202(class_3218.java) at net.minecraft.class_3218.wrapOperation$eei000$puzzleslib$tickNonPassenger(class_3218.java:7797) at net.minecraft.class_3218.method_18762(class_3218.java:770) at net.minecraft.class_1937.method_18472(class_1937.java:498) at net.minecraft.class_3218.method_31420(class_3218.java:408) at net.minecraft.class_5574.method_31791(class_5574.java:54) at net.minecraft.class_3218.method_18765(class_3218.java:372) at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:1021) ... 5 more Sorry guys if it obvious but actually I'm an old player of Minecraft but I'm new in modding so yup. But Thanks everyone by advance to help me with this.
    • These forums are for Minecraft Forge, not Fabric. You would probably be better served posting this question wherever fabric support is given, most likely their discord server.
    • Add the new latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here
    • Update: I tried to reproduce the bug and found out that if I place a flare on a block and then dismantle it with the pickarang (Quark), the flare gets no NBT Tag after getting assigned an empty one through the offhand.
  • Topics

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.