Posted December 22, 201410 yr My sword texture isn't showing, all it is is a giant purple and black checkered block going through me(ow! )! SteelWeaponsMod.java <<< This is my main mod file. package JakeT24.SteelModPlus; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.registry.GameRegistry; @Mod(modid = "swm", name = "Steel Weapons Mod", version = "0.1") public class SteelWeaponsMod { public static ItemSword SteelSword; public static Block SteelOre; public static ToolMaterial SteelA = EnumHelper.addToolMaterial("Steel", 3, 999, 15.0F, 2.5F, 10); @EventHandler public void preInit(FMLPreInitializationEvent event){ SteelSword = (ItemSword) new SteelSword(SteelA).setUnlocalizedName("SteelSword"); SteelSword.setCreativeTab(CreativeTabs.tabCombat); SteelSword.setMaxStackSize(1); SteelOre = new SteelOre(Material.iron).setUnlocalizedName("SteelOre"); SteelOre.setCreativeTab(CreativeTabs.tabBlock); GameRegistry.registerItem(SteelSword, SteelSword.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(SteelOre, SteelOre.getUnlocalizedName().substring(5)); } @EventHandler public void init(FMLInitializationEvent event){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(SteelSword, 8000, new ModelResourceLocation("swm:item_SteelSword", "inventory")); } @EventHandler public void postInit(FMLPostInitializationEvent event){ } } SteelSword.json <<< This is my rendering .json file I have in assets/swm/models/items along with my SteelSword.png! { "parent": "builtin/generated", "textures": { "layer0": "swm:items/SteelSword" }, "display": { "thirdperson": { "rotation": [ -90, 0, 0 ], "translation": [ 0, 1, -3 ], "scale": [ 0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [ 0, -135, 25 ], "translation": [ 0, 4, 2 ], "scale": [ 1.7, 1.7, 1.7 ] } } } Check out my mod- SteelMod++ and maybe we can support each other Help me learn and some day I will be able to help you learn!
December 22, 201410 yr Author Oh. and if you could tell me how to set it's tooltip that would be kool. And before you criticize me on how I'm not trying hard enough iv'e spent 8 hours of my day sitting hear with my laptop plugged into my TV trying to figure out Forge 1.8 and yes I did look for tutorials. Thats mostly how I got this far! Check out my mod- SteelMod++ and maybe we can support each other Help me learn and some day I will be able to help you learn!
December 22, 201410 yr Look at the addInformation method in the Item class for tooltips. If you don't know how to use it, see how vanilla items with tooltips implement it. BEFORE ASKING FOR HELP READ THE EAQ! I'll help if I can. Apologies if I do something obviously stupid. If you don't know basic Java yet, go and follow these tutorials.
December 22, 201410 yr Author Cool, but can you tell me how to set my texture cause its not working Check out my mod- SteelMod++ and maybe we can support each other Help me learn and some day I will be able to help you learn!
December 22, 201410 yr you need to reference a variable How does: SteelSword = (ItemSword) new SteelSword(SteelA).setUnlocalizedName("SteelSword"); not give you an error? you need something like: SteelSword mySword = (ItemSword) new SteelSword(SteelA).setUnlocalizedName("SteelSword") and to add texture to your item you need something like this: mySword.setTextureName(modid + ":" + name_of_your_file); make sure you place your png file into the correct folder (assets/swm/textures/items)
December 22, 201410 yr Author That I have tried, it only works 1.7.10 and down Check out my mod- SteelMod++ and maybe we can support each other Help me learn and some day I will be able to help you learn!
December 22, 201410 yr See Eternaldoom's post on updating to 1.8(http://www.minecraftforge.net/forum/index.php/topic,24263.0.html). The section on Blocks and Items is especially helpful.
December 22, 201410 yr Author Can I have some help understanding this? Check out my mod- SteelMod++ and maybe we can support each other Help me learn and some day I will be able to help you learn!
December 22, 201410 yr Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(SteelSword, 8000, new ModelResourceLocation("swm:item_SteelSword", "inventory")); should be changed to Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(SteelSword, 0, new ModelResourceLocation("swm:SteelSword", "inventory")); Also, never capitalize the first letter of variables. Always capitalize the first letter of classes, though.
December 22, 201410 yr Author Hey Thanks! This made my texture get flat and look like the normal non-textured item, which I was worried about. So now I have this problem, it still isn't showing the texture. But it is flat like it should be, just purple and black. Check out my mod- SteelMod++ and maybe we can support each other Help me learn and some day I will be able to help you learn!
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.