Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

instead of adding all 4 armor pieces, i only wanted the boots. that's why i only added the boots texture in the layer.png, but that didn't work so i added the leggings with it and it used the leggings instead of the boots and i have no idea why

 

iteminit:

			public static final RegistryObject<ArmorItem> lIGHTNING_BOOTS = ITEMS.register("lightning_boots",
		            () -> new ArmorItem(ArmorMaterialsInit.LIGHTNING_BOOTS, EquipmentSlot.FEET,
		                    new Item.Properties().tab(Electrified.ELECTRIFIED_TAB)));

 

armorMaterialsInit:

package com.tobywig.electrified.init;

import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.util.LazyLoadedValue;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.ArmorMaterial;
import net.minecraft.world.item.crafting.Ingredient;

import java.util.function.Supplier;

import com.tobywig.electrified.Electrified;

public enum ArmorMaterialsInit implements ArmorMaterial {
    LIGHTNING_BOOTS("lightning_boots", 28, new int[]{3, 5, 8, 3}, 19, SoundEvents.ARMOR_EQUIP_GOLD,
            2.0F, 0.0F, () -> Ingredient.of(itemInit.ELECTRIFIED_IRON_INGOT.get()));

    private static final int[] HEALTH_PER_SLOT = new int[]{13, 15, 16, 11};
    private final String name;
    private final int durabilityMultiplier;
    private final int[] slotProtections;
    private final int enchantmentValue;
    private final SoundEvent sound;
    private final float toughness;
    private final float knockbackResistance;
    private final LazyLoadedValue<Ingredient> repairIngredient;

    ArmorMaterialsInit(String p_40474_, int p_40475_, int[] p_40476_, int p_40477_,
                              SoundEvent p_40478_, float p_40479_, float p_40480_, Supplier<Ingredient> p_40481_) {
        this.name = p_40474_;
        this.durabilityMultiplier = p_40475_;
        this.slotProtections = p_40476_;
        this.enchantmentValue = p_40477_;
        this.sound = p_40478_;
        this.toughness = p_40479_;
        this.knockbackResistance = p_40480_;
        this.repairIngredient = new LazyLoadedValue<>(p_40481_);
    }

    public int getDurabilityForSlot(EquipmentSlot pSlot) {
        return HEALTH_PER_SLOT[pSlot.getIndex()] * this.durabilityMultiplier;
    }

    public int getDefenseForSlot(EquipmentSlot pSlot) {
        return this.slotProtections[pSlot.getIndex()];
    }

    public int getEnchantmentValue() {
        return this.enchantmentValue;
    }

    public SoundEvent getEquipSound() {
        return this.sound;
    }

    public Ingredient getRepairIngredient() {
        return this.repairIngredient.get();
    }

    public String getName() {
        return Electrified.MOD_ID + ":" + this.name;
    }

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

    public float getKnockbackResistance() {
        return this.knockbackResistance;
    }
}

 

Are you sure the boots texture is at the correct position in the texture file?

Please post the texture you used and a in game screenshot how it currently looks like.

2 minutes ago, magic_man said:

maybe it has to do with me adding a helmet? also changing it from layer 2 to layer 1 didn't change anything so now i think it's using something of the helmet

No the textures do not have the correct positions inside the textures.
Take a look at the vanilla armor layer textures.

  • Author

that worked, thx

i was using a texture from someone else as a template but apparently he had it wrong which meaned mine broke as well

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.