Jump to content

Recommended Posts

Posted

Hi, I added my custom armour into the game, and everything working, textures, name everything apart from it actually being in the menu! My Armour is only craftable, not even appearing in the creative interface! Help please? Armour Code=

 

package me.irule2222.stuffmod;

import net.minecraft.entity.Entity;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;

public class ElderArmour extends ItemArmor {





public ElderArmour(ArmorMaterial material, int id,
		int placement) {
	super(material, id, placement);
	setCreativeTab(StuffMain.StuffMod);

	if (placement == 0) {//if placement is helmet
		this.setTextureName(StuffMain.modid + ":" + "ElderHelmet");

	}else if (placement == 1) {// piece is chestplate
		this.setTextureName(StuffMain.modid + ":" + "ElderChestplate");

	}else if (placement == 2) {// piece is leggins
		this.setTextureName(StuffMain.modid + ":" + "ElderLeggins");

	}else if (placement == 3) {// piece is boots
		this.setTextureName(StuffMain.modid + ":" + "ElderBoots");

	}
	}

public String getArmorTexture(ItemStack stack, Entity entity, int Slot, String type) {
	if (stack.getItem() == StuffMain.ElderHelmet || stack.getItem() == StuffMain.ElderChestplate || stack.getItem() == StuffMain.ElderBoots) {
		return StuffMain.modid + ":" + "textures/models/armor/ElderArmor_1.png";
		}
	if (stack.getItem() == StuffMain.ElderLeggins) {
		return StuffMain.modid + ":" + "textures/models/armor/ElderArmor_2.png";

	}else{
		return null;
	}

}

}

Posted

Try setting your creative tab in your main mod class and removing it from this class.

 

This actually doesn't matter

 

@OP: In which order do you instantiate the item and creativetab? Sounds to me you instantiate the item first and then the creativetab.

We can't tell for sure as long as you don't show us your main mod file.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

Try setting your creative tab in your main mod class and removing it from this class.

 

This actually doesn't matter

 

@OP: In which order do you instantiate the item and creativetab? Sounds to me you instantiate the item first and then the creativetab.

We can't tell for sure as long as you don't show us your main mod file.

 

package me.irule2222.stuffmod;

import me.irule2222.suffmod.worldgen.ElderOreWG;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

/**
* 
*/


@Mod(modid = StuffMain.name, version = StuffMain.version) 
public class StuffMain {

	//*create the base for things*\\
	public static final String modid = "StuffMod";
	public static final String version = "Pre Alpha 0.1.0";
	public static final String name = "Stuff Mod";

	public static int helmetId;
	public static int chestplateId;
	public static int legginsId;
	public static int bootsId;


	public static Block RottenWood;
	public static Block ElderOre;
	public static Block poo;
	public static Item DigestedMush;
	public static Item RottenFlakes;
	public static Item ElderIngot;
	public static ToolMaterial Eldert = EnumHelper.addToolMaterial("Eldert", 3, 99999, 12.0f, 90.0f, 10);
	public static ToolMaterial Redstone = EnumHelper.addToolMaterial("Redstone", 1, 200, 6.0f, 5.0f, 10);
	public static ArmorMaterial Elder = EnumHelper.addArmorMaterial("Elder", 99, new int [] {6, 16 ,12 ,6}, 10);
	//public static ToolMaterial test = EnumHelper.addToolMaterial(name, harvestLevel, maxUses, efficiency, damage, enchantability)
	//public static Armormaterial test = EnumHelper.addArmorMaterial(name, durability, reductionAmounts, enchantability)

	public static Item ElderSword; 
	public static Item RedstoneSword;
	public static Item RedstonePickaxe;
	public static Item RedstoneHoe;
	public static Item RedstoneShovel;
	public static Item RedstoneAxe;
	public static Block ElderBlock;

    public static Item ElderHelmet = new ElderArmour(Elder, helmetId, 0).setUnlocalizedName("ElderHelmet"); 
	public static Item ElderChestplate = new ElderArmour(Elder, chestplateId, 1).setUnlocalizedName("ElderChestplate");
	public static Item ElderLeggins = new ElderArmour(Elder, legginsId, 2).setUnlocalizedName("ElderLeggins"); 
	public static Item ElderBoots = new ElderArmour(Elder, bootsId, 3).setUnlocalizedName("Elderboots"); 




	public static ElderOreWG worldgen1 = new ElderOreWG();

	public static CreativeTabs StuffMod = new CreativeTabs("StuffMod"){

		public Item getTabIconItem() {
			return Item.getItemFromBlock(StuffMain.ElderOre);
		}

	};

	//register things
	@EventHandler
	public void preinit(FMLPreInitializationEvent e){

		GameRegistry.registerItem(ElderHelmet, "ElderHelmet");
		GameRegistry.registerItem(ElderChestplate, "ElderChestplate");
		GameRegistry.registerItem(ElderLeggins, "ElderLeggins");
		GameRegistry.registerItem(ElderBoots, "ElderBoots");

		//ROttenFlakes
		RottenFlakes = new Item().setUnlocalizedName("RottenFlakes").setCreativeTab(StuffMod).setTextureName(modid + ":" + "RottenFlakes").setFull3D();
		GameRegistry.registerItem(RottenFlakes, "RottenFlakes");

		//ElderIngot
		ElderIngot = new Item().setUnlocalizedName("ElderIngot").setCreativeTab(StuffMod).setFull3D().setTextureName(modid + ":" + "ElderIngot");
		GameRegistry.registerItem(ElderIngot, "ElderIngot");



		//rottenwood
		RottenWood = new RottenWood().setBlockName("RottenWood").setCreativeTab(StuffMod).setHardness(0).setBlockTextureName(modid + ":" + "RottenWood");
		GameRegistry.registerBlock(RottenWood, "RottenWood");

		//Elder Block
		ElderBlock = new ElderBlock().setBlockName("ElderBlock").setCreativeTab(StuffMod).setHardness(10.0f).setResistance(10.0f);
		GameRegistry.registerBlock(ElderBlock, "ElderBlock");

		//poo
		poo = new Poo().setBlockName("Poo").setCreativeTab(StuffMod).setHardness(0).setBlockTextureName(modid + ":" + "poo");
		GameRegistry.registerBlock(poo, "Poo");

		//Digested Mush
		DigestedMush = new Item().setUnlocalizedName("DigestedMush").setCreativeTab(StuffMod).setTextureName(modid + ":" + "DGMSH");
		GameRegistry.registerItem(DigestedMush, "DigestedMush");


		//world generation
		GameRegistry.registerWorldGenerator(worldgen1, 1);

		//tools
		ElderSword = new ElderSwordClass().setUnlocalizedName("ElderSword");
		GameRegistry.registerItem(ElderSword, "ElderSword");

		RedstoneSword = new RedstoneSwordClass().setUnlocalizedName("RedstoneSword");
		GameRegistry.registerItem(RedstoneSword, "RedstoneSword");

		RedstonePickaxe = new RedstonePickaxeClass().setUnlocalizedName("RedstonePickaxe");
		GameRegistry.registerItem(RedstonePickaxe, "RedstonePickaxe");

		RedstoneHoe = new RedstoneHoeClass().setUnlocalizedName("RedstoneHoe");
		GameRegistry.registerItem(RedstoneHoe, "RedstoneHoe");

		RedstoneShovel = new RedstoneShovelClass().setUnlocalizedName("RedstoneShovel");
		GameRegistry.registerItem(RedstoneShovel, "RedstoneShovel");

		RedstoneAxe = new RedstoneAxeClass().setUnlocalizedName("RedstoneAxe");
		GameRegistry.registerItem(RedstoneAxe, "RedstoneAxe");

		//Armour











		//Elder Ore
		ElderOre = new ElderOre().setBlockName("ElderOre").setCreativeTab(StuffMod).setHardness(5f).setResistance(7.0f).setBlockTextureName(modid + ":" + "ElderOre");
		GameRegistry.registerBlock(ElderOre, "ElderOre");




		//wood biome
		//WoodBiome = new BiomeGenWoodBiome(137).setBiomeName("Wood Land");
		//BiomeDictionary.registerBiomeType(WoodBiome);
	   // BiomeManager.addSpawnBiome(WoodBiome);


		//Crafting Recepies
		GameRegistry.addRecipe(new ItemStack(ElderSword, 1), new Object [] {
			" E ", 
			"EEE",
			" S ", 'E', ElderIngot, 'S', Item.itemRegistry.getObject("stick")});

		GameRegistry.addRecipe(new ItemStack(ElderBlock, 1), new Object [] {
			"EEE",
			"EEE",
			"EEE", 'E', ElderIngot});

		GameRegistry.addRecipe(new ItemStack(RedstoneSword, 1), new Object [] {
			" R ",
			" R ",
			" S ", 'R', Item.itemRegistry.getObject("redstone"), 'S', Item.itemRegistry.getObject("stick")
		});

		GameRegistry.addRecipe(new ItemStack(RedstonePickaxe, 1), new Object [] {
			"RRR",
			" S ",
			" S ", 'R', Item.itemRegistry.getObject("redstone"), 'S', Item.itemRegistry.getObject("stick")
		});

		GameRegistry.addRecipe(new ItemStack(RedstoneShovel, 1), new Object [] {
			" R ",
			" S ",
			" S ", 'R', Item.itemRegistry.getObject("redstone"), 'S', Item.itemRegistry.getObject("stick")
		});

		GameRegistry.addRecipe(new ItemStack(RedstoneAxe, 1), new Object [] {
			"RR ",
			"RS ",
			" S ", 'R', Item.itemRegistry.getObject("redstone"), 'S', Item.itemRegistry.getObject("stick")
		});

		GameRegistry.addRecipe(new ItemStack(RedstoneHoe, 1), new Object [] {
			"RR ",
			" S ",
			" S ", 'R', Item.itemRegistry.getObject("redstone"), 'S', Item.itemRegistry.getObject("stick")
		});

	    GameRegistry.addRecipe(new ItemStack(ElderHelmet, 1), new Object [] {"EEE","E E",	"   ", 'E', ElderIngot});

		GameRegistry.addRecipe(new ItemStack(ElderChestplate, 1), new Object [] {"E E", "EEE","EEE", 'E', ElderIngot});

		GameRegistry.addRecipe(new ItemStack(ElderLeggins, 1), new Object [] {"EEE", "E E", "E E", 'E', ElderIngot});

		GameRegistry.addRecipe(new ItemStack(ElderBoots, 1), new Object [] {"   ", "E E", "E E", 'E', ElderIngot});	










		GameRegistry.addShapelessRecipe(new ItemStack(ElderIngot, 9), ElderBlock);



		//Smelting recepie
		GameRegistry.addSmelting(ElderOre, new ItemStack(ElderIngot), 2.50F);

	}
}

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Unlock an Instant $100 OFF with the Exclusive Temu Coupon Code ALF401700! Whether you're a first-time shopper or a loyal returning customer, this verified Temu promo code ALF401700 is your gateway to incredible savings on thousands of products. By applying code ALF401700 at checkout, you’ll receive a guaranteed $100 discount on your purchase, plus enjoy additional savings of up to 50% OFF on selected items. This special coupon is designed to maximize your discounts, making your shopping experience at Temu more affordable than ever. Why Choose Temu Coupon Code ALF401700 in 2025? First-Time Shoppers: Score a massive 50% off your first order plus a flat $100 OFF using promo code ALF401700. Returning Customers: Don’t miss out! Use ALF401700 to claim a generous $100 OFF on your next purchase. Massive Clearance Sales: With Temu’s ongoing 2025 clearance events, this code unlocks up to 90% OFF on select deals. Global Reach: Whether you shop from the USA, Canada, Europe, Asia, or beyond, Temu coupon ALF401700 works worldwide. 2025’s Top Temu Discounts Powered by ALF401700: Temu $100 OFF New User Promo — ALF401700 Temu Exclusive Discount for Returning Shoppers — ALF401700 Memorial Day Special: $100 OFF Using ALF401700 Country-Specific Offers: USA, Japan, Mexico, Chile, Colombia, Malaysia, Philippines, South Korea, Saudi Arabia, Qatar, Germany, France, Israel — all accept code ALF401700 Free Gift Unlocks — Apply ALF401700 Without Referrals Stackable Bundles: Combine ALF401700 for $100 OFF with up to 50% sitewide discounts 100% OFF Flash Deals during Temu Events with ALF401700 How to Redeem Your Temu Coupon Code ALF401700: Visit the official Temu website or open the Temu app. Select your favorite products and add them to your cart. Enter the promo code ALF401700 in the discount code field at checkout. Watch your total instantly drop by $100 and enjoy any additional percentage discounts automatically applied. Complete your order and enjoy huge savings! Key Benefits of Using ALF401700 Temu Promo Code: Verified and Tested: This code is active and guaranteed to work for 2025. Applicable for All Users: New or existing customers get to enjoy the perks. Works Across Multiple Countries: Perfect for international shoppers. No Minimum Purchase Required: Use it anytime to save $100. Perfect for Big and Small Orders: Whether buying essentials or splurging, save big with ALF401700. Temu Coupon Code ALF401700 by Region: 🇺🇸 United States — Save $100 OFF 🇨🇦 Canada — Instant $100 Discount 🇬🇧 United Kingdom — Exclusive $100 OFF 🇯🇵 Japan — Hot $100 OFF Deal 🇲🇽 Mexico — Get $100 OFF 🇨🇱 Chile — 2025 Special Discount 🇰🇷 South Korea — Massive Savings 🇵🇭 Philippines — Extra $100 OFF 🇸🇦 Saudi Arabia — Verified Promo 🇶🇦 Qatar — Top Discount 🇩🇪 Germany — Exclusive Savings 🇫🇷 France — Coupon Works 🇮🇱 Israel — Huge Discount Final Words: Make 2025 your year of unbeatable savings with the Temu coupon code ALF401700. Act now to claim your $100 OFF plus unlock additional discounts on thousands of products. Whether shopping for fashion, electronics, home essentials, or gifts, this is the best Temu promo code to maximize your budget. Download the Temu app today, enter ALF401700 at checkout, and watch the savings roll in!
    • Verified users can now unlock a $100 OFF Temu Coupon Code using the verified promo code [ALF401700]. This Temu $100 OFF code works for both new and existing customers and can be used to redeem up to 50% off your next order. Our exclusive Temu coupon code [ALF401700] delivers a flat $100 OFF on top of existing deals. First-time customers using code ALF401700 can save an extra 100% off select items. Returning users also qualify for an automatic $100 OFF discount just by applying this code at checkout. But wait—there’s more. With our Temu coupon codes for 2025, users can score up to 90% OFF on clearance items. Whether you’re shopping in the USA, Canada, UK, or elsewhere, Temu promo code ALF401700 unlocks extra discounts tailored to your account. Some users are saving 100% on items using this 2025 Temu promo code. 🔥 Temu Coupon Highlights Using Code [ALF401700]: Temu new user code – ALF401700: Save 50% off your first order + $100 OFF. Temu promo for existing customers – ALF401700: Enjoy flat $100 OFF instantly. Global availability: Works in the USA, UK, Canada, Germany, France, Japan, Chile, Colombia, Malaysia, Mexico, South Korea, Philippines, Saudi Arabia, Qatar, Pakistan, and more. Top 2025 Coupon Deal: Get $200 OFF plus 100% bonus discounts using code ALF401700. Top-Ranked Temu Deals for 2025 (Coupon Code: ALF401700): ✅ Temu $100 OFF Memorial Day Sale — Use ALF401700 ✅ Temu First Order Coupon — Use ALF401700 for 50% + $100 OFF ✅ Temu USA Coupon Code — Save $100 instantly with ALF401700 ✅ Temu Japan, Germany, Chile Codes — All support ALF401700 ✅ Temu Reddit Discount – $100 OFF: Valid for both new and old users ✅ Temu Coupon Bundle 2025 — $100 OFF + up to 50% slash ✅ 100% OFF Free Gift Code — Use ALF401700, no invite needed ✅ Temu Sign-Up Bonus Promo — Get a welcome $100 OFF instantly ✅ Free Temu Code for New Users — Use ALF401700, no referral required  Temu Clearance Codes 2025 — Use ALF401700 for 85–100% discounts Why ALF401700 is the Best Temu Code in 2025 Using Temu code ALF401700 is your ticket to massive savings, free shipping, first-order discounts, and stackable coupon bundles. Whether you're browsing electronics, fashion, home goods, or beauty products, this verified Temu discount code offers real savings—up to 90% OFF + $100 OFF on qualified orders. 💡 Pro Tip: Apply ALF401700 during checkout in the Temu app or website to activate your instant $100 discount, even if you’re not a new user. Temu $100 OFF Code by Country (All Use ALF401700): 🇺🇸 Temu USA – ALF401700 🇯🇵 Temu Japan – ALF401700 🇲🇽 Temu Mexico – ALF401700 🇨🇱 Temu Chile – ALF401700 🇨🇴 Temu Colombia – ALF401700 🇲🇾 Temu Malaysia – ALF401700 🇵🇭 Temu Philippines – ALF401700 🇰🇷 Temu Korea – ALF401700 🇵🇰 Temu Pakistan – ALF401700 🇫🇮 Temu Finland – ALF401700 🇸🇦 Temu Saudi Arabia – ALF401700 🇶🇦 Temu Qatar – ALF401700 🇫🇷 Temu France – ALF401700 🇩🇪 Temu Germany – ALF401700 🇮🇱 Temu Israel – ALF401700 Temu Coupon Code [ALF401700] Summary for SEO: Temu $100 OFF Code  Temu First Order Discount Code 2025  Temu Verified Promo Code ALF401700  Temu 50% OFF + $100 Bonus  Temu 100% OFF Code 2025  Temu App Promo ALF401700  Temu Working Discount Code 2025 
    • Hey there, nothing to do with the code, I am just suggesting you use Intelij IDEA. Trust me, it is the best.
    • Hey there, nothing to do with the code, I am just suggesting you use Intelij IDEA. Trust me, it is the best.
    • You can check the config of Geckolib and Mowzie's Mobs - maybe there is a way to disable some render features
  • Topics

×
×
  • Create New...

Important Information

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