I tried to make a new block and when I recompile it, it has 6 errors :
Well, with three of your errors, you forgot to put a ")" ending the code, and the ";" after each line. Other errors probably aren't that hard to fix, go back to the main page and MAKE SURE you have the correct words.
If this helped, a + would be nice
Rollback Post to RevisionRollBack
My old signature was stupid and outdated. It's gone now.
Well, with three of your errors, you forgot to put a ")" ending the code, and the ";" after each line. Other errors probably aren't that hard to fix, go back to the main page and MAKE SURE you have the correct words.
Thanks for the Great Modding Tutorial, Its really helpful that you explain what each section does as you go through.
Sorry to have to ask this but I have an error message that comes up while trying to implement a block and I can't seem to figgure it out.
The Error Message - what I think is the relevent bit spaced out
java.lang.StringIndexOutOfBoundsException: String index out of range: 7
at java.lang.String.charAt(String.java:695)
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:394)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:412)
at net.minecraft.src.mod_Item.load(mod_Item.java:29)
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(Thread.java:722)
And I have tracked it down to this bit of code...
public static final Item TrotArm = new Item(5002).setItemName("TrotArm");
,,,,,,,,,,,
TrotArm.iconIndex = ModLoader.addOverride("/gui/items.png","/mods/Trot_Arm_Item.png");
ModLoader.addName(TrotArm, "Arm");
ModLoader.addRecipe(new ItemStack(TrotArm, 1), new Object []{"###","!", "#S#", Character.valueOf('#'),
RedGold, Character.valueOf('!'), Block.pistonBase, Character.valueOf('S'), Block.pistonStickyBase});
Thank you again for your time, I would go crazy with all these people constantly asking for help...
Hey guys, I have a problem with eclipse I get this error: "Project 'Server' is missing required library: 'jars/minecraft_server.jar'. As a result of that I get this error: "The project cannot be built until build path errors are resolved". Please help me!!
Hey guys, I have a problem with eclipse I get this error: "Project 'Server' is missing required library: 'jars/minecraft_server.jar'. As a result of that I get this error: "The project cannot be built until build path errors are resolved". Please help me!!
This is just saying that you didn't decompile the server.jar , you can either ignore it if you are not doing server modding or
Copy the "minecraft_server.jar" file into the "jars" folder.
Thanks for the Great Modding Tutorial, Its really helpful that you explain what each section does as you go through.
Sorry to have to ask this but I have an error message that comes up while trying to implement a block and I can't seem to figgure it out.
The Error Message - what I think is the relevent bit spaced out
java.lang.StringIndexOutOfBoundsException: String index out of range: 7
at java.lang.String.charAt(String.java:695)
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:394)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:412)
at net.minecraft.src.mod_Item.load(mod_Item.java:29)
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(Thread.java:722)
And I have tracked it down to this bit of code...
public static final Item TrotArm = new Item(5002).setItemName("TrotArm");
,,,,,,,,,,,
TrotArm.iconIndex = ModLoader.addOverride("/gui/items.png","/mods/Trot_Arm_Item.png");
ModLoader.addName(TrotArm, "Arm");
ModLoader.addRecipe(new ItemStack(TrotArm, 1), new Object []{"###","!", "#S#", Character.valueOf('#'),
RedGold, Character.valueOf('!'), Block.pistonBase, Character.valueOf('S'), Block.pistonStickyBase});
Thank you again for your time, I would go crazy with all these people constantly asking for help...
Do you have the public static final line outside the load() method, and the rest of the the code inside 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."
Ok so i am trying to include a block that i made into another block recipe like so;
package net.minecraft.src;
public class mod_Block extends BaseMod
{
public static final Block SuperGold = new SuperGold(160, 0).setBlockName("SuperGold").setHardness(3F).setResistance(4F).setLightValue(50F);
public static final Block SuperIron = new SuperIron(161, 0).setBlockName("SuperIron").setHardness(3f).setResistance(4F).setLightValue(10F);
public void load()
{
SuperGold.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/BlockTextures/SuperGold.png");
ModLoader.registerBlock(SuperGold);
ModLoader.addName(SuperGold, "SuperGold");
ModLoader.addRecipe(new ItemStack(SuperGold, 1), new Object [] {"###"," # ","###",Character.valueOf('#'), Block.dirt});
SuperIron.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/BlockTextures/SuperIron.png");
ModLoader.registerBlock(SuperIron);
ModLoader.addName(SuperIron, "SuperIron");
ModLoader.addRecipe(new ItemStack(SuperIron, 1), new Object [] {"# #"," # ","# #",Character.valueOf('#'), Block.SuperGold});
}
public String getVersion()
{
return "1.2.5";
}
}
And modloader gives me this error
Apr 21, 2012 11:37:10 PM ModLoader init
FINE: ModLoader 1.2.5 Initializing...
Apr 21, 2012 11:37:10 PM ModLoader readFromClassPath
FINER: Adding mods from C:\Users\Michael\AppData\Roaming\.minecraft\bin\minecraft.jar
Apr 21, 2012 11:37:10 PM ModLoader readFromClassPath
FINER: Zip found.
Apr 21, 2012 11:37:11 PM ModLoader addMod
FINE: Mod Initialized: "mod_Block 1.2.5" from mod_Block.class
Apr 21, 2012 11:37:11 PM ModLoader addOverride
FINER: addOverride(/terrain.png,/BlockTextures/SuperGold.png,168). 31 left.
Apr 21, 2012 11:37:11 PM ModLoader addOverride
FINER: addOverride(/terrain.png,/BlockTextures/SuperIron.png,169). 30 left.
Apr 21, 2012 11:37:11 PM ModLoader init
FINER: THROW
java.lang.NullPointerException
at fr.a(SourceFile:551)
at ModLoader.addRecipe(ModLoader.java:401)
at mod_Block.load(mod_Block.java:19)
at ModLoader.init(ModLoader.java:891)
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)
Also here are the block files:
Super Gold:
package net.minecraft.src;
import java.util.Random;
public class SuperGold extends Block {
public SuperGold(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.SuperGold.blockID;
}
public int quantityDropped(Random random)
{
return 4;
}
}
Super Iron:
package net.minecraft.src;
import java.util.Random;
public class SuperIron extends Block{
public SuperIron(int i, int j)
{
super(i, j, Material.sand);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.SuperIron.blockID;
}
public int quantityDropped(Random random){
return 5;
}
}
Also how would i get it to add to the spawn menu in ToManyItems or creative mode item list?
Thanks in advance
Ok so i am trying to include a block that i made into another block recipe like so;
package net.minecraft.src;
public class mod_Block extends BaseMod
{
public static final Block SuperGold = new SuperGold(160, 0).setBlockName("SuperGold").setHardness(3F).setResistance(4F).setLightValue(50F);
public static final Block SuperIron = new SuperIron(161, 0).setBlockName("SuperIron").setHardness(3f).setResistance(4F).setLightValue(10F);
public void load()
{
SuperGold.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/BlockTextures/SuperGold.png");
ModLoader.registerBlock(SuperGold);
ModLoader.addName(SuperGold, "SuperGold");
ModLoader.addRecipe(new ItemStack(SuperGold, 1), new Object [] {"###"," # ","###",Character.valueOf('#'), Block.dirt});
SuperIron.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/BlockTextures/SuperIron.png");
ModLoader.registerBlock(SuperIron);
ModLoader.addName(SuperIron, "SuperIron");
ModLoader.addRecipe(new ItemStack(SuperIron, 1), new Object [] {"# #"," # ","# #",Character.valueOf('#'), Block.SuperGold});
}
public String getVersion()
{
return "1.2.5";
}
}
And modloader gives me this error
Apr 21, 2012 11:37:10 PM ModLoader init
FINE: ModLoader 1.2.5 Initializing...
Apr 21, 2012 11:37:10 PM ModLoader readFromClassPath
FINER: Adding mods from C:\Users\Michael\AppData\Roaming\.minecraft\bin\minecraft.jar
Apr 21, 2012 11:37:10 PM ModLoader readFromClassPath
FINER: Zip found.
Apr 21, 2012 11:37:11 PM ModLoader addMod
FINE: Mod Initialized: "mod_Block 1.2.5" from mod_Block.class
Apr 21, 2012 11:37:11 PM ModLoader addOverride
FINER: addOverride(/terrain.png,/BlockTextures/SuperGold.png,168). 31 left.
Apr 21, 2012 11:37:11 PM ModLoader addOverride
FINER: addOverride(/terrain.png,/BlockTextures/SuperIron.png,169). 30 left.
Apr 21, 2012 11:37:11 PM ModLoader init
FINER: THROW
java.lang.NullPointerException
at fr.a(SourceFile:551)
at ModLoader.addRecipe(ModLoader.java:401)
at mod_Block.load(mod_Block.java:19)
at ModLoader.init(ModLoader.java:891)
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)
Also here are the block files:
Super Gold:
package net.minecraft.src;
import java.util.Random;
public class SuperGold extends Block {
public SuperGold(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.SuperGold.blockID;
}
public int quantityDropped(Random random)
{
return 4;
}
}
Super Iron:
package net.minecraft.src;
import java.util.Random;
public class SuperIron extends Block{
public SuperIron(int i, int j)
{
super(i, j, Material.sand);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.SuperIron.blockID;
}
public int quantityDropped(Random random){
return 5;
}
}
Also how would i get it to add to the spawn menu in ToManyItems or creative mode item list?
Thanks in advance
You forgot to define one of your variables in your second addRecipe method. As for the code to make it show up in Creative mode, look elsewhere for a tutorial, since TechGuy doesn't cover that here. It should already show up in TMI.
Do you know what I can do to make my custom mob just spawn in a generated structure?
Thanks for the help.
I believe you can only specify spawn location by biome. Now, if you wanted to do something like the silverfish, just make a block in your structure spawn the entity when it is destroyed. (Mod Development forum.)
Hey guys, I have a problem with eclipse I get this error: "Project 'Server' is missing required library: 'jars/minecraft_server.jar'. As a result of that I get this error: "The project cannot be built until build path errors are resolved". Please help me!!
For some reason, with the new update, you have to use the server jar as well as the client jar. Just install ModLoaderMP in the server jar, and drag it into the jars folder, like HoHoPo said. Run cleanup, and then decompile again.
if I want to make a mob with the model of a pig, do i just copy paste the contents of the model/renderPig? and if so, how would i go as to put the model an iron helmet
This is just saying that you didn't decompile the server.jar , you can either ignore it if you are not doing server modding or
(from MCP read me)
Hope this helps!
Sorry but- What is "MCP read me"? Is that where I get "minecraft_server.jar"? I can't find that file!
And also I can't decompile at all! here's the error that I get: "Java JDK is not installed! Please install java JDK from http://java .oracle.com"
I know I installed the newest version!
help me plez. Ok so i made a mob and it works and everything but its ears are like all screwed up and the model file ant wrong because the model is all right when i upload it on techne but when i play it ears are all messed up. so idk if its the model file or the render file plezzzzzzz help
Hello guys, but I have a question. I was playing around with my custom mob when I noticed his horns are not aligned when the head moves. I took a look at the villager npc and its nose moves around with its head. I tried to look at its model file but I can't understand a thing because the parts are not specified. Then I took a look at the wolf, because the wolf's ears and such also moves and sticks to the main head. I took a look into its model too, but there's no ear or nose field there. How can I make a face part move with the main head? Like when their is a nose, it sticks to the head when it moves. Mine looks messed up and their face parts are left when the main head looks up, right, down, or left. Help please.
EDIT: Nah, nevermind. I fixed it by using Techne. Never knew there was a Piece function.
I don't know how to fix it and here's my code:
how do I do it?
Well, with three of your errors, you forgot to put a ")" ending the code, and the ";" after each line. Other errors probably aren't that hard to fix, go back to the main page and MAKE SURE you have the correct words.
If this helped, a + would be nice
Thanks
Sorry to have to ask this but I have an error message that comes up while trying to implement a block and I can't seem to figgure it out.
The Error Message - what I think is the relevent bit spaced out
And I have tracked it down to this bit of code...
Thank you again for your time, I would go crazy with all these people constantly asking for help...
This is just saying that you didn't decompile the server.jar , you can either ignore it if you are not doing server modding or
(from MCP read me)
Hope this helps!
Do you have the public static final line outside the load() method, and the rest of the the code inside it?
together they are powerful beyond imagination."
And modloader gives me this error
Also here are the block files:
Super Gold:
Super Iron:
Also how would i get it to add to the spawn menu in ToManyItems or creative mode item list?
Thanks in advance
Thanks for the help.
You forgot to define one of your variables in your second addRecipe method. As for the code to make it show up in Creative mode, look elsewhere for a tutorial, since TechGuy doesn't cover that here. It should already show up in TMI.
I believe you can only specify spawn location by biome. Now, if you wanted to do something like the silverfish, just make a block in your structure spawn the entity when it is destroyed. (Mod Development forum.)
For some reason, with the new update, you have to use the server jar as well as the client jar. Just install ModLoaderMP in the server jar, and drag it into the jars folder, like HoHoPo said. Run cleanup, and then decompile again.
can someone asnwer?
Sorry but- What is "MCP read me"? Is that where I get "minecraft_server.jar"? I can't find that file!
And also I can't decompile at all! here's the error that I get: "Java JDK is not installed! Please install java JDK from http://java .oracle.com"
I know I installed the newest version!
The biome code for the top block is this:
It gives me an error saying that Deadgrass is not a symbol or something like that.
Do I have to do anything different for custom blocks?
The MCP readme is a text file in MCP that contains instructions. You can get the server jar from minecraft.net downloads page after you log in.
It should be:
heres the model file
and heres the render file
either do deadgrass.blockID or mod_**** (the mod_**** that the block uses).Deadgrass.blockID
EDIT: Nah, nevermind. I fixed it by using Techne. Never knew there was a Piece function.