Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I have been trying to give my ore textures but they just a pink and black checkerboard,

Here's the code in my block file:

 

 

package MOnM;

import java.util.Random;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;

public class MineriteOre extends Block{

public static String textureName;

public MineriteOre(int par1, String textureName) {
super(par1, Material.rock);
setCreativeTab(CreativeTabs.tabBlock);
this.textureName = textureName;

}

public int idDropped(int par1, Random rand, int par2){
 return this.blockID;

}

public int quantityDropped(Random rand) {
	return 1;
}

@Override
public void registerIcons(IconRegister r){
	this.blockIcon = r.registerIcon(MOnM.modID + ":" + textureName);
}
}

 

I looked at and tried quite a few things but still, checkerboard D:

Search some then you can find several posts about this :P

Minecraft forums even has a few tutorials.

 

Antways textures must be located at assets/modid/textures/blocks/textureName.png

If you guys dont get it.. then well ya.. try harder...

try change

	@Override
public void registerIcons(IconRegister r){
	this.blockIcon = r.registerIcon(MOnM.modID + ":" + textureName);
}

to

 

	@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister r){
	this.blockIcon = r.registerIcon(MOnM.modid + ":" + (this.getUnlocalizedName().substring(5)));
}

  • Author

 

Here's my main mod file if it helps.

 

package MOnM;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = MOnM.modID, version = "0.1", name = "More Ores 'n Minerals")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class MOnM {

public static final String modID = "MOnM";

public static Block MineriteOre;
public static Item MineriteDust;
public static Item MineriteGem;


	@EventHandler
public void load(FMLInitializationEvent event){

MineriteOre = new MineriteOre(2000,"mineriteore").setHardness(3.0F).setLightValue(1).setUnlocalizedName("mineriteore");
registerBlock(MineriteOre, "Minerite Ore", MineriteOre.getUnlocalizedName());





GameRegistry.registerWorldGenerator(new WorldGeneratorMOnM());
}
	public static void registerBlock(Block block, String name, String unlocalizedName){
		GameRegistry.registerBlock(block, MOnM.modID + unlocalizedName);
		LanguageRegistry.addName(block, name);
	}
}

 

Your first code is right!

I do it the same way!

But he can not find the textures.

 

Just create these folders inside of your eclipse:

 

assets/yourmodnameinsmall/textures/blocks/yourTexture.png.

 

Then he should find your texture.

 

And that way you did it is perfect!

But it could be easier xD.

modid must be lowercase, and that is how it must be EVERYWHERE!

Both in your code and in your folder structure, so keep it lowercase everywhere :)

If you guys dont get it.. then well ya.. try harder...

nope. My mod does not need lowercase. it works too.

 

You will encounter issues later, trust me :)

And if you don't just search around, or wait and see you will :P

If you guys dont get it.. then well ya.. try harder...

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.