1
Mod texture don't work
Hi, I'm programming a mod for minecraft of course but when i create a block the textures won't show. Can someone help me ??
Thanks a lot
Thanks a lot
Create an account or sign in to comment.
10
1
in the main class instead of Basic make it basic and change the folder name to lower case basic (i had the same problem first with my mod)
1
It still doesn't work
1
Like this ??
package tutorial.basic.block;
import tutorial.basic.basic;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
public class MeteorBlock extends Block{
public MeteorBlock(int i, Material p_i45394_1_) {
super(p_i45394_1_);
super.setCreativeTab(CreativeTabs.tabBlock);
this.setHardness(5F);
this.setResistance(5.0F);
this.setLightLevel(0.5F);
}
}
1
Btw, why do you have the set light level stuff in the set creative tab function and not in the constructor?? That makes no sense and will make it impossible to appear in a creative tab. At least put a super.setCreativeTab(string) there if you absolutely need to have them there.
1
First of all, the string where you specify texture should be all lowercase. Just look at the vanilla code. If that doesnt work, i'm pretty sure you have typed in the wrong texture name or the wrong modid. Also, have you refreshed your workspace? And make sure the assets folder is in your build path.
1
Ok here is my code
package tutorial.basic;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import tutorial.basic.block.MeteorBlock;;
@Mod(modid="Basic", name="Basic", version="1.0.0")
public class Basic {
public static Block MeteorBlock = new MeteorBlock(3000, Material.rock).setBlockName("MeteorBlock").setBlockTextureName("Basic:MeteorBlock");
// The instance of your mod that Forge uses.
@Instance("Basic")
public static Basic instance;
// Says where the client and server 'proxy' code is loaded.
@SidedProxy(clientSide="tutorial.basic.client.ClientProxy", serverSide="tutorial.basic.CommonProxy")
public static CommonProxy proxy;
@EventHandler
public void load(FMLInitializationEvent event) {
proxy.registerRenderers();
ItemStack dirt = new ItemStack(Blocks.dirt);
GameRegistry.addRecipe(new ItemStack(Blocks.dirt), new Object[]{
"yyy" ,
"yxy" ,
"yyy" ,
'y', Blocks.sponge, 'x', Blocks.bedrock, 'z', Items.arrow
});
GameRegistry.addSmelting(Blocks.bedrock, new ItemStack(Blocks.obsidian), 20F);
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
// Stub Method
}
public Basic(){
GameRegistry.registerBlock(MeteorBlock, "MeteorBlock");
}
}
and my MeteorBlock.java package tutorial.basic.block;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
public class MeteorBlock extends Block{
public MeteorBlock(int i, Material p_i45394_1_) {
super(p_i45394_1_);
this.setCreativeTab(CreativeTabs.tabBlock);
this.setHardness(5F);
this.setResistance(5.0F);
this.setLightLevel(0.5F);
}
}
1
1
Well we will need to see the code.
Just post the code where you set the texture name/file.
Just post the code where you set the texture name/file.
1
Sure, someone can help you.
1