Posted August 25, 201411 yr I'm learning how to make mods, I have a bit of Java knowledge. I'm trying to give my block "block1" and item "item1" a texture, I have made 2 .png files using paint.net. This is my code: learning.java: http://pastebin.com/9E7cN0Ur Block1.java: http://pastebin.com/4nA0zAqX Package explorer: Texures: block1.png: item1.png: Log file: http://pastebin.com/AxxwjUgF Forge version: forge-1.7.2-10.12.2.1.21 I don't know why my textures don't work, in-game they have the purple-black "missing texture". Can anyone help me?
August 25, 201411 yr You are literally missing a t in the name of the textures folder in the assets directory. That is all. I am the self-nominated Lord of the Mastodons and don't you dare deny it. Also, check out my YouTube channel: https://www.youtube.com/user/DerpDerp44/
August 25, 201411 yr block1.setBlockTextureName(MODID + ":" + "block1.png"); if you add .PNG at the end of the name it try to find MODID/textures/blocks/block1.png.png block1.setBlockTextureName(MODID + ":block1"); try this. And if this isn't work try this; block1.setBlockTextureName("block1"); and add block1.java @SideOnly(Side.CLIENT) @Override public void registerBlockIcons(IIconRegister reg) { this.blockIcon = reg.registerIcon(learning.MODID + ":" + this.getTextureName()); } Or also you can use my addBlock function import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.extend.mod.ref; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.util.IIcon; public class addblock extends Block { public addblock(String name, Material material, SoundType sound, float hardness, String item, int level) { super(material); this.setHardness(hardness); this.setStepSound(sound); this.setCreativeTab(CreativeTabs.tabBlock); this.setBlockName(name); this.setBlockTextureName(name); this.setHarvestLevel(item, level); GameRegistry.registerBlock(this, name); } @SideOnly(Side.CLIENT) @Override public void registerBlockIcons(IIconRegister reg) { this.blockIcon = reg.registerIcon(ref.uid + ":" + this.getTextureName()); } } when you register; public static Block blackDiamondOre; public static Block blackDiamondBlock; this.blackDiamondBlock = new addblock("blackdiamondblock", Material.iron, Block.soundTypeStone, 2.0F, "pickaxe", 2); this.blackDiamondOre = new addore("blackdiamondore", Block.soundTypeStone, 4.0F, "pickaxe", 2);
August 25, 201411 yr I know they are same but I write sometime different thinks and I have you use registerBlockIcons but you don't need
August 26, 201411 yr Author So I changed a couple of things, but it still doesn't work: Package explorer: MyMod.java: http://pastebin.com/wAAQviYW I also tried without the MODID + ":". EDIT: I'm following this tutorial, I think I'm doing exactly the same:
August 26, 201411 yr Minecraft is case-sensitive, so either change your modid to mymod (all lowercase), or the assets directory to assets/MyMod/. Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
August 26, 201411 yr Author It works! MODID.toLowerCase() and fixing"texures" to "textures" did the trick! Thanks everyone for helping me!
August 27, 201411 yr Author About the Package explorer structure, why does it works in this video: ? And where do I have to put my language files?
August 28, 201411 yr Author Do I need to search for another tutorial series or is ScratchForFun not that bad?
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.