I believe that on your first tutorial you are missing an end brace on one of the classes. Adding it made it compile without errors for me.
Rollback Post to RevisionRollBack
GENERATION 26: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment. Quote me if you are expecting a reply so I get notified
Thank you very much for the tutorials!! I finally made my first mod! (Dragon ore, Dragon block, Dragon ingot, Dragon tools and Dragon armor) =D, but...how can I make it so it works for SMP? =/
Thank you very much for the tutorials!! I finally made my first mod! (Dragon ore, Dragon block, Dragon ingot, Dragon tools and Dragon armor) =D, but...how can I make it so it works for SMP? =/
smp is harder to make
if you want to mod smp there is little tutorials/help around though you can try it and ill try to answer questions
Quote from King_Nick »
I get this error
*** Minecraft Coder Pack Version 2.12 ***
MCP 2.12 running in C:\MCP
Compiling Minecraft
sources\minecraft\net\minecraft\src\mod_Emerald.java:13: illegal start of expres
sion
public String Version();
^
sources\minecraft\net\minecraft\src\mod_Emerald.java:13: ';' expected
public String Version();
^
sources\minecraft\net\minecraft\src\mod_Emerald.java:18: reached end of file whi
le parsing
}
*** minecraft_server.jar was not found, skipping
=== MCP 2.12 recompile script finished ===
Press any key to continue . . .
can you please show me your mod_Emerald?
you're most likely missing a ; or a }
How can i get a tool to on right clicked on grass / dirt set the block to "inset block name here". Iv tried riping apart the Hoe but it failed.
Let's break down this block of code from ItemHoe.java:
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
{
int i1 = world.getBlockId(i, j, k); // gets the block id of the block the item is used on
Material material = world.getBlockMaterial(i, j + 1, k); //gets the material of the block above
if(!material.isSolid() && i1 == Block.grass.blockID || i1 == Block.dirt.blockID) //if the block it is used on is grass or dirt & the material above the block is not solid
{
Block block = Block.tilledField; //block that is placed by item
world.playSoundEffect((float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, block.stepSound.func_1145_d(), (block.stepSound.func_1147_b() + 1.0F) / 2.0F, block.stepSound.func_1144_c() * 0.8F); //plays sound effect
if(world.multiplayerWorld)
{
return true;
}
world.setBlockWithNotify(i, j, k, block.blockID); //places block at use location, the line of code above,(Block block =)
itemstack.func_25190_a(1, entityplayer);
if(world.rand.nextInt(8) == 0 && i1 == Block.grass.blockID) //code for spawning seeds
{
int j1 = 1;
for(int k1 = 0; k1 < j1; k1++)
{
float f = 0.7F;
float f1 = world.rand.nextFloat() * f + (1.0F - f) * 0.5F;
float f2 = 1.2F;
float f3 = world.rand.nextFloat() * f + (1.0F - f) * 0.5F;
EntityItem entityitem = new EntityItem(world, (float)i + f1, (float)j + f2, (float)k + f3, new ItemStack(Item.seeds));
entityitem.delayBeforeCanPickup = 10;
world.entityJoinedWorld(entityitem);
}
}
return true;
} else
{
return false;
}
}
If that doesn't help I can explain in more detail.
Iv already figured that much out but i cant figure how to set Block block = Block.tilledField; to get the block from mod loader
How can i get a tool to on right clicked on grass / dirt set the block to "inset block name here". Iv tried riping apart the Hoe but it failed.
Let's break down this block of code from ItemHoe.java:
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
{
int i1 = world.getBlockId(i, j, k); // gets the block id of the block the item is used on
Material material = world.getBlockMaterial(i, j + 1, k); //gets the material of the block above
if(!material.isSolid() && i1 == Block.grass.blockID || i1 == Block.dirt.blockID) //if the block it is used on is grass or dirt & the material above the block is not solid
{
Block block = Block.tilledField; //block that is placed by item
world.playSoundEffect((float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, block.stepSound.func_1145_d(), (block.stepSound.func_1147_b() + 1.0F) / 2.0F, block.stepSound.func_1144_c() * 0.8F); //plays sound effect
if(world.multiplayerWorld)
{
return true;
}
world.setBlockWithNotify(i, j, k, block.blockID); //places block at use location, the line of code above,(Block block =)
itemstack.func_25190_a(1, entityplayer);
if(world.rand.nextInt(8) == 0 && i1 == Block.grass.blockID) //code for spawning seeds
{
int j1 = 1;
for(int k1 = 0; k1 < j1; k1++)
{
float f = 0.7F;
float f1 = world.rand.nextFloat() * f + (1.0F - f) * 0.5F;
float f2 = 1.2F;
float f3 = world.rand.nextFloat() * f + (1.0F - f) * 0.5F;
EntityItem entityitem = new EntityItem(world, (float)i + f1, (float)j + f2, (float)k + f3, new ItemStack(Item.seeds));
entityitem.delayBeforeCanPickup = 10;
world.entityJoinedWorld(entityitem);
}
}
return true;
} else
{
return false;
}
}
If that doesn't help I can explain in more detail.
Iv already figured that much out but i cant figure how to set Block block = Block.tilledField; to get the block from mod loader
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\ItemRake.java:3: cannot find symbol
symbol : constructor ItemTool()
location: class net.minecraft.src.ItemTool
public class ItemRake extends ItemTool
^
src\minecraft\net\minecraft\src\mod_sttool.java:6: cannot find symbol
symbol : constructor ItemRake(int,net.minecraft.src.EnumToolMaterial)
location: class net.minecraft.src.ItemRake
public static final Item WoodRake = new ItemRake(370, EnumToolMaterial.WOOD).set
ItemName("WoodRake");
^
2 errors
==================
ItemRake
package net.minecraft.src;
public class ItemRake extends ItemTool
{
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
{
int i1 = world.getBlockId(i, j, k);
Material material = world.getBlockMaterial(i, j + 1, k);
if(!material.isSolid() && i1 == Block.grass.blockID || i1 == Block.dirt.blockID)
{
Block block = mod_stpath.DirtPath;
world.setBlockWithNotify(i, j, k, block.blockID);
return true;
}
else
{
return false;
}
}
}
mod_sttool
package net.minecraft.src;
public class mod_sttool extends BaseMod
{
public static final Item WoodRake = new ItemRake(370, EnumToolMaterial.WOOD).setItemName("WoodRake");
public String Version()
{
return "1.5_01";
}
public mod_sttool()
{
WoodRake.iconIndex = ModLoader.addOverride("/gui/items.png", "/st/tools/WoodRake.png");
ModLoader.AddName(WoodRake, "Wood Rake");
ModLoader.AddRecipe(new ItemStack(WoodRake, 1), new Object[] {" X ", " X ", "XXX", Character.valueOf('X'), Block.planks});
}
}
Are you taking requests? If so could you make a tutorial on how to make a new furnace with modloader? I've been trying for a while and have failed numerous times!
Rollback Post to RevisionRollBack
"Sometimes it's necessary to go a long distance out of the way in order to come back a short distance correctly."
hey i cant seem to get this right
i am trying to make a recipe from 2 differint ores i added to the game i get this error
heres my recipe in mod_power.java
package net.minecraft.src;
import java.util.Random;
public class mod_Power extends BaseMod
{
public static final Block Power = new BlockPower(120, 0).setHardness(2.0F).setResistance(2.0F).setBlockName("PowerOre");
public static final Item PowerItem = new Item(802).setItemName("Poweringot");
public static final Item NPItem = new Item(806).setItemName("super Power ingot");
public static final Item PowerPick = new ItemPickaxe(801, EnumToolMaterial.GOLD).setItemName("PowerPick");
public static final Item PowerShovel = new ItemSpade(800, EnumToolMaterial.GOLD).setItemName("PowerShovel");
public static final Item PowerAxe = new ItemAxe(803, EnumToolMaterial.GOLD).setItemName("PowerAxe");
public static final Item PowerHoe = new ItemHoe(804, EnumToolMaterial.GOLD).setItemName("PowerHoe");
public static final Item PowerSword = new ItemSword(805, EnumToolMaterial.GOLD).setItemName("PowerSword");
public String Version()
{
return "1.5_01";
}
public void GenerateSurface(World worldObj, Random rand, int k, int l)
{
for(int i3 = 0; i3 < 15; i3++)
{
int j6 = k + rand.nextInt(16);
int k9 = rand.nextInt(128);
int i14 = l + rand.nextInt(16);
(new WorldGenMinable(Power.blockID, 16)).generate(worldObj, rand, j6, k9, i14);
}
}
public mod_Power()
{
ModLoader.AddSmelting(Power.blockID, new ItemStack(PowerItem, 1));
ModLoader.RegisterBlock(Power);
PowerItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Poweringot.png");
Power.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/PKD/Power.png");
PowerPick.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Powerpick.png");
PowerShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Powershovel.png");
PowerAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Poweraxe.png");
PowerHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Powerhoe.png");
PowerSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Powersword.png");
NPItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/NPingot.png");
ModLoader.AddName(Power, "Power ore");
ModLoader.AddName(PowerItem, "Power Sphere");
ModLoader.AddName(PowerPick, "Power Pickaxe");
ModLoader.AddName(PowerShovel, "Power Shovel");
ModLoader.AddName(PowerAxe, "Power Axe");
ModLoader.AddName(PowerHoe, "Power Hoe");
ModLoader.AddName(PowerSword, "Power Sword");
ModLoader.AddName(NPItem, "SP Sphere");
ModLoader.AddRecipe(new ItemStack(PowerPick, 1), new Object[] {
"XXX", " | ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(PowerShovel, 1), new Object[] {
" X ", " | ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(PowerHoe, 1), new Object[] {
" XX", " | ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(PowerAxe, 1), new Object[] {
" XX", "X| ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(PowerSword, 1), new Object[] {
" X ", " X ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(NPItem, 1), new Object[] {
" X ", " X ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.bone
});
ModLoader.AddRecipe(new ItemStack(LeulentiunCore, 1), new Object[] {
"X ", " P ", " X ", Character.valueOf('X'), ItemLeulentiun, Character.valueOf('P'), ItemPower
});
}
}
and in my mod_Leulentiun.java
package net.minecraft.src;
import java.util.Random;
public class mod_Leulentiun extends BaseMod
{
public static final Block Leulentiun = new BlockLeulentiun(122, 0).setHardness(6.0F).setResistance(8.0F).setBlockName("Leulentiun");
public static final Item LeulentiunItem = new Item(2667).setItemName("LeulentiunItem");
public static final Item LeulentiunCore = new Item(2677).setItemName("LeulentiunCore");
public String Version()
{
return "1.5_01";
}
public void GenerateSurface(World worldObj, Random rand, int k, int l)
{
for(int i3 = 0; i3 < 7; i3++)
{
int j6 = k + rand.nextInt(16);
int k9 = rand.nextInt(16);
int i14 = l + rand.nextInt(16);
(new WorldGenMinable(Leulentiun.blockID, 5)).generate(worldObj, rand, j6, k9, i14);
}
}
public mod_Leulentiun()
{
ModLoader.AddSmelting(Leulentiun.blockID, new ItemStack(LeulentiunItem, 1));
ModLoader.RegisterBlock(Leulentiun);
LeulentiunCore.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/core.png");
Leulentiun.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/PKD/Leulentiun.png");
LeulentiunItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Leulentiunitem.png");
ModLoader.AddName(Leulentiun, "Leulentiun ore");
ModLoader.AddName(LeulentiunItem, "Leulentiun crystal");
ModLoader.AddName(LeulentiunCore, "Leulentiun Power Core");
ModLoader.AddRecipe(new ItemStack(LeulentiunCore, 1), new Object[] {
"X ", " P ", " X ", Character.valueOf('X'), ItemLeulentiun, Character.valueOf('P'), ItemPower
});
}
}
Hmm, trying to make a new glass block.
I copied the glass code completetly and changed the names, that's all I did.
then I just copied the normal block code, the error only referred to this line:
public static final Block PlexiGlass = (new BlockPlexiGlass(149, 0)).setHardness(5F).setResistance(5F).setBlockName("PlexiGlass");
the error says:
src\minecraft\net\minecraft\src\mod_Moreblocks.java:91: cannot find symbol
symbol : constructor BlockPlexiGlass(int, int)
location: classnet.minecraft.src.BlockPlexiGlass
public static final Block PlexiGlass = (new BlockPlexiGlass(149, 0)).setHardness(5F).setResistance(5F).setBlockName("PlexiGlass");
1 error
============
Hmm, trying to make a new glass block.
I copied the glass code completetly and changed the names, that's all I did.
then I just copied the normal block code, the error only referred to this line:
public static final Block PlexiGlass = (new BlockPlexiGlass(149, 0)).setHardness(5F).setResistance(5F).setBlockName("PlexiGlass");
the error says:
src\minecraft\net\minecraft\src\mod_Moreblocks.java:91: cannot find symbol
symbol : constructor BlockPlexiGlass(int, int)
location: classnet.minecraft.src.BlockPlexiGlass
public static final Block PlexiGlass = (new BlockPlexiGlass(149, 0)).setHardness(5F).setResistance(5F).setBlockName("PlexiGlass");
1 error
============
You need a .java file called BlockPlexiGlass.java. Or you could just change "new BlockPlexiGlass" to "new BlockGlass", which is what you want unless you want your plexiglass to have some special ability.
Thank you very much for the tutorials!! I finally made my first mod! (Dragon ore, Dragon block, Dragon ingot, Dragon tools and Dragon armor) =D, but...how can I make it so it works for SMP? =/
smp is harder to make
if you want to mod smp there is little tutorials/help around though you can try it and ill try to answer questions
Quote from King_Nick »
I get this error
*** Minecraft Coder Pack Version 2.12 ***
MCP 2.12 running in C:\MCP
Compiling Minecraft
sources\minecraft\net\minecraft\src\mod_Emerald.java:13: illegal start of expres
sion
public String Version();
^
sources\minecraft\net\minecraft\src\mod_Emerald.java:13: ';' expected
public String Version();
^
sources\minecraft\net\minecraft\src\mod_Emerald.java:18: reached end of file whi
le parsing
}
*** minecraft_server.jar was not found, skipping
=== MCP 2.12 recompile script finished ===
Press any key to continue . . .
can you please show me your mod_Emerald?
you're most likely missing a ; or a }
package net.minecraft.src;
import java.util.Random;
public class mod_Leulentiun extends BaseMod
{
public static final Block Leulentiun = new BlockLeulentiun(122, 0).setHardness(6.0F).setResistance(8.0F).setBlockName("Leulentiun");
public static final Item LeulentiunItem = new Item(2667).setItemName("LeulentiunItem");
public static final Item LeulentiunCore = new Item(2677).setItemName("LeulentiunCore");
public String Version()
{
return "1.5_01";
}
public void GenerateSurface(World worldObj, Random rand, int k, int l)
{
for(int i3 = 0; i3 < 7; i3++)
{
int j6 = k + rand.nextInt(16);
int k9 = rand.nextInt(16);
int i14 = l + rand.nextInt(16);
(new WorldGenMinable(Leulentiun.blockID, 5)).generate(worldObj, rand, j6, k9, i14);
}
}
public mod_Leulentiun()
{
ModLoader.AddSmelting(Leulentiun.blockID, new ItemStack(LeulentiunItem, 1));
ModLoader.RegisterBlock(Leulentiun);
LeulentiunCore.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/core.png");
Leulentiun.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/PKD/Leulentiun.png");
LeulentiunItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Leulentiunitem.png");
ModLoader.AddName(Leulentiun, "Leulentiun ore");
ModLoader.AddName(LeulentiunItem, "Leulentiun crystal");
ModLoader.AddName(LeulentiunCore, "Leulentiun Power Core");
ModLoader.AddRecipe(new ItemStack(LeulentiunCore, 1), new Object[] {
"X ", " P ", " X ", Character.valueOf('X'), ItemLeulentiun, Character.valueOf('P'), ItemPower
});
}
}
Well, first off, if you're making these as one mod, you don't need two mod_whatever codes. One mod_whatever code can be a collection of every bit of code.
Another thing I noticed is that you've been calling your LeulentiunItem ItemLeulentiun, when in fact, earlier in the code you declared the item as LeulentiunItem.
When using an item or block that you declared in a different collection of code, for instance, ItemPower, you have to put whichever collection of code it's in, a period, and then the item/block. In your code, it would look something like this.
mod_Power.PowerItem, 1
So that's two major errors which seem to be messing up your code. I'll just go ahead and fix those for you.
package net.minecraft.src;
import java.util.Random;
public class mod_Power extends BaseMod
{
public static final Block Power = new BlockPower(120, 0).setHardness(2.0F).setResistance(2.0F).setBlockName("PowerOre");
public static final Item PowerItem = new Item(802).setItemName("Poweringot");
public static final Item NPItem = new Item(806).setItemName("super Power ingot");
public static final Item PowerPick = new ItemPickaxe(801, EnumToolMaterial.GOLD).setItemName("PowerPick");
public static final Item PowerShovel = new ItemSpade(800, EnumToolMaterial.GOLD).setItemName("PowerShovel");
public static final Item PowerAxe = new ItemAxe(803, EnumToolMaterial.GOLD).setItemName("PowerAxe");
public static final Item PowerHoe = new ItemHoe(804, EnumToolMaterial.GOLD).setItemName("PowerHoe");
public static final Item PowerSword = new ItemSword(805, EnumToolMaterial.GOLD).setItemName("PowerSword");
public String Version()
{
return "1.5_01";
}
public void GenerateSurface(World worldObj, Random rand, int k, int l)
{
for(int i3 = 0; i3 < 15; i3++)
{
int j6 = k + rand.nextInt(16);
int k9 = rand.nextInt(128);
int i14 = l + rand.nextInt(16);
(new WorldGenMinable(Power.blockID, 16)).generate(worldObj, rand, j6, k9, i14);
}
}
public mod_Power()
{
ModLoader.AddSmelting(Power.blockID, new ItemStack(PowerItem, 1));
ModLoader.RegisterBlock(Power);
PowerItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Poweringot.png");
Power.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/PKD/Power.png");
PowerPick.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Powerpick.png");
PowerShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Powershovel.png");
PowerAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Poweraxe.png");
PowerHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Powerhoe.png");
PowerSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Powersword.png");
NPItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/NPingot.png");
ModLoader.AddName(Power, "Power ore");
ModLoader.AddName(PowerItem, "Power Sphere");
ModLoader.AddName(PowerPick, "Power Pickaxe");
ModLoader.AddName(PowerShovel, "Power Shovel");
ModLoader.AddName(PowerAxe, "Power Axe");
ModLoader.AddName(PowerHoe, "Power Hoe");
ModLoader.AddName(PowerSword, "Power Sword");
ModLoader.AddName(NPItem, "SP Sphere");
ModLoader.AddRecipe(new ItemStack(PowerPick, 1), new Object[] {
"XXX", " | ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(PowerShovel, 1), new Object[] {
" X ", " | ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(PowerHoe, 1), new Object[] {
" XX", " | ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(PowerAxe, 1), new Object[] {
" XX", "X| ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(PowerSword, 1), new Object[] {
" X ", " X ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(NPItem, 1), new Object[] {
" X ", " X ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.bone
});
ModLoader.AddRecipe(new ItemStack(mod_Leulentiun.LeulentiunCore, 1), new Object[] {
"X ", " P ", " X ", Character.valueOf('X'), mod_Leulentiun.LeulentiunItem, Character.valueOf('P'), PowerItem
});
}
}
package net.minecraft.src;
import java.util.Random;
public class mod_Leulentiun extends BaseMod
{
public static final Block Leulentiun = new BlockLeulentiun(122, 0).setHardness(6.0F).setResistance(8.0F).setBlockName("Leulentiun");
public static final Item LeulentiunItem = new Item(2667).setItemName("LeulentiunItem");
public static final Item LeulentiunCore = new Item(2677).setItemName("LeulentiunCore");
public String Version()
{
return "1.5_01";
}
public void GenerateSurface(World worldObj, Random rand, int k, int l)
{
for(int i3 = 0; i3 < 7; i3++)
{
int j6 = k + rand.nextInt(16);
int k9 = rand.nextInt(16);
int i14 = l + rand.nextInt(16);
(new WorldGenMinable(Leulentiun.blockID, 5)).generate(worldObj, rand, j6, k9, i14);
}
}
public mod_Leulentiun()
{
ModLoader.AddSmelting(Leulentiun.blockID, new ItemStack(LeulentiunItem, 1));
ModLoader.RegisterBlock(Leulentiun);
LeulentiunCore.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/core.png");
Leulentiun.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/PKD/Leulentiun.png");
LeulentiunItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Leulentiunitem.png");
ModLoader.AddName(Leulentiun, "Leulentiun ore");
ModLoader.AddName(LeulentiunItem, "Leulentiun crystal");
ModLoader.AddName(LeulentiunCore, "Leulentiun Power Core");
ModLoader.AddRecipe(new ItemStack(LeulentiunCore, 1), new Object[] {
"X ", " P ", " X ", Character.valueOf('X'), LeulentiunItem, Character.valueOf('P'), mod_Power.PowerItem
});
}
}
That should work, just post any other errors you get if it doesn't.
package net.minecraft.src;
import java.util.Random;
public class mod_Leulentiun extends BaseMod
{
public static final Block Leulentiun = new BlockLeulentiun(122, 0).setHardness(6.0F).setResistance(8.0F).setBlockName("Leulentiun");
public static final Item LeulentiunItem = new Item(2667).setItemName("LeulentiunItem");
public static final Item LeulentiunCore = new Item(2677).setItemName("LeulentiunCore");
public String Version()
{
return "1.5_01";
}
public void GenerateSurface(World worldObj, Random rand, int k, int l)
{
for(int i3 = 0; i3 < 7; i3++)
{
int j6 = k + rand.nextInt(16);
int k9 = rand.nextInt(16);
int i14 = l + rand.nextInt(16);
(new WorldGenMinable(Leulentiun.blockID, 5)).generate(worldObj, rand, j6, k9, i14);
}
}
public mod_Leulentiun()
{
ModLoader.AddSmelting(Leulentiun.blockID, new ItemStack(LeulentiunItem, 1));
ModLoader.RegisterBlock(Leulentiun);
LeulentiunCore.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/core.png");
Leulentiun.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/PKD/Leulentiun.png");
LeulentiunItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Leulentiunitem.png");
ModLoader.AddName(Leulentiun, "Leulentiun ore");
ModLoader.AddName(LeulentiunItem, "Leulentiun crystal");
ModLoader.AddName(LeulentiunCore, "Leulentiun Power Core");
ModLoader.AddRecipe(new ItemStack(LeulentiunCore, 1), new Object[] {
"X ", " P ", " X ", Character.valueOf('X'), ItemLeulentiun, Character.valueOf('P'), ItemPower
});
}
}
Well, first off, if you're making these as one mod, you don't need two mod_whatever codes. One mod_whatever code can be a collection of every bit of code.
Another thing I noticed is that you've been calling your LeulentiunItem ItemLeulentiun, when in fact, earlier in the code you declared the item as LeulentiunItem.
When using an item or block that you declared in a different collection of code, for instance, ItemPower, you have to put whichever collection of code it's in, a period, and then the item/block. In your code, it would look something like this.
mod_Power.PowerItem, 1
So that's two major errors which seem to be messing up your code. I'll just go ahead and fix those for you.
package net.minecraft.src;
import java.util.Random;
public class mod_Power extends BaseMod
{
public static final Block Power = new BlockPower(120, 0).setHardness(2.0F).setResistance(2.0F).setBlockName("PowerOre");
public static final Item PowerItem = new Item(802).setItemName("Poweringot");
public static final Item NPItem = new Item(806).setItemName("super Power ingot");
public static final Item PowerPick = new ItemPickaxe(801, EnumToolMaterial.GOLD).setItemName("PowerPick");
public static final Item PowerShovel = new ItemSpade(800, EnumToolMaterial.GOLD).setItemName("PowerShovel");
public static final Item PowerAxe = new ItemAxe(803, EnumToolMaterial.GOLD).setItemName("PowerAxe");
public static final Item PowerHoe = new ItemHoe(804, EnumToolMaterial.GOLD).setItemName("PowerHoe");
public static final Item PowerSword = new ItemSword(805, EnumToolMaterial.GOLD).setItemName("PowerSword");
public String Version()
{
return "1.5_01";
}
public void GenerateSurface(World worldObj, Random rand, int k, int l)
{
for(int i3 = 0; i3 < 15; i3++)
{
int j6 = k + rand.nextInt(16);
int k9 = rand.nextInt(128);
int i14 = l + rand.nextInt(16);
(new WorldGenMinable(Power.blockID, 16)).generate(worldObj, rand, j6, k9, i14);
}
}
public mod_Power()
{
ModLoader.AddSmelting(Power.blockID, new ItemStack(PowerItem, 1));
ModLoader.RegisterBlock(Power);
PowerItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Poweringot.png");
Power.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/PKD/Power.png");
PowerPick.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Powerpick.png");
PowerShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Powershovel.png");
PowerAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Poweraxe.png");
PowerHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Powerhoe.png");
PowerSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Powersword.png");
NPItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/NPingot.png");
ModLoader.AddName(Power, "Power ore");
ModLoader.AddName(PowerItem, "Power Sphere");
ModLoader.AddName(PowerPick, "Power Pickaxe");
ModLoader.AddName(PowerShovel, "Power Shovel");
ModLoader.AddName(PowerAxe, "Power Axe");
ModLoader.AddName(PowerHoe, "Power Hoe");
ModLoader.AddName(PowerSword, "Power Sword");
ModLoader.AddName(NPItem, "SP Sphere");
ModLoader.AddRecipe(new ItemStack(PowerPick, 1), new Object[] {
"XXX", " | ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(PowerShovel, 1), new Object[] {
" X ", " | ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(PowerHoe, 1), new Object[] {
" XX", " | ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(PowerAxe, 1), new Object[] {
" XX", "X| ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(PowerSword, 1), new Object[] {
" X ", " X ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(NPItem, 1), new Object[] {
" X ", " X ", " | ", Character.valueOf('X'), PowerItem, Character.valueOf('|'), Item.bone
});
ModLoader.AddRecipe(new ItemStack(mod_Leulentiun.LeulentiunCore, 1), new Object[] {
"X ", " P ", " X ", Character.valueOf('X'), mod_Leulentiun.LeulentiunItem, Character.valueOf('P'), PowerItem
});
}
}
package net.minecraft.src;
import java.util.Random;
public class mod_Leulentiun extends BaseMod
{
public static final Block Leulentiun = new BlockLeulentiun(122, 0).setHardness(6.0F).setResistance(8.0F).setBlockName("Leulentiun");
public static final Item LeulentiunItem = new Item(2667).setItemName("LeulentiunItem");
public static final Item LeulentiunCore = new Item(2677).setItemName("LeulentiunCore");
public String Version()
{
return "1.5_01";
}
public void GenerateSurface(World worldObj, Random rand, int k, int l)
{
for(int i3 = 0; i3 < 7; i3++)
{
int j6 = k + rand.nextInt(16);
int k9 = rand.nextInt(16);
int i14 = l + rand.nextInt(16);
(new WorldGenMinable(Leulentiun.blockID, 5)).generate(worldObj, rand, j6, k9, i14);
}
}
public mod_Leulentiun()
{
ModLoader.AddSmelting(Leulentiun.blockID, new ItemStack(LeulentiunItem, 1));
ModLoader.RegisterBlock(Leulentiun);
LeulentiunCore.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/core.png");
Leulentiun.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/PKD/Leulentiun.png");
LeulentiunItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/PKD/Leulentiunitem.png");
ModLoader.AddName(Leulentiun, "Leulentiun ore");
ModLoader.AddName(LeulentiunItem, "Leulentiun crystal");
ModLoader.AddName(LeulentiunCore, "Leulentiun Power Core");
ModLoader.AddRecipe(new ItemStack(LeulentiunCore, 1), new Object[] {
"X ", " P ", " X ", Character.valueOf('X'), LeulentiunItem, Character.valueOf('P'), mod_Power.PowerItem
});
}
}
That should work, just post any other errors you get if it doesn't.
here is the current code I have
also how would I modify the players health?
do I use something like this?
entityplayer.health--;
return entityplaver.health;
*** Minecraft Coder Pack Version 2.12 ***
MCP 2.12 running in C:\MCP
Compiling Minecraft
sources\minecraft\net\minecraft\src\mod_Emerald.java:13: illegal start of expres
sion
public String Version();
^
sources\minecraft\net\minecraft\src\mod_Emerald.java:13: ';' expected
public String Version();
^
sources\minecraft\net\minecraft\src\mod_Emerald.java:18: reached end of file whi
le parsing
}
*** minecraft_server.jar was not found, skipping
=== MCP 2.12 recompile script finished ===
Press any key to continue . . .
smp is harder to make
if you want to mod smp there is little tutorials/help around though you can try it and ill try to answer questions
can you please show me your mod_Emerald?
you're most likely missing a ; or a }
Iv already figured that much out but i cant figure how to set Block block = Block.tilledField; to get the block from mod loader
Have you tried to do this?:
i am trying to make a recipe from 2 differint ores i added to the game i get this error
heres my recipe in mod_power.java
and in my mod_Leulentiun.java
please help
yes i have tried that.
ItemRake
mod_sttool
Please post your entire mod_whatever code, we need to see exactly what you named your blocks and items.
And dmz, that requires making a whole new tile entity, a new GUI, and a lot of other stuff. idk, you could ask Ziddia on the forums.
i am trying to make a recipe from 2 differint ores i added to the game i get this error
heres my recipe in mod_power.java
and in my mod_Leulentiun.java
please help
I copied the glass code completetly and changed the names, that's all I did.
then I just copied the normal block code, the error only referred to this line:
the error says:
You need a .java file called BlockPlexiGlass.java. Or you could just change "new BlockPlexiGlass" to "new BlockGlass", which is what you want unless you want your plexiglass to have some special ability.
Ok, thanks!
Well, first off, if you're making these as one mod, you don't need two mod_whatever codes. One mod_whatever code can be a collection of every bit of code.
Another thing I noticed is that you've been calling your LeulentiunItem ItemLeulentiun, when in fact, earlier in the code you declared the item as LeulentiunItem.
When using an item or block that you declared in a different collection of code, for instance, ItemPower, you have to put whichever collection of code it's in, a period, and then the item/block. In your code, it would look something like this.
So that's two major errors which seem to be messing up your code. I'll just go ahead and fix those for you.
That should work, just post any other errors you get if it doesn't.
Troll: help please?
oh ok thats what i was doing wrong thanx