Jump to content

How to Create Custom Model Armor Without Programs


Ragnar

Recommended Posts

1 hour ago, Ragnar said:

How to Create Custom Template Armor Without Programs

I have no idea what you are trying to say.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

26 minutes ago, TSEngineer said:

Make a custom armor without any programs? Impossible.

You can not make a custom set of armor without programming it.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

1 minute ago, Ragnar said:

I do not mean without programming, I expressed myself poorly, I mean using only eclipse without other programs like the Techne

Okay, in that case you just need to make your own layer model then intercept the vanilla layers with the rendering events. For making your own layer model, look at how LayerBipedArmor works and see if you can copy/modify that to your needs.

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

Link to comment
Share on other sites

Vanilla armor is done by LayerBipedArmor and related model classes. This is a render layer of the player (and other biped mobs that wear armor). For your custom armor you should copy those classes and modify the way you want for your own layer, then use events to add the layer during rendering.

 

How "crazy" is your custom armor? Are you just modifying it a bit, or really different from vanilla? In any case, most Minecraft models are simply made up of "block" like shapes. So you don't really need a program like Techne. You can just draw it on a piece of paper and put in all the coordinates of the blocks directly into your code. And if you're just modifying the vanilla armor you already have that code to reference so should give you a great starting point.

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

Link to comment
Share on other sites

Item already has a method that allows you to give your armor a custom model

public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, net.minecraft.client.model.ModelBiped _default)

Just return your custom model there and it will be rendered instead of the default one. 

Link to comment
Share on other sites

On 13/10/2018 at 02:33, jabelar said:

Nós já lhe dissemos onde está o código de exemplo. Ele está na classe LayerBipedArmor, que estende o LayerArmorBase, que também possui código que pode ser útil para você.

public class LayerBipedArmor extends LayerArmorBase<ModelBiped>
{
    public LayerBipedArmor(RenderLivingBase<?> rendererIn)
    {
        super(rendererIn);
    }

    protected void initArmor()
    {
        this.modelLeggings = new ModelBiped(0.5F);
        this.modelArmor = new ModelBiped(1.0F);
    }

    @SuppressWarnings("incomplete-switch")
    protected void setModelSlotVisible(ModelBiped p_188359_1_, EntityEquipmentSlot slotIn)
    {
        this.setModelVisible(p_188359_1_);

        switch (slotIn)
        {
            case HEAD:
                p_188359_1_.bipedHead.showModel = true;
                p_188359_1_.bipedHeadwear.showModel = true;
                break;
            case CHEST:
                p_188359_1_.bipedBody.showModel = true;
                p_188359_1_.bipedRightArm.showModel = true;
                p_188359_1_.bipedLeftArm.showModel = true;
                break;
            case LEGS:
                p_188359_1_.bipedBody.showModel = true;
                p_188359_1_.bipedRightLeg.showModel = true;
                p_188359_1_.bipedLeftLeg.showModel = true;
                break;
            case FEET:
                p_188359_1_.bipedRightLeg.showModel = true;
                p_188359_1_.bipedLeftLeg.showModel = true;
        }
    }

    protected void setModelVisible(ModelBiped model)
    {
        model.setVisible(false);
    }

    @Override
    protected ModelBiped getArmorModelHook(net.minecraft.entity.EntityLivingBase entity, net.minecraft.item.ItemStack itemStack, EntityEquipmentSlot slot, ModelBiped model)
    {
        return net.minecraftforge.client.ForgeHooksClient.getArmorModel(entity, itemStack, slot, model);
    }
}

 

 

I do not see anything that does the model of the armor here

Link to comment
Share on other sites

2 minutes ago, Ragnar said:

I do not see anything that does the model of the armor here

You need to follow the code from there. There is obviously a method there that gets the model and is even called getArmorModelHook(). That method returns a ModelBiped so you could just override to return your own custom model right there, but more correct to continue as VoidWalker mentions -- this method ends up calling the Item#getArmorModel() method.

 

It is all related. There is a layer in the player model for armor. Assuming you want to replace the normal armor (instead of adding to it) you need the armor layer to find your model. The class code you are already looking at shows you where it gets that model from. So follow it from there.

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

Link to comment
Share on other sites

Yes, it is a lot easier if you already know how to program because then the code "explains itself". 

 

Anyway, what you're asking probably has many tutorials. Custom armor is a common thing to do so I think there should be good tutorials already available. Possibly even in your own language. Did you Google search for tutorials on "custom armor".

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

Link to comment
Share on other sites

is this right?
 

 

@SideOnly(Side.CLIENT)
public class ModelElectricBoots extends ModelBiped{

    ModelRenderer rightLeg;
    ModelRenderer leftLeg;
    
    public ModelElectricBoots() {
        textureWidth = 64;
        textureHeight = 64;
        
        rightLeg = new ModelRenderer(this, 0, 32);
        rightLeg.addBox(10F, 1F, 10F, 6, 8, 8);
        setRotation(rightLeg, 1F, 2F, -1F);
        rightLeg.setTextureSize(64, 64);
        rightLeg.mirror = true;
        rightLeg.setRotationPoint(-1F, -2F, 1F);
        
        leftLeg = new ModelRenderer(this, 0, 32);
        leftLeg.addBox(10F, 1F, 10F, 6, 8, 8);
        setRotation(rightLeg, 1F, 2F, -1F);
        leftLeg.setTextureSize(64, 64);
        leftLeg.mirror = true;
        leftLeg.setRotationPoint(-1F, -2F, 1F);
        
        bipedRightLeg.addChild(rightLeg);
        bipedRightLeg.addChild(leftLeg);
    }
    
    public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
        super.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
        setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entity);
    }
    
    public void setRotation(ModelRenderer model, float x, float y, float z) {
        model.rotateAngleX = x;
        model.rotateAngleY = y;
        model.rotateAngleZ = z;
    }
}

 

in armor class

    @SideOnly(Side.CLIENT)
    public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, ModelBiped _default) {
        ModelElectricBoots electricBoots = new ModelElectricBoots();
        return electricBoots;
    }

Link to comment
Share on other sites

49 minutes ago, Ragnar said:

my class does not extend ItemArmor, how can I render the armor

As far as the game is concerned your item is not an armor piece. You will need a Layer Model like Jabelar said in his first post.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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.

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



×
×
  • Create New...

Important Information

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