Jump to content

Recommended Posts

Posted

Recently i decided to make some armor and after a long time i finally got it in the game but the model is not loading... can anybody help?

 

Here is my code for making the ruby armor material, i believe at the top where it says ":ruby" is telling minecraft where to pull the model from, not sure tho. 

public enum ModArmorMaterial implements IArmorMaterial {

    rubyMaterial(Zenox.Mod_ID + ":ruby", 5, new int[] { 7, 9, 11, 7 }, 420, SoundEvents.field_226124_Y_, 6.9F, () -> {
        return Ingredient.fromItems(RegistryHandler.testitem);  });


    private static final int[] MAX_DAMAGE_ARRAY = new int[] { 16, 16, 16, 16 };
    String name;
    int maxDamageFactor;
    int[] damageReductionAmountArray;
    int enchantability;
    SoundEvent soundEvent;
    float toughness;
    LazyValue<Ingredient> repairMaterial;

   private ModArmorMaterial(String nameIn, int maxDamageFactorIn, int[] damageReductionAmountIn,
                     int enchantabilityIn, SoundEvent soundEventIn, float toughnessIn,
                     Supplier<Ingredient> repairMaterialIn) {
        this.name = nameIn;
        this.maxDamageFactor = maxDamageFactorIn;
        this.damageReductionAmountArray = damageReductionAmountIn;
        this.enchantability = enchantabilityIn;
        this.soundEvent = soundEventIn;
        this.toughness = toughnessIn;
        this.repairMaterial = new LazyValue<>(repairMaterialIn);
    }

    @Override
    public int getDurability(EquipmentSlotType slotIn) {
        return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * this.maxDamageFactor;
    }

    @Override
    public int getDamageReductionAmount(EquipmentSlotType slotIn) {
        return this.damageReductionAmountArray[slotIn.getIndex()];
    }

    @Override
    public int getEnchantability() {
        return this.enchantability;
    }

    @Override
    public SoundEvent getSoundEvent() {
        return this.soundEvent;
    }

    @Override
    public Ingredient getRepairMaterial() {
        return this.repairMaterial.getValue();
    }

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public float getToughness() {
        return this.toughness;
    }
}

 

 

And here is me making all the specific armor pieces (not sure if its needed but might as well add it.


        event.getRegistry().register(new ArmorItem(ModArmorMaterial.rubyMaterial, EquipmentSlotType.HEAD,
                new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName("ruby_helmet"));

        event.getRegistry().register(new ArmorItem(ModArmorMaterial.rubyMaterial, EquipmentSlotType.CHEST,
                new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName("ruby_chest_plate"));

        event.getRegistry().register(new ArmorItem(ModArmorMaterial.rubyMaterial, EquipmentSlotType.LEGS,
                new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName("ruby_leggings"));

        event.getRegistry().register(new ArmorItem(ModArmorMaterial.rubyMaterial, EquipmentSlotType.FEET,
                new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName("ruby_boots"));

 

 

and finally as you can see the files are tehre...

image.thumb.png.719710835d5911c023e57056ce882ff1.png

Posted

Is your models.armor package in textures models/armor on the filesystem, or actually named models.armor? I've seen that happen before where it ends up actually being named "models.armor", and that won't work

  • Thanks 1
Posted (edited)

i named it that myself when i made it, should i rename it to something else?

 

i fixed it, thanks for the help!!!

Edited by Adam1223
Posted

 

First define what version of minecraft you use, in 1.14.4 I already found the solution, click on my user to see the link, with that code I had lag problems if you have the same problem let me know

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.