Hey Zid.
love your work.
i have just taken an intrest of modding minecraft and i saw a video which they followed ur tutorial and they showed how you make ur mod the emerald one. anyway in that clip you had posted in your tutorial saying version "14_01" while he said "15_01". im not sure which one i should use. please help. btw im a windows if it helps. hopefully soon mac :laugh.gif:
now, when i remove the mentioned bracket.. it throws 5 more errors at me! -ARGH- and i really do not know why... i've practically copied the tutorial code word for word (except image paths) :C
now, when i remove the mentioned bracket.. it throws 5 more errors at me! -ARGH- and i really do not know why... i've practically copied the tutorial code word for word (except image paths) :C
I think you have an extra '}' at the end, remove it, that might help a bit.
These are the 5 errors im getting after removing the "spare" bracket...
2011-11-15 19:30 - commands.__init__ - INFO - == MCP v4.5 ==
2011-11-15 19:30 - commands.__init__ - DEBUG - OS : win32
2011-11-15 19:30 - recompile.main - INFO - > Recompiling client...
2011-11-15 19:30 - commands.recompile - DEBUG - recompile: 'javac.exe -g -source 1.6 -target 1.6 -classpath "lib/;lib/*;jars/bin/minecraft.jar;jars/bin/jinput.jar;jars/bin/lwjgl.jar;jars/bin/lwjgl_util.jar" -sourcepath src/minecraft -d bin/minecraft src/minecraft\net\minecraft\client\*.java src/minecraft\net\minecraft\src\*.java conf/patches/*.java'
2011-11-15 19:31 - commands.recompile - ERROR - javac.exe -g -source 1.6 -target 1.6 -classpath "lib/;lib/*;jars/bin/minecraft.jar;jars/bin/jinput.jar;jars/bin/lwjgl.jar;jars/bin/lwjgl_util.jar" -sourcepath src/minecraft -d bin/minecraft src/minecraft\net\minecraft\client\*.java src/minecraft\net\minecraft\src\*.java conf/patches/*.java failed.
2011-11-15 19:31 - commands.recompile - ERROR - Return code : 1
2011-11-15 19:31 - commands.recompile - DEBUG - warning: [options] bootstrap class path not set in conjunction with -source 1.6
2011-11-15 19:31 - commands.recompile - DEBUG - src\minecraft\net\minecraft\src\itemOrerefined.java:3: error: class ItemEmerald is public, should be declared in a file named ItemEmerald.java
2011-11-15 19:31 - commands.recompile - DEBUG - public class ItemEmerald extends Item {
2011-11-15 19:31 - commands.recompile - DEBUG - ^
2011-11-15 19:31 - commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_Emeralds.java:3: error: mod_Emeralds is not abstract and does not override abstract method load() in BaseMod
2011-11-15 19:31 - commands.recompile - DEBUG - public class mod_Emeralds extends BaseMod
2011-11-15 19:31 - commands.recompile - DEBUG - ^
2011-11-15 19:31 - commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_Emeralds.java:6: error: cannot find symbol
2011-11-15 19:31 - commands.recompile - DEBUG - public static final Block emeraldBlock = new BlockEmerald(98, 0).setHardness(1.5F).setResistance(5.0F).setBlockName("emeraldBlock");
2011-11-15 19:31 - commands.recompile - DEBUG - ^
2011-11-15 19:31 - commands.recompile - DEBUG - symbol: class BlockEmerald
2011-11-15 19:31 - commands.recompile - DEBUG - location: class mod_Emeralds
2011-11-15 19:31 - commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_Emeralds.java:20: error: missing method body, or declare abstract
2011-11-15 19:31 - commands.recompile - DEBUG - public String Version();
2011-11-15 19:31 - commands.recompile - DEBUG - ^
2011-11-15 19:31 - commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_Emeralds.java:22: error: return outside method
2011-11-15 19:31 - commands.recompile - DEBUG - return "1.9Pre5";
2011-11-15 19:31 - commands.recompile - DEBUG - ^
2011-11-15 19:31 - commands.recompile - DEBUG - Note: src\minecraft\net\minecraft\src\NetworkMasterThread.java uses or overrides a deprecated API.
2011-11-15 19:31 - commands.recompile - DEBUG - Note: Recompile with -Xlint:deprecation for details.
2011-11-15 19:31 - commands.recompile - DEBUG - Note: Some input files use unchecked or unsafe operations.
2011-11-15 19:31 - commands.recompile - DEBUG - Note: Recompile with -Xlint:unchecked for details.
2011-11-15 19:31 - commands.recompile - DEBUG - 5 errors
2011-11-15 19:31 - commands.recompile - DEBUG - 1 warning
2011-11-15 19:31 - commands.recompile - ERROR -
2011-11-15 19:31 - commands.recompile - ERROR - == ERRORS FOUND ==
2011-11-15 19:31 - commands.recompile - ERROR -
2011-11-15 19:31 - commands.recompile - ERROR - warning: [options] bootstrap class path not set in conjunction with -source 1.6
2011-11-15 19:31 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\itemOrerefined.java:3: error: class ItemEmerald is public, should be declared in a file named ItemEmerald.java
2011-11-15 19:31 - commands.recompile - ERROR - public class ItemEmerald extends Item {
2011-11-15 19:31 - commands.recompile - ERROR - ^
2011-11-15 19:31 - commands.recompile - ERROR -
2011-11-15 19:31 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_Emeralds.java:3: error: mod_Emeralds is not abstract and does not override abstract method load() in BaseMod
2011-11-15 19:31 - commands.recompile - ERROR - public class mod_Emeralds extends BaseMod
2011-11-15 19:31 - commands.recompile - ERROR - ^
2011-11-15 19:31 - commands.recompile - ERROR -
2011-11-15 19:31 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_Emeralds.java:6: error: cannot find symbol
2011-11-15 19:31 - commands.recompile - ERROR - public static final Block emeraldBlock = new BlockEmerald(98, 0).setHardness(1.5F).setResistance(5.0F).setBlockName("emeraldBlock");
2011-11-15 19:31 - commands.recompile - ERROR - ^
2011-11-15 19:31 - commands.recompile - ERROR -
2011-11-15 19:31 - commands.recompile - ERROR - symbol: class BlockEmerald
2011-11-15 19:31 - commands.recompile - ERROR - location: class mod_Emeralds
2011-11-15 19:31 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_Emeralds.java:20: error: missing method body, or declare abstract
2011-11-15 19:31 - commands.recompile - ERROR - public String Version();
2011-11-15 19:31 - commands.recompile - ERROR - ^
2011-11-15 19:31 - commands.recompile - ERROR -
2011-11-15 19:31 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_Emeralds.java:22: error: return outside method
2011-11-15 19:31 - commands.recompile - ERROR - return "1.9Pre5";
2011-11-15 19:31 - commands.recompile - ERROR - ^
2011-11-15 19:31 - commands.recompile - ERROR -
2011-11-15 19:31 - commands.recompile - ERROR - 5 errors
2011-11-15 19:31 - commands.recompile - ERROR - 1 warning
2011-11-15 19:31 - commands.recompile - ERROR - ==================
and once again heres my main code (after removing bracket)...
package net.minecraft.src;
public class mod_Emeralds extends BaseMod
{
public static final Block emeraldOre = new BlockEmeraldOre(97, 0).setHardness(2.0F).setResistance(5.0F).setBlockName("emeraldOre");
public static final Block emeraldBlock = new BlockEmerald(98, 0).setHardness(1.5F).setResistance(5.0F).setBlockName("emeraldBlock");
public static final Item emeraldItem = new Item(2000).setItemName("emeraldItem");
public mod_Emeralds()
{
ModLoader.RegisterBlock(emeraldOre);
ModLoader.RegisterBlock(emeraldBlock);
emeraldOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Matt/Blocks/EmeraldOre.png");
emeraldBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Matt/Blocks/EmeraldBlock.png");
emeraldItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/Matt/Items/EmeraldGem.png");
ModLoader.AddName(emeraldOre, "Emerald Ore");
ModLoader.AddName(emeraldBlock, "Emerald Block");
ModLoader.AddName(emeraldItem, "Emerald");
}
public String Version();
{
return "1.9Pre5";
}
}
i really do not understand it... it complains about having the the bracket as a "spare" but once i remove it it seems to be saying that nothing is in a body anymore......
Please post your Itemorerefined, as that seems to have an error too. However, it looks like the problem is, in the class, you have its name as public class ItemEmerald. Change that to public class Itemorerefined.
I have one question:
How can I force a block to update? I'm making a mod where if you activate a block, it spawns a still water block that doesn't move. If I update it manually (by placing a block next to it), it does move, but I want it to move as soon as it spawns.
I tried using world.updateBlocksAndPlayCaveSounds(), but it froze the game (before using this method it worked perfectly, but the block didn't update).
Edit: Nevermind. I fixed it. In the end I didn't even need to update the block. The problem was that I had spawned the Block.waterStill block which never updates, instead of spawning the Block.waterMoving. And the game freezing was caused by an infinite loop I had unknowingly created (im sucha noob). Now what I'm trying to do is to make the water block disappear when the power is off.
I have one question:
How can I force a block to update? I'm making a mod where if you activate a block, it spawns a still water block that doesn't move. If I update it manually (by placing a block next to it), it does move, but I want it to move as soon as it spawns.
I tried using world.updateBlocksAndPlayCaveSounds(), but it froze the game (before using this method it worked perfectly, but the block didn't update).
Edit: Nevermind. I fixed it. In the end I didn't even need to update the block. The problem was that I had spawned the Block.waterStill block which never updates, instead of spawning the Block.waterMoving. And the game freezing was caused by an infinite loop I had unknowingly created (im sucha noob). Now what I'm trying to do is to make the water block disappear when the power is off.
The method blockActivated is what you're using I hope, and in order to do what you want, it's very easy. I'm guessing you have a water block NEXT to YOUR block when you activate it, so the best way to do this is make a boolean variable. It needs to be a field variable, such as private boolean isActive (that's what I always use). Then, in your constructor, type isActive = false; this will make the variable false every time the block is being used (such as when it is first placed). Then, in your blockActivated method, do something for isActive and else, like this:
This will allow it to be activated twice. The first time you activate it, the block will be inactive. Therefore, it will spawn the water block the first time and the variable will be set to true (under the else statement). The second time you active it, the boolean will be true, so it will spawn an air block where the water block exists, and it will also set the variable to false. Now this can be repeated.
src\minecraft\net\minecraft\src\mod_Emeralds.java:3: net.minecraft.src.mod_Emera
lds is not abstract and does not override abstract method load() in net.minecraf
t.src.BaseMod
public class mod_Emeralds extends BaseMod
^
1 error
==================
> Done in 10.40 seconds
> Recompiling server...
!! Can not find server sources !!
Press any key to continue . . .
src\minecraft\net\minecraft\src\mod_Emeralds.java:14: illegal start of expressio
n
public String Version()
^
Can somebody please help me with this error?
src\minecraft\net\minecraft\src\mod_Emeralds.java:14: ';' expected
public String Version()
^
src\minecraft\net\minecraft\src\mod_Emeralds.java:19: reached end of file while
parsing
}→
^
3 errors
==================
> Done in 4.00 seconds
> Recompiling server...
!! Can not find server sources !!
Press any key to continue . . .
src\minecraft\net\minecraft\src\mod_Emeralds.java:14: illegal start of expressio
n
public String Version()
^
Can somebody please help me with this error?
src\minecraft\net\minecraft\src\mod_Emeralds.java:14: ';' expected
public String Version()
^
src\minecraft\net\minecraft\src\mod_Emeralds.java:19: reached end of file while
parsing
}→
^
3 errors
==================
> Done in 4.00 seconds
> Recompiling server...
!! Can not find server sources !!
Press any key to continue . . .
1: String Version() is now String getVersion() (well at least that worked for me)
2: Add the following code somewhere in the mod_Emerald class
public void load()
{
return;
}
3: Not sure of that on. Will need to see your code to make sense of it
love your work.
i have just taken an intrest of modding minecraft and i saw a video which they followed ur tutorial and they showed how you make ur mod the emerald one. anyway in that clip you had posted in your tutorial saying version "14_01" while he said "15_01". im not sure which one i should use. please help. btw im a windows if it helps. hopefully soon mac :laugh.gif:
Post your error log and your code.
i know i need to remove the terrain stuff
RSMC - A massive RPG mod which adds skills and tons of content to Minecraft, one block at a time!
and here's my mod_Emeralds...
Please help me!! i really want to get started with Modding myself but im always getting errors and im not sure why :sad.gif:
Change to this
You forgot to add the '}' to close off the previous statements.
TY, that fixed those issues though (and i was expecting this >.>) i get ANOTHER error that wasnt brought up b4..
now, when i remove the mentioned bracket.. it throws 5 more errors at me! -ARGH- and i really do not know why... i've practically copied the tutorial code word for word (except image paths) :C
I think you have an extra '}' at the end, remove it, that might help a bit.
yeah i know.. i tried removing it and it throws another 5 errors at me :angry.gif: xD frustrating code is frustrating
and once again heres my main code (after removing bracket)...
i really do not understand it... it complains about having the the bracket as a "spare" but once i remove it it seems to be saying that nothing is in a body anymore......
Anyone plz help with this :C
You have
Take out the ;.
Please post your Itemorerefined, as that seems to have an error too. However, it looks like the problem is, in the class, you have its name as public class ItemEmerald. Change that to public class Itemorerefined.
How can I force a block to update? I'm making a mod where if you activate a block, it spawns a still water block that doesn't move. If I update it manually (by placing a block next to it), it does move, but I want it to move as soon as it spawns.
I tried using world.updateBlocksAndPlayCaveSounds(), but it froze the game (before using this method it worked perfectly, but the block didn't update).
Edit: Nevermind. I fixed it. In the end I didn't even need to update the block. The problem was that I had spawned the Block.waterStill block which never updates, instead of spawning the Block.waterMoving. And the game freezing was caused by an infinite loop I had unknowingly created (im sucha noob). Now what I'm trying to do is to make the water block disappear when the power is off.
[SSSS]
The method blockActivated is what you're using I hope, and in order to do what you want, it's very easy. I'm guessing you have a water block NEXT to YOUR block when you activate it, so the best way to do this is make a boolean variable. It needs to be a field variable, such as private boolean isActive (that's what I always use). Then, in your constructor, type isActive = false; this will make the variable false every time the block is being used (such as when it is first placed). Then, in your blockActivated method, do something for isActive and else, like this:
This will allow it to be activated twice. The first time you activate it, the block will be inactive. Therefore, it will spawn the water block the first time and the variable will be set to true (under the else statement). The second time you active it, the boolean will be true, so it will spawn an air block where the water block exists, and it will also set the variable to false. Now this can be repeated.
Hope this helps!
RSMC - A massive RPG mod which adds skills and tons of content to Minecraft, one block at a time!
== MCP v5.0 ==
> Recompiling client...
javac.exe -g -source 1.6 -target 1.6 -classpath "lib/;lib/*;jars/bin/minecraft.j
ar;jars/bin/jinput.jar;jars/bin/lwjgl.jar;jars/bin/lwjgl_util.jar" -sourcepath s
rc/minecraft -d bin/minecraft src/minecraft\net\minecraft\client\*.java src/mine
craft\net\minecraft\src\*.java conf/patches/*.java failed.
Return code : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_Emeralds.java:3: net.minecraft.src.mod_Emera
lds is not abstract and does not override abstract method load() in net.minecraf
t.src.BaseMod
public class mod_Emeralds extends BaseMod
^
1 error
==================
> Done in 10.40 seconds
> Recompiling server...
!! Can not find server sources !!
Press any key to continue . . .
> Recompiling client...
javac.exe -g -source 1.6 -target 1.6 -classpath "lib/;lib/*;jars/bin/minecraft.j
ar;jars/bin/jinput.jar;jars/bin/lwjgl.jar;jars/bin/lwjgl_util.jar" -sourcepath s
rc/minecraft -d bin/minecraft src/minecraft\net\minecraft\client\*.java src/mine
craft\net\minecraft\src\*.java conf/patches/*.java failed.
Return code : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_Emeralds.java:14: illegal start of expressio
n
public String Version()
^
Can somebody please help me with this error?
src\minecraft\net\minecraft\src\mod_Emeralds.java:14: ';' expected
public String Version()
^
src\minecraft\net\minecraft\src\mod_Emeralds.java:19: reached end of file while
parsing
}→
^
3 errors
==================
> Done in 4.00 seconds
> Recompiling server...
!! Can not find server sources !!
Press any key to continue . . .
1: String Version() is now String getVersion() (well at least that worked for me)
2: Add the following code somewhere in the mod_Emerald class
3: Not sure of that on. Will need to see your code to make sense of it
Thanks man it works now