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

Show me your Emerald_1.png and Emerald_2.png

I'm beginner in java and in minecraft modding.

Please be specific.

Any code examples are appreciated.

Sorry for my english i'm from Czech republic.

Please hit that thank you button if i helped :)

and show me code in your class where you are registering the armor

I'm beginner in java and in minecraft modding.

Please be specific.

Any code examples are appreciated.

Sorry for my english i'm from Czech republic.

Please hit that thank you button if i helped :)

  • Author

and show me code in your class where you are registering the armor

 

 

 

package com.BetterArmourAndTools.armour;

 

import net.minecraft.client.renderer.texture.IIconRegister;

import net.minecraft.enchantment.EnchantmentHelper;

import net.minecraft.entity.Entity;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.item.ItemArmor;

import net.minecraft.item.ItemStack;

import net.minecraft.item.ItemArmor.ArmorMaterial;

import net.minecraft.potion.Potion;

import net.minecraft.potion.PotionEffect;

import net.minecraft.world.World;

 

import com.BetterArmourAndTools.blocksitems.BetterArmourAndTools;

import com.BetterArmourAndTools.main.mainRegistry;

 

public class emeraldArmour extends ItemArmor{

 

private String [] armourTypes = new String [] {"helmetE", "chestplateE", "legsE", "bootsE"};

 

public emeraldArmour(ArmorMaterial armorMaterial, int renderIndex, int armourType){

super(armorMaterial, renderIndex, armourType);

}

 

@Override

public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer){

if(stack.getItem().equals(BetterArmourAndTools.helmetEmerald)|| stack.getItem().equals(BetterArmourAndTools.chestplateEmerald)|| stack.getItem().equals(BetterArmourAndTools.legsEmerald)){

return "tools:textures/armor/Emerald_1.png";

}

 

if(stack.getItem().equals(BetterArmourAndTools.legsEmerald)){

return "tools:textures/armor/Emerald_2.png";

 

}

 

else return null;

}

@Override

public void registerIcons(IIconRegister reg){

if(this == BetterArmourAndTools.helmetEmerald)

this.itemIcon = reg.registerIcon("tools:helmetE");

if(this == BetterArmourAndTools.chestplateEmerald)

this.itemIcon = reg.registerIcon("tools:chestplateE");

if(this == BetterArmourAndTools.legsEmerald)

this.itemIcon = reg.registerIcon("tools:legsE");

if(this == BetterArmourAndTools.bootsEmerald)

this.itemIcon = reg.registerIcon("tools:bootsE");

}

 

@Override

public void onArmorTick(World world, EntityPlayer player, ItemStack stack){

if(stack.getItem() == BetterArmourAndTools.bootsEmerald){

int j = EnchantmentHelper.getEnchantmentLevel(mainRegistry.speedBoost.effectId, stack);

if(j > 0){

player.addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 50, j - 1));

}

}

 

 

}

 

}

 

 

NEWB! in java im sorry :/

Ok thats usefull too but i mean your BetterArmourAndTool class

I'm beginner in java and in minecraft modding.

Please be specific.

Any code examples are appreciated.

Sorry for my english i'm from Czech republic.

Please hit that thank you button if i helped :)

Well it doesnt matter i found it you got problem in here :

@Override
      public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer){
         if(stack.getItem().equals(BetterArmourAndTools.helmetEmerald)|| stack.getItem().equals(BetterArmourAndTools.chestplateEmerald)|| stack.getItem().equals(BetterArmourAndTools.legsEmerald)){
            return "tools:textures/armor/Emerald_1.png";
         }
         
         if(stack.getItem().equals(BetterArmourAndTools.legsEmerald)){
               return "tools:textures/armor/Emerald_2.png";
            
            }

 

in the first one emerald 1 you need to change legs to boots :)

I'm beginner in java and in minecraft modding.

Please be specific.

Any code examples are appreciated.

Sorry for my english i'm from Czech republic.

Please hit that thank you button if i helped :)

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.