i did that and now i get:
27 achievements
182 recipes
LWJGL Version: 2.4.2
Jul 21, 2012 10:55:01 AM cpw.mods.fml.common.FMLCommonHandler beginLoading
INFO: Attempting early MinecraftForge initialization
Jul 21, 2012 10:55:01 AM cpw.mods.fml.common.FMLCommonHandler beginLoading
INFO: Completed early MinecraftForge initialization
2012-07-21 10:55:01 [INFO] Forge Mod Loader version 2.2.78.153 for Minecraft 1.2.5 loading
2012-07-21 10:55:01 [INFO] Loading mods from E:\Program Files (x86)\mcp\jars\mods
2012-07-21 10:55:01 [INFO] Forge Mod Loader has loaded 2 mods
Exception in thread "Minecraft main thread" java.lang.Error: Unresolved compilation problems:
blockID cannot be resolved to a variable
Syntax error, insert "}" to complete ClassBody
Syntax error on token "(", delete this token
Syntax error on token ")", { expected after this token
at net.minecraft.src.mod_YOURMODNAME.<init>(mod_YOURMODNAME.java:9)
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 cpw.mods.fml.common.modloader.ModLoaderModContainer.preInit(ModLoaderModContainer.java:107)
at cpw.mods.fml.common.Loader.preModInit(Loader.java:235)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:593)
at cpw.mods.fml.client.FMLClientHandler.onPreLoad(FMLClientHandler.java:193)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:383)
at net.minecraft.client.Minecraft.run(Minecraft.java:735)
at java.lang.Thread.run(Thread.java:722)
package net.minecraft.src;
public class mod_YOURMODNAME extends BaseMod {
Block yourFirstBlock = new BlockTutorial(blockID, 0).setHardness(2.5F).setStepSound(Block.soundWoodFootstep).setBlockName("blockName");//This is a field, it must be accessed by all methods, so it cannot be declared in any single method.
@Override
public String getVersion() {//Method declarations do not have semicolons after them, only statements do
//A statement is something like that is below, it does something tangible, and thus needs a semicolon
return "1.0";//This returns the string, or text, "1.0" as the version
}
@Override
public void load(ModLoader.registerBlock(yourFirstBlock){
ModLoader.addName(yourFirstBlock, "Woohoo! My first Block ");
}
}//Every bracket must match up with another bracket, so for every { you have, you must have a }
BlockTutorial.java should be:
package net.minecraft.src;
import java.util.ArrayList;
import net.minecraft.src.forge.ITextureProvider;
public class BlockTutorial extends Block implements ITextureProvider {
public BlockTutorial(int i, int j)
{
super(i, j, Material.wood);
}
public String getTextureFile()
{
return "/Mic'sMods/CrossbowMod/gui/Crossbow.png";
}
public void addCreativeItems(ArrayList itemList)
{
if(blockID == mod_YOURMODNAME. yourFirstBlock.blockID)
{
itemList.add(new ItemStack(this));
}
}
}
Some times you need to see real code to know what your doing wrong.
When I was younger, I did not understand inheritance. I knew WHAT it meant, but whenever I tried extending classes, it wouldn't work. So I found an example of code using inheritance, and found that I was just messing up the constructor. From then on, I knew what to do.
Rollback Post to RevisionRollBack
I couldn't think of a good signature, and I found this on my hard drive, so...
Some times you need to see real code to know what your doing wrong.
When I was younger, I did not understand inheritance. I knew WHAT it meant, but whenever I tried extending classes, it wouldn't work. So I found an example of code using inheritance, and found that I was just messing up the constructor. From then on, I knew what to do.
Here's the thing. You knew what it was, then got example code. He doesn't know what he is doing and got code. NOTHING was explained in the code, so he cannot learn. I started making mods in the same way. Didn't know what I was doing. Then I learned some java by watching online tutorials and I finally got what I was doing. The code finally made sense after I learned java.
Here's the thing. You knew what it was, then got example code. He doesn't know what he is doing and got code. NOTHING was explained in the code, so he cannot learn. I started making mods in the same way. Didn't know what I was doing. Then I learned some java by watching online tutorials and I finally got what I was doing. The code finally made sense after I learned java.
ryakra seemed to have trouble with knowing when to place semicolons, and seeing as Priceofmar5's post contained no semicolons, I did not see how that would help. We clearly have different opinions about how to learn a programming language, so why don't we just agree to disagree?
Rollback Post to RevisionRollBack
I couldn't think of a good signature, and I found this on my hard drive, so...
ryakra seemed to have trouble with knowing when to place semicolons, and seeing as Priceofmar5's post contained no semicolons, I did not see how that would help. We clearly have different opinions about how to learn a programming language, so why don't we just agree to disagree?
Let me make a real life analogy.
Lets say I have no idea how to drive. I have never seen a car before, and I have no idea what anything does inside of a car. If you just put me in the car and say go forward, I wouldn't know what to do. If you put me in the car and say go forward, and then explain where and what the gas pedal does, then I have learned this. In this case, the car is the code. You are putting functional code. He has no experience in java programming, and has no idea what anything does. But if you say "This part is wrong: *insert code here* to fix it you do *insert fix here*, here's why: *insert reason here*" Then he can learn what he is doing and learn to improve on his mistakes.
Let me make a real life analogy.
Lets say I have no idea how to drive. I have never seen a car before, and I have no idea what anything does inside of a car. If you just put me in the car and say go forward, I wouldn't know what to do. If you put me in the car and say go forward, and then explain where and what the gas pedal does, then I have learned this. In this case, the car is the code. You are putting functional code. He has no experience in java programming, and has no idea what anything does. But if you say "This part is wrong: *insert code here* to fix it you do *insert fix here*, here's why: *insert reason here*" Then he can learn what he is doing and learn to improve on his mistakes.
I suggest you find a better analogy, as many people watch others drive before getting behind the wheel themselves. In your analogy, you are saying that you have never seen a car before. Yet that does not carry over, as ryakra probably has seen some code before. Many people learn in different ways, there is absolutely no use in arguing over this, neither one of us benefits from this, and it isn't constructive.
Edit: Every programming book I have ever seen is loaded with code examples, because that is how some people learn. Others jump to the back of the chapter and just do all of the exercises (like, write a 3D tic tac toe program that is a command-line game). We all learn differently, I simply posted what I did encase he was still lost after Princeofmar5's post, OK?
Yeah there is no reason to argue, I agree with JohnathonNow. people learn differently. I've just learned from experience with my brother that some people just want people to spoonfeed them answers so they don't have to do any work themselves. This may not be the case here, but I would have directed him to the right answer eventually lol.
Rollback Post to RevisionRollBack
Check out all my mods/plugins in one convenient place!
package net.minecraft.src;
public class mod_YOURMODNAME extends BaseMod {
Block yourFirstBlock = new BlockTutorial(blockID, 0).setHardness(2.5F).setStepSound(Block.soundWoodFootstep).setBlockName("blockName");//This is a field, it must be accessed by all methods, so it cannot be declared in any single method.
@Override
public String getVersion() {//Method declarations do not have semicolons after them, only statements do
//A statement is something like that is below, it does something tangible, and thus needs a semicolon
return "1.0";//This returns the string, or text, "1.0" as the version
}
@Override
public void load(ModLoader.registerBlock(yourFirstBlock){
ModLoader.addName(yourFirstBlock, "Woohoo! My first Block ");
}
}//Every bracket must match up with another bracket, so for every { you have, you must have a }
BlockTutorial.java should be:
package net.minecraft.src;
import java.util.ArrayList;
import net.minecraft.src.forge.ITextureProvider;
public class BlockTutorial extends Block implements ITextureProvider {
public BlockTutorial(int i, int j)
{
super(i, j, Material.wood);
}
public String getTextureFile()
{
return "/Mic'sMods/CrossbowMod/gui/Crossbow.png";
}
public void addCreativeItems(ArrayList itemList)
{
if(blockID == mod_YOURMODNAME. yourFirstBlock.blockID)
{
itemList.add(new ItemStack(this));
}
}
}
did that and got
27 achievements
182 recipes
LWJGL Version: 2.4.2
Jul 22, 2012 6:38:24 PM cpw.mods.fml.common.FMLCommonHandler beginLoading
INFO: Attempting early MinecraftForge initialization
Jul 22, 2012 6:38:24 PM cpw.mods.fml.common.FMLCommonHandler beginLoading
INFO: Completed early MinecraftForge initialization
2012-07-22 18:38:24 [INFO] Forge Mod Loader version 2.2.78.153 for Minecraft 1.2.5 loading
2012-07-22 18:38:24 [INFO] Loading mods from E:\Program Files (x86)\mcp\jars\mods
2012-07-22 18:38:24 [INFO] Forge Mod Loader has loaded 2 mods
Exception in thread "Minecraft main thread" java.lang.Error: Unresolved compilation problems:
blockID cannot be resolved to a variable
Syntax error, insert "}" to complete ClassBody
Syntax error on token "(", delete this token
Syntax error on token "}", delete this token
at net.minecraft.src.mod_YOURMODNAME.<init>(mod_YOURMODNAME.java:5)
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 cpw.mods.fml.common.modloader.ModLoaderModContainer.preInit(ModLoaderModContainer.java:107)
at cpw.mods.fml.common.Loader.preModInit(Loader.java:235)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:593)
at cpw.mods.fml.client.FMLClientHandler.onPreLoad(FMLClientHandler.java:193)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:383)
at net.minecraft.client.Minecraft.run(Minecraft.java:735)
at java.lang.Thread.run(Thread.java:722)
also im getting a red line under the blockID on mod_YOURMODNAME and im geting the red line under one of the parenthesizes and one under the little thing right below the return "1.0" and at the end
You really need to learn how to read error messages, don`t let other people waste their time with this!
But well:
You have to replace blockID with a number!
And your load() had alot syntax mistakes:
@Override
public void load(){ModLoader.registerBlock(yourFirstBlock);
ModLoader.addName(yourFirstBlock, "Woohoo! My first Block ");
}
Edit: You use Eclipse? How about you hover your mouse over the code, which gets marked red? In most cases Eclipse can give you the right option to solve the problem.
Whatever tutorial you're following you should just stop now and find a new one. Give the mod an actual name, not YOURMODNAME, also blockID should be an actual number. Yeah, find a real tutorial that actually uses an example, not generic stuff like YOURMODNAME or blockID
Rollback Post to RevisionRollBack
Check out all my mods/plugins in one convenient place!
mod_YOURMODNAME (note im doing this because THIS IS MY FIRST MOD)
package net.minecraft.src;
public class mod_YOURMODNAME extends BaseMod {
@Override
public String getVersion() {
return "1.0";
Block yourFirstBlock = new BlockTutorial(blockID, 0).setHardness(2.5F).setStepSound(Block.soundWoodFootstep).setBlockName("blockName");
@Override
public void load(ModLoader.registerBlock(yourFirstBlock);
ModLoader.addName(yourFirstBlock, "Woohoo! My first Block ");
}
}
package net.minecraft.src;
import java.util.ArrayList;
import net.minecraft.src.forge.ITextureProvider;
public class BlockTutorial extends Block implements ITextureProvider {
public BlockTutorial(int i, int j)
{
super(i, j, Material.wood);
}
public String getTextureFile()
{
return "/Mic'sMods/CrossbowMod/gui/Crossbow.png";
}
public void addCreativeItems(ArrayList itemList)
{
if(blockID == mod_YOURMODNAME. yourFirstBlock.blockID)
{
itemList.add(new ItemStack(this));
}
}
27 achievements
182 recipes
LWJGL Version: 2.4.2
Jul 21, 2012 10:55:01 AM cpw.mods.fml.common.FMLCommonHandler beginLoading
INFO: Attempting early MinecraftForge initialization
Jul 21, 2012 10:55:01 AM cpw.mods.fml.common.FMLCommonHandler beginLoading
INFO: Completed early MinecraftForge initialization
2012-07-21 10:55:01 [INFO] Forge Mod Loader version 2.2.78.153 for Minecraft 1.2.5 loading
2012-07-21 10:55:01 [INFO] Loading mods from E:\Program Files (x86)\mcp\jars\mods
2012-07-21 10:55:01 [INFO] Forge Mod Loader has loaded 2 mods
Exception in thread "Minecraft main thread" java.lang.Error: Unresolved compilation problems:
blockID cannot be resolved to a variable
Syntax error, insert "}" to complete ClassBody
Syntax error on token "(", delete this token
Syntax error on token ")", { expected after this token
at net.minecraft.src.mod_YOURMODNAME.<init>(mod_YOURMODNAME.java:9)
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 cpw.mods.fml.common.modloader.ModLoaderModContainer.preInit(ModLoaderModContainer.java:107)
at cpw.mods.fml.common.Loader.preModInit(Loader.java:235)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:593)
at cpw.mods.fml.client.FMLClientHandler.onPreLoad(FMLClientHandler.java:193)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:383)
at net.minecraft.client.Minecraft.run(Minecraft.java:735)
at java.lang.Thread.run(Thread.java:722)
public mod_whatever {
Block yourfirstblock
public void load() {
ModLoader.addname()
}
public void getVersion() {
return
}
}
mod_YOURMODNAME should be like this:
BlockTutorial.java should be:
I couldn't think of a good signature, and I found this on my hard drive, so...
Some times you need to see real code to know what your doing wrong.
When I was younger, I did not understand inheritance. I knew WHAT it meant, but whenever I tried extending classes, it wouldn't work. So I found an example of code using inheritance, and found that I was just messing up the constructor. From then on, I knew what to do.
I couldn't think of a good signature, and I found this on my hard drive, so...
Here's the thing. You knew what it was, then got example code. He doesn't know what he is doing and got code. NOTHING was explained in the code, so he cannot learn. I started making mods in the same way. Didn't know what I was doing. Then I learned some java by watching online tutorials and I finally got what I was doing. The code finally made sense after I learned java.
ryakra seemed to have trouble with knowing when to place semicolons, and seeing as Priceofmar5's post contained no semicolons, I did not see how that would help. We clearly have different opinions about how to learn a programming language, so why don't we just agree to disagree?
I couldn't think of a good signature, and I found this on my hard drive, so...
Let me make a real life analogy.
Lets say I have no idea how to drive. I have never seen a car before, and I have no idea what anything does inside of a car. If you just put me in the car and say go forward, I wouldn't know what to do. If you put me in the car and say go forward, and then explain where and what the gas pedal does, then I have learned this. In this case, the car is the code. You are putting functional code. He has no experience in java programming, and has no idea what anything does. But if you say "This part is wrong: *insert code here* to fix it you do *insert fix here*, here's why: *insert reason here*" Then he can learn what he is doing and learn to improve on his mistakes.
I suggest you find a better analogy, as many people watch others drive before getting behind the wheel themselves. In your analogy, you are saying that you have never seen a car before. Yet that does not carry over, as ryakra probably has seen some code before. Many people learn in different ways, there is absolutely no use in arguing over this, neither one of us benefits from this, and it isn't constructive.
Edit: Every programming book I have ever seen is loaded with code examples, because that is how some people learn. Others jump to the back of the chapter and just do all of the exercises (like, write a 3D tic tac toe program that is a command-line game). We all learn differently, I simply posted what I did encase he was still lost after Princeofmar5's post, OK?
I couldn't think of a good signature, and I found this on my hard drive, so...
did that and got
27 achievements
182 recipes
LWJGL Version: 2.4.2
Jul 22, 2012 6:38:24 PM cpw.mods.fml.common.FMLCommonHandler beginLoading
INFO: Attempting early MinecraftForge initialization
Jul 22, 2012 6:38:24 PM cpw.mods.fml.common.FMLCommonHandler beginLoading
INFO: Completed early MinecraftForge initialization
2012-07-22 18:38:24 [INFO] Forge Mod Loader version 2.2.78.153 for Minecraft 1.2.5 loading
2012-07-22 18:38:24 [INFO] Loading mods from E:\Program Files (x86)\mcp\jars\mods
2012-07-22 18:38:24 [INFO] Forge Mod Loader has loaded 2 mods
Exception in thread "Minecraft main thread" java.lang.Error: Unresolved compilation problems:
blockID cannot be resolved to a variable
Syntax error, insert "}" to complete ClassBody
Syntax error on token "(", delete this token
Syntax error on token "}", delete this token
at net.minecraft.src.mod_YOURMODNAME.<init>(mod_YOURMODNAME.java:5)
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 cpw.mods.fml.common.modloader.ModLoaderModContainer.preInit(ModLoaderModContainer.java:107)
at cpw.mods.fml.common.Loader.preModInit(Loader.java:235)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:593)
at cpw.mods.fml.client.FMLClientHandler.onPreLoad(FMLClientHandler.java:193)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:383)
at net.minecraft.client.Minecraft.run(Minecraft.java:735)
at java.lang.Thread.run(Thread.java:722)
But well:
You have to replace blockID with a number!
And your load() had alot syntax mistakes:
@Override
public void load(){ModLoader.registerBlock(yourFirstBlock);
ModLoader.addName(yourFirstBlock, "Woohoo! My first Block ");
}
Edit: You use Eclipse? How about you hover your mouse over the code, which gets marked red? In most cases Eclipse can give you the right option to solve the problem.
My very own mod: Infusioncraft
Whatever tutorial you're following you should just stop now and find a new one. Give the mod an actual name, not YOURMODNAME, also blockID should be an actual number. Yeah, find a real tutorial that actually uses an example, not generic stuff like YOURMODNAME or blockID