Jump to content

thib92

Members
  • Posts

    16
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

thib92's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. oh, so I should make one item per piece of armor ?
  2. Oh I just clear my inventory and it's ok now. but the humain-readable name is missing, and the texture is missing !
  3. Okay, here is my code : package thib92.theusefulmod; import java.util.List; import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class RedstoneHelmet extends ItemArmor { public final static String[] subitemsNames = new String[] {"respiration1", "respiration2", "respiration3", "nightvision"}; private Icon[] iconList; public RedstoneHelmet(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { super(par1, par2EnumArmorMaterial, par3, par4); this.setHasSubtypes(true); this.setMaxDamage(0); this.setCreativeTab(CreativeTabs.tabCombat); for(int i = 0; i < subitemsNames.length; i++){ LanguageRegistry.addName(new ItemStack(this,1,i), subitemsNames[i]); } } @Override @SideOnly(Side.CLIENT) public Icon getIconFromDamage(int par1) { int i = MathHelper.clamp_int(par1, 0, 3); return this.iconList[i]; } @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.iconList = new Icon[subitemsNames.length]; for(int i = 0; i < subitemsNames.length; i++){ this.iconList[i] = par1IconRegister.registerIcon("theusefulmod:redstoneHelmet"); } } @Override @SideOnly(Side.CLIENT) public void getSubItems(int itemID, CreativeTabs tab, List itemList) { for(int i = 0; i < subitemsNames.length; i++){ itemList.add(new ItemStack(itemID,1,i)); } } @Override public String getUnlocalizedName(ItemStack item) { return this.getUnlocalizedName() + "." + subitemsNames[item.getItemDamage()]; } public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) { if (itemID == TheUsefulMod.redstoneHelmet.itemID || stack.itemID == TheUsefulMod.redstoneChestplate.itemID || stack.itemID == TheUsefulMod.redstoneBoots.itemID) { return "TheUsefulMod:textures/armor/redstone_1.png"; } if(itemID== TheUsefulMod.redstoneLeggings.itemID) { return "TheUsefulMod:textures/armor/redstone_2.png"; } return "TheUsefulMod:textures/armor/redstone_2.png"; } } When I open my inventory, I have no problem, but if I hover the item with my mouse, then... the game just ends !
  4. By damage value you mean subitem right ?
  5. okay, thank you very muuch ! And after this, how do I get my sub-items as a variable ?
  6. Sorry but I'm really really bad !! I started 3 days ago, so I don't know what you're talking about ! Could you be more precise please ? I don't have enough level yet to study that kind of file, I managed to study some easy ones but this one is really complicated !
  7. No, but that file is huge and I'm still a newbie... I saw things about "metadata" but I don't know how it works...
  8. Hi everyone, I'd like to know how to make a sub-item, like dyes (for instance the Id of an item is 6549, another is 6549:1, another is 6549:2 etc...) Please reply, - Thib92
  9. Yes, this works to kake the item in your inventory glow. I'd like to make the armor glow when I wear it.
  10. Hi everybody, I'd like to know if it is possible to give a enchantement-like glowing on an armor ? I am already able to do it on items, but it doesn't apply to armors when worn, and I'd like to know if it is possible, and how. Thanks, - Thib92
  11. I just found it, I need a TickHandler. Resolved !
  12. okay, so I put the onArmorTickUpdate() in my armor class, and then inside it, put the code to toggle the light right ? And what are the parameters I need ?
  13. I want to make the player glow when he has a specific armor (helmet OR chestplate OR leggings OR boots)
  14. Sorry but I'm new to moding. What do you mean by doing it with blockActivate() or itemRightClick() ?
×
×
  • Create New...

Important Information

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