Of course I wouldn't look there. Not right in front of my face. Thanks for the swift reply. I'm going to go fix my code now. Not before I kick myself though. Sorry for the terrible abundance of stupidity. In my defense, it's 8 AM, and I didn't sleep.
Rollback Post to RevisionRollBack
I used to maintain the Minecraft Forums Mod List. However, life has stepped in the way of that. Perhaps later...
When I create a block MCP doesn't give any errors, but ModLoader does when I startup Minecraft.
The modloader error:
jun 03, 2012 2:34:34 PM ModLoader init
FINE: ModLoader 1.2.5 Initializing...
jun 03, 2012 2:34:34 PM ModLoader readFromClassPath
FINER: Adding mods from C:\Users\Eigenaar\AppData\Roaming\.minecraft\bin\minecraft.jar
jun 03, 2012 2:34:34 PM ModLoader readFromClassPath
FINER: Zip found.
jun 03, 2012 2:34:34 PM ModLoader addMod
FINE: Failed to load mod from "mod_Toolmod.class"
jun 03, 2012 2:34:34 PM ModLoader addMod
FINER: THROW
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at ModLoader.addMod(ModLoader.java:294)
at ModLoader.readFromClassPath(ModLoader.java:1210)
at ModLoader.init(ModLoader.java:886)
at ModLoader.addAllRenderers(ModLoader.java:189)
at ahu.<init>(ahu.java:77)
at ahu.<clinit>(ahu.java:8)
at net.minecraft.client.Minecraft.a(SourceFile:273)
at net.minecraft.client.Minecraft.run(SourceFile:657)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 30001
at pb.<init>(SourceFile:313)
at pb.<init>(SourceFile:334)
at RedstoneBlock.<init>(RedstoneBlock.java:8)
at mod_Toolmod.<clinit>(mod_Toolmod.java:19)
... 15 more
jun 03, 2012 2:34:44 PM ModLoader addAllRenderers
FINE: Initialized
My code:
mod_***.java:
package net.minecraft.src;
import java.util.Random;
public class mod_Toolmod extends BaseMod
{
//tools
public static final Item ObsidianPickaxe = new ItemPickaxe(20001, EnumToolMaterial.OBSIDIAN).setItemName("ObsidianPickaxe");
public static final Item ObsidianSpade = new ItemSpade(20002, EnumToolMaterial.OBSIDIAN).setItemName("ObsidianSpade");
public static final Item ObsidianAxe = new ItemAxe(20003, EnumToolMaterial.OBSIDIAN).setItemName("ObsidianAxe");
public static final Item ObsidianHoe = new ItemHoe(20004, EnumToolMaterial.OBSIDIAN).setItemName("ObsidianHoe");
public static final Item ObsidianSword = new ItemSword(20005, EnumToolMaterial.OBSIDIAN).setItemName("ObsidianSword");
public static final Item LapisPickaxe = new ItemPickaxe(20006, EnumToolMaterial.LAPIS).setItemName("LapisPickaxe");
public static final Item LapisSpade = new ItemSpade(20007, EnumToolMaterial.LAPIS).setItemName("LapisSpade");
public static final Item LapisAxe = new ItemAxe(20008, EnumToolMaterial.LAPIS).setItemName("LapisAxe");
public static final Item LapisHoe = new ItemHoe(20009, EnumToolMaterial.LAPIS).setItemName("LapisHoe");
public static final Item LapisSword = new ItemSword(20010, EnumToolMaterial.LAPIS).setItemName("LapisSword");
//blocks or ores
public static final Block RedstoneBlock = new RedstoneBlock(30001, 0).setBlockName("RedstoneBlock").setHardness(3F).setResistance(4F).setLightValue(1F);
public mod_Toolmod()
{
// item settings
ObsidianPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Toolmod/ObsidianPickaxe.png");
ObsidianSpade.iconIndex = ModLoader.addOverride("/gui/items.png", "Toolmod/ObsidianSpade.png");
ObsidianAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "Toolmod/ObsidianAxe.png");
ObsidianHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "Toolmod/ObsidianHoe.png");
ObsidianSword.iconIndex = ModLoader.addOverride("/gui/items.png", "Toolmod/ObsidianSword.png");
LapisPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Toolmod/LapisPickaxe.png");
LapisSpade.iconIndex = ModLoader.addOverride("/gui/items.png", "Toolmod/LapisSpade.png");
LapisAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "Toolmod/LapisAxe.png");
LapisHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "Toolmod/LapisHoe.png");
LapisSword.iconIndex = ModLoader.addOverride("/gui/items.png", "Toolmod/LapisSword.png");
ModLoader.addName(ObsidianPickaxe, "Obsidian Pickaxe");
ModLoader.addName(ObsidianSpade, "Obsidian Shovel");
ModLoader.addName(ObsidianAxe, "Obsidian Axe");
ModLoader.addName(ObsidianHoe, "Obsidian Hoe");
ModLoader.addName(ObsidianSword, "Obsidian Sword");
ModLoader.addName(LapisPickaxe, "Lapis Pickaxe");
ModLoader.addName(LapisSpade, "Lapis Shovel");
ModLoader.addName(LapisAxe, "Lapis Axe");
ModLoader.addName(LapisHoe, "Lapis Hoe");
ModLoader.addName(LapisSword, "Lapis Sword");
//block settings
RedstoneBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Toolmod/RedstoneBlock.png");
ModLoader.registerBlock(RedstoneBlock);
ModLoader.addName(RedstoneBlock, "Redstone Block");
ModLoader.addRecipe(new ItemStack(RedstoneBlock, 1), new Object [] {"###", "###", "###", Character.valueOf('#'), Item.redstone});
}
public void load()
{
}
public String getVersion()
{
return "1.2.5";
}
}
RedstoneBlock.java:
package net.minecraft.src;
import java.util.Random;
public class RedstoneBlock extends Block
{
public RedstoneBlock(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_Toolmod.RedstoneBlock.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
I hope you can help me!
Block ids cannot be over 255.
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's hard to explain any problems you've received when you don't explain what it is you did before getting them. Please give us some more details, and I'm sure we can figure it out.
Rollback Post to RevisionRollBack
I used to maintain the Minecraft Forums Mod List. However, life has stepped in the way of that. Perhaps later...
I am making a tinted glass mod, but when I place the block down, all blocks in the same level as the glass block are invisible while looking through it.
I am making a tinted glass mod, but when I place the block down, all blocks in the same level as the glass block are invisible while looking through it.
The advanced block-glass tutorial shows you the code needed to fix 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."
Im pretty sure many of you havent gone that far you would of tried to make a dimension, but i still wanted to ask if anyone has used that dimension API. Its like modloader but allows you to create dimensions. I get error with it, even i haven edited any code. So you dont need to do anything with dimension but could someone try to decompile their mcp with modloader and dimensions API. Here is link for it:http://www.minecraft...ension-api-v14/
I'm going to start making a dimension in a few days but I'm not going to use that API. I am using Forge as it has a dimension handler as well and recommend using it over the Puddelhund's API. I've heard that that API has chunk issues.
I've started every sentence on this post with "I".
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
My latest problem is that I want to add an item I made to the drop list of a pre-existing mob. (Namely sheep) Is it possible? Can it be done without editing a base class?
My latest problem is that I want to add an item I made to the drop list of a pre-existing mob. (Namely sheep) Is it possible? Can it be done without editing a base class?
I hope I'm not just being stupid again.
No, it can't be done without base class editing.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Hey i have a rly weird problem i made my mod and everything and eclipse says that it all works so i run my minecraft and it loads up but when i go to craft my item i made it doesnt work i copy and pasted everything about making items but for some reason minecraft completely ignores my coding PLS HELP!
Hey i have a rly weird problem i made my mod and everything and eclipse says that it all works so i run my minecraft and it loads up but when i go to craft my item i made it doesnt work i copy and pasted everything about making items but for some reason minecraft completely ignores my coding PLS HELP!
Did you recompile it? o.O
Rollback Post to RevisionRollBack
I used to maintain the Minecraft Forums Mod List. However, life has stepped in the way of that. Perhaps later...
Oh, goodness. I meant a private message. Anyways, next time you should put your code in between code and spoilers BBCode. That'll keep your message smaller.
Well, anyways. It's your item declaration... It's suppose to be
public static final Item Medal = new Item(5000).setItemName("Medal");
Oh, goodness. I meant a private message. Anyways, next time you should put your code in between code and spoilers BBCode. That'll keep your message smaller.
Well, anyways. It's your item declaration... It's suppose to be
public static final Item Medal = new Item(5000).setItemName("Medal");
EDIT: BLAST the edit function on this forum! lol
lol opps soz bout that but thx ALOT! When i make my mod i will put your name in the special thanks section
-
View User Profile
-
View Posts
-
Send Message
Retired Staff...-facepalm-
Of course I wouldn't look there. Not right in front of my face. Thanks for the swift reply. I'm going to go fix my code now. Not before I kick myself though. Sorry for the terrible abundance of stupidity. In my defense, it's 8 AM, and I didn't sleep.
Block ids cannot be over 255.
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Retired StaffIt's hard to explain any problems you've received when you don't explain what it is you did before getting them. Please give us some more details, and I'm sure we can figure it out.
The advanced block-glass tutorial shows you the code needed to fix it.
together they are powerful beyond imagination."
I'm going to start making a dimension in a few days but I'm not going to use that API. I am using Forge as it has a dimension handler as well and recommend using it over the Puddelhund's API. I've heard that that API has chunk issues.
I've started every sentence on this post with "I".
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Retired StaffMy latest problem is that I want to add an item I made to the drop list of a pre-existing mob. (Namely sheep) Is it possible? Can it be done without editing a base class?
I hope I'm not just being
stupidsilly again.No, it can't be done without base class editing.
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Retired Staff-
View User Profile
-
View Posts
-
Send Message
Retired StaffDid you recompile it? o.O
-
View User Profile
-
View Posts
-
Send Message
Retired StaffWell, I've gotten lots of items and recipes* working in-game. If you'd like to PM me the code in question, I'll try to help you pin-point the problem.
here is my mod code:
package net.minecraft.src;
public class Mod_Medabots extends BaseMod
{
public static final Item Medal = new ItemMedal(5000).setItemName("Medal");
public void load()
{
Medal.iconIndex = ModLoader.addOverride("/gui/items.png", "/Medabots/Medal.png");
ModLoader.addName(Medal, "Medal");
ModLoader.addRecipe(new ItemStack(Medal, 1), new Object [] {" G ", "GDG", " G ", Character.valueOf('G'), Item.ingotGold, Character.valueOf('D'), Item.diamond});
}
public String getVersion()
{
return "1.2.5";
}
}
And here is my Item code:
package net.minecraft.src;
public class ItemMedal extends Item
{
public ItemMedal(int i)
{
super(i);
maxStackSize = 1;
}
}
-
View User Profile
-
View Posts
-
Send Message
Retired StaffWell, anyways. It's your item declaration... It's suppose to be
public static final Item Medal = new Item(5000).setItemName("Medal");EDIT: BLAST the edit function on this forum! lol
-
View User Profile
-
View Posts
-
Send Message
Retired StaffMake sure you thank TechGuy first. ;p