Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

How do I make a Custom Armor Model for 1.16?


Recommended Posts

44 minutes ago, aritod said:

Ok. I was doing something wrong. Sorry. What you actually need to do is the following (PS: Delete the .json file):

1. Create a custom armor class for each piece of armor that extends ArmorItem 


public class ArgentumHelmet extends ArmorItem

2. Override getArmorModel and getArmorTexture


    @Nullable
    @Override
    public <A extends BipedModel<?>> A getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlotType armorSlot, A _default) {
        return null;
    }

    @Nullable
    @Override
    public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlotType slot, String type) {
        return null;
    }

3. Export your armor model as a Java class and put it in your project

4. Return an instance of your Model Class to getArmorModel()


                YourModelObject model = new YourModelObject();
                model.bipedHeadwear.showModel = armorSlot == EquipmentSlotType.HEAD;

                model.isChild = _default.isChild;
                model.isSneak = _default.isSneak;
                model.isSitting = _default.isSitting;
                model.rightArmPose = _default.rightArmPose;
                model.leftArmPose = _default.leftArmPose;

                return (A) model;

5. Return texture in getArmorTexture()


return "modid:textures/models/armor/texture.png";

6. Instantiate your custom model class instead of ArmorItem when creating your armor piece


...new ArmorItem(...);

To

...new ArgentumHelmet(...);

Repeat for all other pieces

 

Got this from this thread:

If this doesn't work then I suggest doing your own research.

Part of the problem is that the thread you looked at is outdated. Minecraft swapped the names of a majority of their methods in 1.16, which is why I specified the specific update in this thread's title. All of the steps worked except for #4, and I believe that's because the methods are mcp, and not Mojang. The Linkie bot in the Linkie server couldn't even translate the methods.

Attached is the broken part of ArgentumChestplate's code.

image.thumb.png.cc5398c85225975581d2ed81cbb1d41f.png

 

Link to post
Share on other sites
1 minute ago, Skullblade said:

Part of the problem is that the thread you looked at is outdated. Minecraft swapped the names of a majority of their methods in 1.16, which is why I specified the specific update in this thread's title. All of the steps worked except for #4, and I believe that's because the methods are mcp, and not Mojang. The Linkie bot in the Linkie server couldn't even translate the methods.

Attached is the broken part of ArgentumChestplate's code.

image.thumb.png.cc5398c85225975581d2ed81cbb1d41f.png

 

This might be the case but you are instantiating the ArgentumChestplate class, instead of ArgentumChestplateModel class.

Link to post
Share on other sites
3 minutes ago, Skullblade said:

It won't even let me import the ArgentumChestplateModel class.

Uhh I'm not exactly sure what you are doing. Did you export your model as a java class and put in under src/main/java/...? Is the name of your model class ArgentumChestplateModel? You are supposed to instantiate your model class.

Edited by aritod
Link to post
Share on other sites
Just now, aritod said:

Uhh I'm not exactly sure what you are doing. Did you export your model as a java class and put in under src/main/java/...? Is the name of your model class ArgentumChestplateModel?

The model class is named ArgentumChestplateModel.java, and it's located in src/main/java/com/skullblade/planeswalkermod/common/models.

Link to post
Share on other sites
1 minute ago, Skullblade said:

The model class is named ArgentumChestplateModel.java, and it's located in src/main/java/com/skullblade/planeswalkermod/common/models.

Then I'm not sure why you wouldn't be able to import it. Can you show the class?

Link to post
Share on other sites
11 minutes ago, Skullblade said:

Well, the class name ArgentumChestplateModel is no longer underlined in red, but everything else is brighter than a fire engine.

I think you exported the model as an entity from blockbench, as your model class should extend BipedModel. Pick Block/Item this time.

Link to post
Share on other sites
1 hour ago, Skullblade said:

That just makes it a .json again.

Oh. Then extend BipedModel in your Model class and replace setTextureOffset() with texOffs(), textureWidth with texWidth, textureHeight with texHeight. Not sure about body.setRotationPoint() though.

Link to post
Share on other sites
6 minutes ago, aritod said:

Oh. Then extend BipedModel in your Model class and replace setTextureOffset() with texOffs(), textureWidth with texWidth, textureHeight with texHeight. Not sure about body.setRotationPoint() though.

I took a guess and it's .setPos for .setRotationPoint. The only issue left is this error from public ArgentumChestplateModel();

There is no default constructor available in 'net.minecraft.client.renderer.entity.model.BipedModel'

Link to post
Share on other sites
8 minutes ago, Skullblade said:

I took a guess and it's .setPos for .setRotationPoint. The only issue left is this error from public ArgentumChestplateModel();

There is no default constructor available in 'net.minecraft.client.renderer.entity.model.BipedModel'

 

    public ExampleConstructor(float i) {
        super(i);
	/.../
}

Your model constructor needs a float

Link to post
Share on other sites
1 minute ago, aritod said:

 


    public ExampleConstructor(float i) {
        super(i);
	/.../
}

Your model constructor needs a float

Sweet, now that's all fixed. In ArgentumChestplate.java, I'm able to replace ArgentumChestplate with ArgentumChestplateModel, but there's still a problem with the model.blank stuff. Each one except for model.rightArmPose and model.leftArmPose says 'can't resolve symbol'.

Link to post
Share on other sites
33 minutes ago, Skullblade said:

Sweet, now that's all fixed. In ArgentumChestplate.java, I'm able to replace ArgentumChestplate with ArgentumChestplateModel, but there's still a problem with the model.blank stuff. Each one except for model.rightArmPose and model.leftArmPose says 'can't resolve symbol'.

Hmm. I've been trying to look for a replacement for those but I'm not sure. Seems like there was a big change from 1.15 to 1.16. Try doing your own research maybe. Also, just curious. What exactly happens if you remove all the lines that have that error? Does the armor model partially work? Is there an error?

Link to post
Share on other sites
11 minutes ago, aritod said:

Hmm. I've been trying to look for a replacement for those but I'm not sure. Seems like there was a big change from 1.15 to 1.16. Try doing your own research maybe. Also, just curious. What exactly happens if you remove all the lines that have that error? Does the armor model partially work? Is there an error?

Deleting parts that are errored leads to more errors in other parts.

Link to post
Share on other sites
3 minutes ago, aritod said:

Delete line 23 to 27. When instantiating your ArgentumChestplateModel class, give it 1.0F as a parameter.

The armor works! I think I may have screwed up the model in blockbench, but now that I know how this stuff works, it'll be an easy fix. Thank you so much!

Link to post
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.

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



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.