Jump to content

Recommended Posts

Posted

So blah blah blah I'm doing custom armor models, the models are done in Tabula and then manually edited so it works for this version. Anyways the model and textures all look good and the texture offsets are set correctly, as can be seen here:

 

image.png.abd1adc728f0d4aa482ddbdd049120c1.png

 

And then in my model class everything is parented correctly, and renders. However, I noticed that there are random texture artifacts for some reason in-game. This happens on every armor piece, this one is without the chestplate:

 

image.png.ebd105d36e74eb97b8eb7e3f3f53a5b8.png

 

I thought it might be some kind of texture offset problem so I tried making the texture size bigger and more spread out, but it still happens. What could be causing this?

 

Posted

Post your code.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
12 hours ago, Draco18s said:

Post your code.

This is the model straight from Tabula, body and leg are on separate textures too:

        this.textureWidth = 64;
        this.textureHeight = 64;

        this.ll_shoulder_r = new ModelRenderer(this, 36, 8);
        this.ll_shoulder_r.mirror = true;
        this.ll_shoulder_r.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.ll_shoulder_r.addBox(-4.0F, -2.5F, -2.5F, 5, 5, 5, 0.0F);
        this.ll_elbow_l = new ModelRenderer(this, 0, 18);
        this.ll_elbow_l.mirror = true;
        this.ll_elbow_l.setRotationPoint(3.0F, 3.0F, 0.0F);
        this.ll_elbow_l.addBox(-1.0F, 0.0F, -2.5F, 2, 2, 5, 0.0F);
        this.ll_elbow_r = new ModelRenderer(this, 0, 18);
        this.ll_elbow_r.mirror = true;
        this.ll_elbow_r.setRotationPoint(-3.0F, 3.0F, 0.0F);
        this.ll_elbow_r.addBox(-1.0F, 0.0F, -2.5F, 2, 2, 5, 0.0F);
        this.ll_collar = new ModelRenderer(this, 0, 35);
        this.ll_collar.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.ll_collar.addBox(-4.5F, -1.0F, -2.0F, 9, 3, 5, 0.0F);
        this.ll_hair = new ModelRenderer(this, 0, 53);
        this.ll_hair.setRotationPoint(0.0F, -9.0F, 0.0F);
        this.ll_hair.addBox(-0.5F, -1.0F, -0.5F, 1, 1, 5, 0.0F);
        this.ll_torso = new ModelRenderer(this, 14, 18);
        this.ll_torso.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.ll_torso.addBox(-4.5F, 0.0F, -2.5F, 9, 12, 5, 0.0F);
        this.ll_helm = new ModelRenderer(this, 0, 0);
        this.ll_helm.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.ll_helm.addBox(-4.5F, -9.0F, -4.5F, 9, 9, 9, 0.0F);
        this.ll_shoulder_l = new ModelRenderer(this, 36, 8);
        this.ll_shoulder_l.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.ll_shoulder_l.addBox(-1.0F, -2.5F, -2.5F, 5, 5, 5, 0.0F);

        this.ll_leg_r = new ModelRenderer(this, 0, 0);
        this.ll_leg_r.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.ll_leg_r.addBox(-3.0F, 0.0F, -2.5F, 5, 6, 5, 0.0F);
        this.ll_leg_l = new ModelRenderer(this, 0, 0);
        this.ll_leg_l.mirror = true;
        this.ll_leg_l.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.ll_leg_l.addBox(-2.0F, 0.0F, -2.5F, 5, 6, 5, 0.0F);
        this.ll_foot_r = new ModelRenderer(this, 0, 43);
        this.ll_foot_r.setRotationPoint(0.0F, 7.0F, 0.0F);
        this.ll_foot_r.addBox(-3.0F, 0.0F, -2.5F, 5, 5, 5, 0.0F);
        this.ll_foot_l = new ModelRenderer(this, 0, 43);
        this.ll_foot_l.mirror = true;
        this.ll_foot_l.setRotationPoint(0.0F, 7.0F, 0.0F);
        this.ll_foot_l.addBox(-2.0F, 0.0F, -2.5F, 5, 5, 5, 0.0F);

        this.ll_shoulder_r.addChild(this.ll_elbow_r);
        this.ll_helm.addChild(this.ll_hair);
        this.ll_torso.addChild(this.ll_collar);
        this.ll_shoulder_l.addChild(this.ll_elbow_l);

        if (legs)
        {
            this.bipedRightLeg.addChild(this.ll_leg_r);
            this.bipedLeftLeg.addChild(this.ll_leg_l);
        }
        else
        {
            this.bipedHead.addChild(this.ll_helm);
            this.bipedRightArm.addChild(this.ll_shoulder_r);
            this.bipedBody.addChild(this.ll_torso);
            this.bipedLeftArm.addChild(this.ll_shoulder_l);
            this.bipedRightLeg.addChild(this.ll_foot_r);
            this.bipedLeftLeg.addChild(this.ll_foot_l);
        }

 

Then in my item file, I literally just return the armor model (returning null if the equipment slot is empty). I even tried giving the helmet its own separate texture and while everything else is fixed, another cube inside the head gets rendered as well: 

image.png.8f142af53d958b3992440fb42f11628d.png

 

As you can see, the helmet itself renders fine, but inside it there's another cube that uses the helmet texture but messes it all up.

Posted (edited)

It looks like for some reason there's an overlay over the player model's skin and this is somehow applying the texture on that? The same happens for the boots:

 

image.png.da71cf4a4601d7e6b3e90ca9e4609df1.png

Edited by k-off
Posted

I went and commented out the part where the player model parts are parented to my armor parts (so I expected the armor NOT to render), but this is the result:

 

image.png.1e59fb69937fb47a9e8f0dd6f8e74948.png

 

These are the parts that are rendering underneath my armors in the pics above. So bizzarre, I can't figure out what to make of this.

Posted

I still don't know what causes this to happen, but I overrode the rendering method and manually checked for render indexes to call the appropriate limbs, and it all works now.

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.

Guest
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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hi everyone, I'm currently developing a Forge 1.21 mod for Minecraft and I want to display a custom HUD overlay for a minigame. My goal: When the game starts, all players should see an item/block icon (from the base game, not a custom texture) plus its name/text in the HUD – similar to how the bossbar overlay works. The HUD should appear centered above the hotbar (or at a similar prominent spot), and update dynamically (icon and name change as the target item changes). What I've tried: I looked at many online tutorials and several GitHub repos (e.g. SeasonHUD, MiniHUD), but most of them use NeoForge or Forge versions <1.20 that provide the IGuiOverlay API (e.g. implements IGuiOverlay, RegisterGuiOverlaysEvent). In Forge 1.21, it seems that neither IGuiOverlay nor RegisterGuiOverlaysEvent exist anymore – at least, I can't import them and they are missing from the docs and code completion. I tried using RenderLevelStageEvent as a workaround but it is probably not intended for custom HUDs. I am not using NeoForge, and switching the project to NeoForge is currently not an option for me. I tried to look at the original minecraft source code to see how elements like hearts, hotbar etc are drawn on the screen but I am too new to Minecraft modding to understand. What I'm looking for: What is the correct way to add a custom HUD element (icon + text) in Forge 1.21, given that the previous overlay API is missing? Is there a new recommended event, callback, or method in Forge 1.21 for custom HUD overlays, or is everyone just using a workaround? Is there a minimal open-source example repo for Forge 1.21 that demonstrates a working HUD overlay without relying on NeoForge or deprecated Forge APIs? My ideal solution: Centered HUD element with an in-game item/block icon (from the base game's assets, e.g. a diamond or any ItemStack / Item) and its name as text, with a transparent background rectangle. It should be visible to the players when the mini game is running. Easy to update the item (e.g. static variable or other method), so it can change dynamically during the game. Any help, code snippets, or up-to-date references would be really appreciated! If this is simply not possible right now in Forge 1.21, it would also help to know that for sure. Thank you very much in advance!
    • The simple answer is there is not an easy way. You would need to know how to program in Java, as well as at least some familiarity with how Forge works so you could port the differences. You would also need the sourcecode for the original mod, and permission from the author to modify it, if they did not use some sort of open source license. So it's not impossible, but it would take some effort, but doing so would open up a whole new world of possibilities for you!
    • Does it still crash if you remove holdmyitems? Looks like that mod doesn't work on a server as far as I can tell from the error.  
    • Crashes the server when trying to start. Error code -1. Log  
  • Topics

×
×
  • Create New...

Important Information

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