[indent=30px]I have tried to make a Bunker Block that is cheaper then Obsion but TNT proof and this is my code[/indent]
[indent=30px]
[/indent]
[indent=30px]
package net.minecraft.src;[/indent]
public class mod_Block extends BaseMod
{
public static final BlockBunker = new BlockBunker(160, 0).setBlockName
(BunkerBlock).setHardness(3F).setResistance(50F);
[indent=30px] public void load()
}
Modloader.registerBlock(Bunker);
Modloader.addName(Bunker, BunkerBlock);
Modloader.addRecipe(new ItemStack(Bunker, 1), new Bunker [1] {"###", "#%#", "###",
Character.valueOf('#'), Block.cobblestone, Character.valueOf('%'), Item.redstone})
}
public String getVersion()
{
return "1.2.5";
}
} [/indent]
BlockBunker
[indent=30px]
package net.minecraft.src;
import java.util.Random;[/indent]
public class BlockBunker extends Block
{
public BlockBunker(int par1, int par2)
{
super(par1, par2, Material.rock);
}
[indent=30px] /**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return Block.cobblestone.blockID;
}
}[/indent]
package net.minecraft.src;
import java.util.Random;
public class mod_Testium extends BaseMod
{
public static final Block testiumore = new Blocktestium(180,0).setHardness(3F).setResistance(5F).setLightValue(0.6F).setBlockName("testore");
public static final Item testingot = new Testiumingot(181).setItemName("testbar");
public static final Item testiumpickaxe = new TestiumPickaxe(182, EnumToolMaterial.TESTIUM).setItemName("testpickaxe");
public mod_Testium(){
//Block
ModLoader.registerBlock(testiumore);
ModLoader.addName(testiumore,"Testium Ore");
testiumore.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/testiumore.png");
}
{
//Ingot
testingot.iconIndex = ModLoader.addOverride("/gui/items.png", "/testiumingot.png");
ModLoader.addName(testingot, "Testium Ingot");
ModLoader.addSmelting(testiumore.blockID, new ItemStack(testingot, 1));
}
{
//Pickaxe
{
testiumpickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/testiumpickaxe.png");}
ModLoader.addName(testiumpickaxe, "Testium Pickaxe");
ModLoader.addRecipe(new ItemStack(testiumpickaxe, 1), new Object []
{"###", " X ", " X ", Character.valueOf('#'), testingot, Character.valueOf('X'), Item.stick});}
public void generateSurface(World world, Random random, int baseX, int baseZ)
{
for(int x = 0; x < 15; x++ )
{
int Xcoord = baseX + random.nextInt(5);
int Ycoord = random.nextInt(70);
int Zcoord = baseZ + random.nextInt(5);
(new WorldGenMinable(testiumore.blockID, 12)).generate(world, random, Xcoord, Ycoord, Zcoord);
}
}
public void load(){};
public String getVersion()
{
return "1.2.5";
}
}
and my error code
Mods loaded: 1
ModLoader 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 9f578458 --------
Generated 5/15/12 4:29 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.7.0_04, Oracle Corporation
VM: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: ATI Radeon HD 3450 version 2.1.8781, ATI Technologies Inc.
java.lang.NullPointerException
at net.minecraft.src.mod_Testium.<init>(mod_Testium.java:32)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:287)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1279)
at net.minecraft.src.ModLoader.init(ModLoader.java:849)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:157)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:424)
at net.minecraft.client.Minecraft.run(Minecraft.java:786)
at java.lang.Thread.run(Thread.java:722)
--- END ERROR REPORT 859adabd ----------
Help?
You aren't using my tutorials, so I'm not helping you here. Go and post in Mod Development.
I am tryong to make a new block and if i follow the tutorial(using eclipse) and then i look at another block they dont look the same. This is what i did when i changed a stone block. Thanks for the help and one more thing what do you do after you make a new java file in src?
Heres the code i chanded from the stone block.
package net.minecraft.src;
import java.util.Random;
public class BlockBunker extends Block
{
public BlockBunker(int par1, int par2)
{
super(par1, par2, Material.rock);
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return Block.cobblestone.blockID;
[indent=30px]I have tried to make a Bunker Block that is cheaper then Obsion but TNT proof and this is my code[/indent]
[indent=30px]
[/indent]
[indent=30px]
package net.minecraft.src;[/indent]
public class mod_Block extends BaseMod
{
public static final BlockBunker = new BlockBunker(160, 0).setBlockName
(BunkerBlock).setHardness(3F).setResistance(50F);
[indent=30px] public void load()
}
Modloader.registerBlock(Bunker);
Modloader.addName(Bunker, BunkerBlock);
Modloader.addRecipe(new ItemStack(Bunker, 1), new Bunker [1] {"###", "#%#", "###",
Character.valueOf('#'), Block.cobblestone, Character.valueOf('%'), Item.redstone})
}
public String getVersion()
{
return "1.2.5";
}
} [/indent]
BlockBunker
[indent=30px]
package net.minecraft.src;
import java.util.Random;[/indent]
public class BlockBunker extends Block
{
public BlockBunker(int par1, int par2)
{
super(par1, par2, Material.rock);
}
[indent=30px] /**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return Block.cobblestone.blockID;
}
}[/indent]
[indent=30px]
[/indent]
You need to make that in another class. You can't have the block code in the same file as the mod_ code.
Nobody responded to my last post. Anytime I add a new file to the project minecraft crashes.
Post your code and the crash report. If the game closes too quickly then the error will be in the ModLoader.txt in the jars folder.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
How do I make a container block? I made a crate and I want it to act like a large chest (without an opening lid).
Just have a look at how it currently does it. There are plenty of examples in the source code already.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
How do I make a container block? I made a crate and I want it to act like a large chest (without an opening lid).
Well, there are times that you should think about looking at minecraft's codes. Try looking at BlockChest. It says that it extends BlockContainer. Looking at existing codes really helps.
It still doesn't load my mod I'll post all my code:
mod_DarkMatter.java
package net.minecraft.src;
import java.util.Random;
public class mod_DarkMatter extends BaseMod
{
public static final Block darkmatterOre = new BlockDarkMatterOre(400, 0).setHardness(9.0F).setResistance(5.0F).setBlockName("darkmatterOre");
public static final Block darkmatterBlock = new BlockDarkMatter(401, 0).setHardness(1.5F).setResistance(5.0F).setBlockName("darkmatterBlock");
public static final Item darkmatterItem = new Item(402).setItemName("darkmatterItem");
public static final Item darkmatterPick = new ItemPickaxe(403, EnumToolMaterial.DM).setItemName("darkmatterPick");
public static final Item darkmatterShovel = new ItemSpade(404, EnumToolMaterial.DM).setItemName("darkmatterShovel");
public static final Item darkmatterAxe = new ItemAxe(405, EnumToolMaterial.DM).setItemName("darkmatterAxe");
public static final Item darkmatterHoe = new ItemHoe(406, EnumToolMaterial.DM).setItemName("darkmatterHoe");
public static final Item darkmatterSword = new ItemSword(407, EnumToolMaterial.DM).setItemName("darkmatterSword");
public void load(){
darkmatterOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mod_DarkMatter/darkmatterore.png");
darkmatterBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mod_DarkMatter/darkmatterblock.png");
darkmatterItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmatteritem.png");
darkmatterPick.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmatterpick.png");
darkmatterShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmattershovel.png");
darkmatterAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmatteraxe.png");
darkmatterHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmatterhoe.png");
darkmatterSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmattersword.png");
ModLoader.registerBlock(darkmatterOre);
ModLoader.registerBlock(darkmatterBlock);
ModLoader.addName(darkmatterOre, "Darkmatter Ore");
ModLoader.addName(darkmatterBlock, "Darkmatter Block");
ModLoader.addName(darkmatterItem, "Darkmatter");
ModLoader.addName(darkmatterPick, "Darkmatter Pickaxe");
ModLoader.addName(darkmatterShovel, "Darkmatter Shovel");
ModLoader.addName(darkmatterAxe, "Darkmatter Axe");
ModLoader.addName(darkmatterHoe, "Darkmatter Hoe");
ModLoader.addName(darkmatterSword, "Darkmatter Sword");
ModLoader.addRecipe(new ItemStack(darkmatterItem, 9), new Object[] {
"X", Character.valueOf('X'), darkmatterBlock });
ModLoader.addRecipe(new ItemStack(darkmatterBlock, 1), new Object[] {
"XXX", "XXX", "XXX", Character.valueOf('X'), darkmatterItem });
ModLoader.addRecipe(new ItemStack(darkmatterPick, 1), new Object[] {
"XXX", " | ", " | ", Character.valueOf('X'), darkmatterItem, Character.valueOf('|'), Item.stick });
ModLoader.addRecipe(new ItemStack(darkmatterShovel, 1), new Object[] {
" X ", " | ", " | ", Character.valueOf('X'), darkmatterItem, Character.valueOf('|'), Item.stick });
ModLoader.addRecipe(new ItemStack(darkmatterAxe, 1), new Object[] {
"XX ", "X| ", " | ", Character.valueOf('X'), darkmatterItem, Character.valueOf('|'), Item.stick });
ModLoader.addRecipe(new ItemStack(darkmatterHoe, 1), new Object[] {
"XX ", " | ", " | ", Character.valueOf('X'), darkmatterItem, Character.valueOf('|'), Item.stick });
ModLoader.addRecipe(new ItemStack(darkmatterSword, 1), new Object[] {
" X ", " X ", " | ", Character.valueOf('X'), darkmatterItem, Character.valueOf('|'), Item.stick });
ModLoader.addRecipe(new ItemStack(darkmatterBlock, 1), new Object[] {
"XX ", "XX ", " ", Character.valueOf('X'), Block.dirt });
}
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for (int i = 0; i < 6; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(128);
int randPosZ = chunkZ + rand.nextInt(16);
new WorldGenMinable(darkmatterOre.blockID, 400).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
public String Version()
{
return "1.2.5";
}
}
ItemDarkMatter.java
package net.minecraft.src;
public class ItemDarkMatter extends Item
{
public ItemDarkMatter(int i)
{
super(i);
this.maxStackSize = (64);
}
}
BlockDarkMatter.java
package net.minecraft.src;
import java.util.Random;
public class BlockDarkMatter extends Block
{
public BlockDarkMatter(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random)
{
return mod_DarkMatter.darkmatterItem.shiftedIndex;
}
public int quantityDropped(Random par1Random) {
return 9;
}
}
BlockDarkMatterOre.java
package net.minecraft.src;
import java.util.Random;
public class BlockDarkMatterOre extends Block
{
public BlockDarkMatterOre(int i, int j)
{
super(i, j, Material.iron);
}
public int idDropped(int i, Random random)
{
return mod_DarkMatter.darkmatterItem.shiftedIndex;
}
}
And I put this in EnumToolMaterial.java
DM(3, 1561, 8F, 3, 10);
Rollback Post to RevisionRollBack
Web Developer/Modder/Software Developer/App Developer PM if interested.
It still doesn't load my mod I'll post all my code:
mod_DarkMatter.java
package net.minecraft.src;
import java.util.Random;
public class mod_DarkMatter extends BaseMod
{
public static final Block darkmatterOre = new BlockDarkMatterOre(400, 0).setHardness(9.0F).setResistance(5.0F).setBlockName("darkmatterOre");
public static final Block darkmatterBlock = new BlockDarkMatter(401, 0).setHardness(1.5F).setResistance(5.0F).setBlockName("darkmatterBlock");
public static final Item darkmatterItem = new Item(402).setItemName("darkmatterItem");
public static final Item darkmatterPick = new ItemPickaxe(403, EnumToolMaterial.DM).setItemName("darkmatterPick");
public static final Item darkmatterShovel = new ItemSpade(404, EnumToolMaterial.DM).setItemName("darkmatterShovel");
public static final Item darkmatterAxe = new ItemAxe(405, EnumToolMaterial.DM).setItemName("darkmatterAxe");
public static final Item darkmatterHoe = new ItemHoe(406, EnumToolMaterial.DM).setItemName("darkmatterHoe");
public static final Item darkmatterSword = new ItemSword(407, EnumToolMaterial.DM).setItemName("darkmatterSword");
public void load(){
darkmatterOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mod_DarkMatter/darkmatterore.png");
darkmatterBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mod_DarkMatter/darkmatterblock.png");
darkmatterItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmatteritem.png");
darkmatterPick.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmatterpick.png");
darkmatterShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmattershovel.png");
darkmatterAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmatteraxe.png");
darkmatterHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmatterhoe.png");
darkmatterSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmattersword.png");
ModLoader.registerBlock(darkmatterOre);
ModLoader.registerBlock(darkmatterBlock);
ModLoader.addName(darkmatterOre, "Darkmatter Ore");
ModLoader.addName(darkmatterBlock, "Darkmatter Block");
ModLoader.addName(darkmatterItem, "Darkmatter");
ModLoader.addName(darkmatterPick, "Darkmatter Pickaxe");
ModLoader.addName(darkmatterShovel, "Darkmatter Shovel");
ModLoader.addName(darkmatterAxe, "Darkmatter Axe");
ModLoader.addName(darkmatterHoe, "Darkmatter Hoe");
ModLoader.addName(darkmatterSword, "Darkmatter Sword");
ModLoader.addRecipe(new ItemStack(darkmatterItem, 9), new Object[] {
"X", Character.valueOf('X'), darkmatterBlock });
ModLoader.addRecipe(new ItemStack(darkmatterBlock, 1), new Object[] {
"XXX", "XXX", "XXX", Character.valueOf('X'), darkmatterItem });
ModLoader.addRecipe(new ItemStack(darkmatterPick, 1), new Object[] {
"XXX", " | ", " | ", Character.valueOf('X'), darkmatterItem, Character.valueOf('|'), Item.stick });
ModLoader.addRecipe(new ItemStack(darkmatterShovel, 1), new Object[] {
" X ", " | ", " | ", Character.valueOf('X'), darkmatterItem, Character.valueOf('|'), Item.stick });
ModLoader.addRecipe(new ItemStack(darkmatterAxe, 1), new Object[] {
"XX ", "X| ", " | ", Character.valueOf('X'), darkmatterItem, Character.valueOf('|'), Item.stick });
ModLoader.addRecipe(new ItemStack(darkmatterHoe, 1), new Object[] {
"XX ", " | ", " | ", Character.valueOf('X'), darkmatterItem, Character.valueOf('|'), Item.stick });
ModLoader.addRecipe(new ItemStack(darkmatterSword, 1), new Object[] {
" X ", " X ", " | ", Character.valueOf('X'), darkmatterItem, Character.valueOf('|'), Item.stick });
ModLoader.addRecipe(new ItemStack(darkmatterBlock, 1), new Object[] {
"XX ", "XX ", " ", Character.valueOf('X'), Block.dirt });
}
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for (int i = 0; i < 6; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(128);
int randPosZ = chunkZ + rand.nextInt(16);
new WorldGenMinable(darkmatterOre.blockID, 400).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
public String Version()
{
return "1.2.5";
}
}
ItemDarkMatter.java
package net.minecraft.src;
public class ItemDarkMatter extends Item
{
public ItemDarkMatter(int i)
{
super(i);
this.maxStackSize = (64);
}
}
BlockDarkMatter.java
package net.minecraft.src;
import java.util.Random;
public class BlockDarkMatter extends Block
{
public BlockDarkMatter(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random)
{
return mod_DarkMatter.darkmatterItem.shiftedIndex;
}
public int quantityDropped(Random par1Random) {
return 9;
}
}
BlockDarkMatterOre.java
package net.minecraft.src;
import java.util.Random;
public class BlockDarkMatterOre extends Block
{
public BlockDarkMatterOre(int i, int j)
{
super(i, j, Material.iron);
}
public int idDropped(int i, Random random)
{
return mod_DarkMatter.darkmatterItem.shiftedIndex;
}
}
Ok, I have a new problem now, I've specified where the texture is, it loads one texture but the other is the purple square.
mod_Hay:
public int idDropped(int i, Random random)
{
return mod_Hay.Hay.blockID;
}
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)
{
int i = MathHelper.floor_double((double)((par5EntityLiving.rotationYaw * 4F) / 360F) + 0.5D) & 3;
if (i == 0)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 2);
}
if (i == 1)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 5);
}
if (i == 2)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3);
}
if (i == 3)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 4);
}
}
public int getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
if (par5 == 1)
{
return mod_Hay.HaySide;
}
if (par5 == 0)
{
return mod_Hay.HaySide;
}
int i = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
if (i == 2)
{
opdir = 3;
}
if (i == 3)
{
opdir = 2;
}
if (i == 4)
{
opdir = 5;
}
if (i == 5)
{
opdir = 4;
}
if (par5 != i && par5 != opdir)
{
return mod_Hay.HayFront;
}
else
{
return mod_Hay.HaySide;
}
}
public int opdir;
Hay:
package net.minecraft.src;
import java.util.Random;
public class Hay extends Block
{
public Hay(int i, int j)
{
super(i, j, Material.leaves);
}
public int idDropped(int i, Random random, int j)
{
return mod_Hay.Hay.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)
{
int i = MathHelper.floor_double((double)((par5EntityLiving.rotationYaw * 4F) / 360F) + 0.5D) & 3;
if (i == 0)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 2);
}
if (i == 1)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 5);
}
if (i == 2)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3);
}
if (i == 3)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 4);
}
}
public int getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
if (par5 == 1)
{
return mod_Hay.HaySide;
}
if (par5 == 0)
{
return mod_Hay.HaySide;
}
int i = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
if (i == 2)
{
opdir = 3;
}
if (i == 3)
{
opdir = 2;
}
if (i == 4)
{
opdir = 5;
}
if (i == 5)
{
opdir = 4;
}
if (par5 != i && par5 != opdir)
{
return mod_Hay.HayEnd;
}
else
{
return mod_Hay.HaySide;
}
}
public int opdir;
}
It also acts as a stone block, making the same noises etc.
You can't use the same texture twice. Just the way ModLoader overrides it I believe.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
i copyed all the instructions on custom ncp and i cant find my mob anywhere
Post your code. I can't help you without it.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Hey TechGuy, do you know how can I make a throwable entity to drop the thrower item when it hits a non-living block? I'm trying to make my EntityItemName to drop his ItemItemName (like a snowball) when it doesn't collides against a mob :\ Basically, I'm having troubles to apply the superclasses methods (Entity and EntityThrowable) in the EntityItemName subclass.
Hey TechGuy, do you know how can I make a throwable entity to drop the thrower item when it hits a non-living block? I'm trying to make my EntityItemName to drop his ItemItemName (like a snowball) when it doesn't collides against a mob :\ Basically, I'm having troubles to apply the superclasses methods (Entity and EntityThrowable) in the EntityItemName subclass.
No. I was trying to do this once but never figured it out.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
it worked i got no error code however i cant find my block in creative mode any idea heres my code again just incase you need it
BlockDwarfStone.java
package net.minecraft.src;
import java.util.Random;
public class BlockDwarfStone extends Block
{
public BlockDwarfStone(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_Block.DwarfStone.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
mod_DwarfStone
package net.minecraft.src;
public class mod_DwarfStone extends BaseMod
{
public static final Block DwarfStone = new BlockDwarfStone(160, 0).setBlockName("Dwarf Stone").setHardness(3F).setResistance(4F).setLightValue(1F);
Ok my last problem is solved but I nave a new one:
The error report is saying it can't find the image i'm specifying. I've tried everything to get the image to work. And the image is there!
mod_CoacoaBeansMod.java
package net.minecraft.src;
public class mod_CoacoaBeansMod extends BaseMod
{
public static final Item warmMilk = new ItemWarmMilk(5000).setItemName("warmMilk");
public void load()
{
warmMilk.iconIndex = ModLoader.addOverride("C:/Users/Trenton/Desktop/Mods/Minecraft/Cocoa Beans Mod/temp/bin/minecraft/gui/items.png", "C:/Users/Trenton/Desktop/Mods/Minecraft/Cocoa Beans Mod/temp/bin/minecraft/jayitinc/warmMilk.png");
ModLoader.addName(warmMilk, "Warm Milk");
ModLoader.addSmelting(Item.bucketMilk.shiftedIndex, new ItemStack(warmMilk, 1));
}
public String getVersion()
{
return "1.2.5";
}
}
ItemWarmMilk.java
package net.minecraft.src;
public class ItemWarmMilk extends Item
{
public ItemWarmMilk(int i)
{
super(1);
maxStackSize = 1;
}
}
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 75fe87b3 --------
Generated 16/05/12 4:41 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.7.0_02, Oracle Corporation
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: Intel(R) HD Graphics Family version 3.0.0 - Build 8.15.10.2291, Intel
java.lang.Exception: No registry for this texture: C:/Users/Trenton/Desktop/Mods/Minecraft/Cocoa Beans Mod/temp/bin/minecraft/gui/items.png
at net.minecraft.src.ModLoader.getUniqueSpriteIndex(ModLoader.java:675)
at net.minecraft.src.ModLoader.addOverride(ModLoader.java:365)
at net.minecraft.src.mod_CoacoaBeansMod.load(mod_CoacoaBeansMod.java:9)
at net.minecraft.src.ModLoader.init(ModLoader.java:856)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:157)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:424)
at net.minecraft.client.Minecraft.run(Minecraft.java:786)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 7ff9a803 ----------
[indent=30px]
[indent=30px]
package net.minecraft.src;[/indent] public class mod_Block extends BaseMod { public static final BlockBunker = new BlockBunker(160, 0).setBlockName (BunkerBlock).setHardness(3F).setResistance(50F); [indent=30px] public void load() } Modloader.registerBlock(Bunker); Modloader.addName(Bunker, BunkerBlock); Modloader.addRecipe(new ItemStack(Bunker, 1), new Bunker [1] {"###", "#%#", "###", Character.valueOf('#'), Block.cobblestone, Character.valueOf('%'), Item.redstone}) } public String getVersion() { return "1.2.5"; } } [/indent] BlockBunker [indent=30px] package net.minecraft.src; import java.util.Random;[/indent] public class BlockBunker extends Block { public BlockBunker(int par1, int par2) { super(par1, par2, Material.rock); } [indent=30px] /** * Returns the ID of the items to drop on destruction. */ public int idDropped(int par1, Random par2Random, int par3) { return Block.cobblestone.blockID; } }[/indent][indent=30px]
Thanks
not usually. Quotation marks are usually to represent strings. Strings being, actual words within the game...
At least read the first post before asking your questions... There is a section specifically for this.
You aren't using my tutorials, so I'm not helping you here. Go and post in Mod Development.
You need to make that in another class. You can't have the block code in the same file as the mod_ code.
Post your code and the crash report. If the game closes too quickly then the error will be in the ModLoader.txt in the jars folder.
together they are powerful beyond imagination."
Just have a look at how it currently does it. There are plenty of examples in the source code already.
together they are powerful beyond imagination."
Well, there are times that you should think about looking at minecraft's codes. Try looking at BlockChest. It says that it extends BlockContainer. Looking at existing codes really helps.
mod_DarkMatter.java
package net.minecraft.src; import java.util.Random; public class mod_DarkMatter extends BaseMod { public static final Block darkmatterOre = new BlockDarkMatterOre(400, 0).setHardness(9.0F).setResistance(5.0F).setBlockName("darkmatterOre"); public static final Block darkmatterBlock = new BlockDarkMatter(401, 0).setHardness(1.5F).setResistance(5.0F).setBlockName("darkmatterBlock"); public static final Item darkmatterItem = new Item(402).setItemName("darkmatterItem"); public static final Item darkmatterPick = new ItemPickaxe(403, EnumToolMaterial.DM).setItemName("darkmatterPick"); public static final Item darkmatterShovel = new ItemSpade(404, EnumToolMaterial.DM).setItemName("darkmatterShovel"); public static final Item darkmatterAxe = new ItemAxe(405, EnumToolMaterial.DM).setItemName("darkmatterAxe"); public static final Item darkmatterHoe = new ItemHoe(406, EnumToolMaterial.DM).setItemName("darkmatterHoe"); public static final Item darkmatterSword = new ItemSword(407, EnumToolMaterial.DM).setItemName("darkmatterSword"); public void load(){ darkmatterOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mod_DarkMatter/darkmatterore.png"); darkmatterBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mod_DarkMatter/darkmatterblock.png"); darkmatterItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmatteritem.png"); darkmatterPick.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmatterpick.png"); darkmatterShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmattershovel.png"); darkmatterAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmatteraxe.png"); darkmatterHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmatterhoe.png"); darkmatterSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod_DarkMatter/darkmattersword.png"); ModLoader.registerBlock(darkmatterOre); ModLoader.registerBlock(darkmatterBlock); ModLoader.addName(darkmatterOre, "Darkmatter Ore"); ModLoader.addName(darkmatterBlock, "Darkmatter Block"); ModLoader.addName(darkmatterItem, "Darkmatter"); ModLoader.addName(darkmatterPick, "Darkmatter Pickaxe"); ModLoader.addName(darkmatterShovel, "Darkmatter Shovel"); ModLoader.addName(darkmatterAxe, "Darkmatter Axe"); ModLoader.addName(darkmatterHoe, "Darkmatter Hoe"); ModLoader.addName(darkmatterSword, "Darkmatter Sword"); ModLoader.addRecipe(new ItemStack(darkmatterItem, 9), new Object[] { "X", Character.valueOf('X'), darkmatterBlock }); ModLoader.addRecipe(new ItemStack(darkmatterBlock, 1), new Object[] { "XXX", "XXX", "XXX", Character.valueOf('X'), darkmatterItem }); ModLoader.addRecipe(new ItemStack(darkmatterPick, 1), new Object[] { "XXX", " | ", " | ", Character.valueOf('X'), darkmatterItem, Character.valueOf('|'), Item.stick }); ModLoader.addRecipe(new ItemStack(darkmatterShovel, 1), new Object[] { " X ", " | ", " | ", Character.valueOf('X'), darkmatterItem, Character.valueOf('|'), Item.stick }); ModLoader.addRecipe(new ItemStack(darkmatterAxe, 1), new Object[] { "XX ", "X| ", " | ", Character.valueOf('X'), darkmatterItem, Character.valueOf('|'), Item.stick }); ModLoader.addRecipe(new ItemStack(darkmatterHoe, 1), new Object[] { "XX ", " | ", " | ", Character.valueOf('X'), darkmatterItem, Character.valueOf('|'), Item.stick }); ModLoader.addRecipe(new ItemStack(darkmatterSword, 1), new Object[] { " X ", " X ", " | ", Character.valueOf('X'), darkmatterItem, Character.valueOf('|'), Item.stick }); ModLoader.addRecipe(new ItemStack(darkmatterBlock, 1), new Object[] { "XX ", "XX ", " ", Character.valueOf('X'), Block.dirt }); } public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ) { for (int i = 0; i < 6; i++) { int randPosX = chunkX + rand.nextInt(16); int randPosY = rand.nextInt(128); int randPosZ = chunkZ + rand.nextInt(16); new WorldGenMinable(darkmatterOre.blockID, 400).generate(world, rand, randPosX, randPosY, randPosZ); } } public String Version() { return "1.2.5"; } }ItemDarkMatter.java
package net.minecraft.src; public class ItemDarkMatter extends Item { public ItemDarkMatter(int i) { super(i); this.maxStackSize = (64); } }BlockDarkMatter.java
package net.minecraft.src; import java.util.Random; public class BlockDarkMatter extends Block { public BlockDarkMatter(int i, int j) { super(i, j, Material.wood); } public int idDropped(int i, Random random) { return mod_DarkMatter.darkmatterItem.shiftedIndex; } public int quantityDropped(Random par1Random) { return 9; } }BlockDarkMatterOre.java
package net.minecraft.src; import java.util.Random; public class BlockDarkMatterOre extends Block { public BlockDarkMatterOre(int i, int j) { super(i, j, Material.iron); } public int idDropped(int i, Random random) { return mod_DarkMatter.darkmatterItem.shiftedIndex; } }And I put this in EnumToolMaterial.java
Mod Development!
You can't use the same texture twice. Just the way ModLoader overrides it I believe.
together they are powerful beyond imagination."
i copyed all the instructions on custom ncp and i cant find my mob anywhere
Post your code. I can't help you without it.
together they are powerful beyond imagination."
If you call the int that it is attached to multiple times then you will need to, but if you do it like this, it should work better:
Change
if (par5 == 1) { return mod_Hay.HaySide; } if (par5 == 0) { return mod_Hay.HaySide; }to
if (par5 == 1 || par5 == 0) { return mod_Hay.HaySide; }together they are powerful beyond imagination."
if that doesn't work, try:
together they are powerful beyond imagination."
I'm trying to make my EntityItemName to drop his ItemItemName (like a snowball) when it doesn't collides against a mob :\
Basically, I'm having troubles to apply the superclasses methods (Entity and EntityThrowable) in the EntityItemName subclass.
It should be automatic, so I'm not sure.
No. I was trying to do this once but never figured it out.
together they are powerful beyond imagination."
Make your crafting recipe for your block or item as 1 dirt then try it. If it works, then make a real crafting recipe.
The error report is saying it can't find the image i'm specifying. I've tried everything to get the image to work. And the image is there!
mod_CoacoaBeansMod.java
public class mod_CoacoaBeansMod extends BaseMod
{
public static final Item warmMilk = new ItemWarmMilk(5000).setItemName("warmMilk");
public void load()
{
warmMilk.iconIndex = ModLoader.addOverride("C:/Users/Trenton/Desktop/Mods/Minecraft/Cocoa Beans Mod/temp/bin/minecraft/gui/items.png", "C:/Users/Trenton/Desktop/Mods/Minecraft/Cocoa Beans Mod/temp/bin/minecraft/jayitinc/warmMilk.png");
ModLoader.addName(warmMilk, "Warm Milk");
ModLoader.addSmelting(Item.bucketMilk.shiftedIndex, new ItemStack(warmMilk, 1));
}
public String getVersion()
{
return "1.2.5";
}
}
package net.minecraft.src;
public class ItemWarmMilk extends Item
{
public ItemWarmMilk(int i)
{
super(1);
maxStackSize = 1;
}
}
Mods loaded: 2
ModLoader 1.2.5
mod_CoacoaBeansMod 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 75fe87b3 --------
Generated 16/05/12 4:41 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.7.0_02, Oracle Corporation
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: Intel(R) HD Graphics Family version 3.0.0 - Build 8.15.10.2291, Intel
java.lang.Exception: No registry for this texture: C:/Users/Trenton/Desktop/Mods/Minecraft/Cocoa Beans Mod/temp/bin/minecraft/gui/items.png
at net.minecraft.src.ModLoader.getUniqueSpriteIndex(ModLoader.java:675)
at net.minecraft.src.ModLoader.addOverride(ModLoader.java:365)
at net.minecraft.src.mod_CoacoaBeansMod.load(mod_CoacoaBeansMod.java:9)
at net.minecraft.src.ModLoader.init(ModLoader.java:856)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:157)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:424)
at net.minecraft.client.Minecraft.run(Minecraft.java:786)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 7ff9a803 ----------
Please help!