If you wanted to make a block that explodes with redstone without having the delay or need to make the render or entityprimed files all you have to do is add a ifInderectlyPowered(you can find it in the Block.JAVA file) and put protected Minecraft mc; at the top of Block****.java. Then within the above method, put mc. and then look for the create explosion.
I just wonder if anyone knows how to make spawner which spawns angry wolves. Since wolf have only one ID I thought it won't be possible, but I saw a mod with that spawner. Does anyone know?
So my block makes a little creeper proof bunker on a left click, i want to change that to right click, i tried changing the "onblockclicked" thing to rightclick onblockrightclick etc etc, i never got any recompile errors, but i never got any results in game, i rightclicked on it nothing happen, i NEED your help or somone else' check out my mod to see what im doing if you want, also the packing up part, im basically trying to make it a remote base, so that if you rightclick it opens up if you right click on it again it closes i need help their aswell, PLEASE HELP D;
(ive NEVER taken any lessons through school etc for java, ive only learned off of tutorials ;D)
So my block makes a little creeper proof bunker on a left click, i want to change that to right click, i tried changing the "onblockclicked" thing to rightclick onblockrightclick etc etc, i never got any recompile errors, but i never got any results in game, i rightclicked on it nothing happen, i NEED your help or somone else' check out my mod to see what im doing if you want, also the packing up part, im basically trying to make it a remote base, so that if you rightclick it opens up if you right click on it again it closes i need help their aswell, PLEASE HELP D;
(ive NEVER taken any lessons through school etc for java, ive only learned off of tutorials ;D)
I think you can use interact() or onInteract() but that might just be for entities. Try it anyways.
I think you can use interact() or onInteract() but that might just be for entities. Try it anyways.
I will try, thanks!, it said no recompiling errors, as soon as i get in the game same resulsts as everything else nothing happens lol... thanks for trying to help me though! ;D
I will try, thanks!, it said no recompiling errors, as soon as i get in the game same resulsts as everything else nothing happens lol... thanks for trying to help me though! ;D
Use the blockActivated method. Thats the right click one.
Now, I realise that this is for 1.1, but i believe the code should be pretty much the same, so if anyone could please tell me what the problem is? I recompile it fine, but then when I test the client, I get to the Mojang logo, and then this error comes up.
Mods loaded: 1
ModLoader 1.1
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
If you wish to report this, please copy this entire text and email it to [email protected].
Please include a description of what you did when the error occured.
--- BEGIN ERROR REPORT 9c4f49b2 --------
Generated 2/18/12 8:53 PM
Minecraft: Minecraft 1.1
OS: Windows 7 (x86) version 6.1
Java: 1.6.0_29, Sun Microsystems Inc.
VM: Java HotSpot(TM) Client VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: AMD M880G with ATI Mobility Radeon HD 4250 version 3.2.9704 Compatibility Profile Context, ATI Technologies Inc.
java.lang.InstantiationException
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.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 net.minecraft.src.ModLoader.addMod(ModLoader.java:234)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1217)
at net.minecraft.src.ModLoader.init(ModLoader.java:708)
at net.minecraft.src.ModLoader.AddAllRenderers(ModLoader.java:150)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:78)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:9)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:316)
at net.minecraft.client.Minecraft.run(Minecraft.java:620)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 41ec44f ----------
Please help me. Realise that all of these classes have been unedited by me, so it should be somewhat easy to tell what the problem is. Thanks
- Balthazar
Now, I realise that this is for 1.1, but i believe the code should be pretty much the same, so if anyone could please tell me what the problem is? I recompile it fine, but then when I test the client, I get to the Mojang logo, and then this error comes up.
Mods loaded: 1
ModLoader 1.1
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
If you wish to report this, please copy this entire text and email it to [email protected].
Please include a description of what you did when the error occured.
--- BEGIN ERROR REPORT 9c4f49b2 --------
Generated 2/18/12 8:53 PM
Minecraft: Minecraft 1.1
OS: Windows 7 (x86) version 6.1
Java: 1.6.0_29, Sun Microsystems Inc.
VM: Java HotSpot(TM) Client VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: AMD M880G with ATI Mobility Radeon HD 4250 version 3.2.9704 Compatibility Profile Context, ATI Technologies Inc.
java.lang.InstantiationException
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.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 net.minecraft.src.ModLoader.addMod(ModLoader.java:234)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1217)
at net.minecraft.src.ModLoader.init(ModLoader.java:708)
at net.minecraft.src.ModLoader.AddAllRenderers(ModLoader.java:150)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:78)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:9)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:316)
at net.minecraft.client.Minecraft.run(Minecraft.java:620)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 41ec44f ----------
Please help me. Realise that all of these classes have been unedited by me, so it should be somewhat easy to tell what the problem is. Thanks
- Balthazar
The problem is that Minecraft has some sort of problem with the ModLoader. Try making a Fresh MCP and porting all of your edited/new classes.
The problem is that Minecraft has some sort of problem with the ModLoader. Try making a Fresh MCP and porting all of your edited/new classes.
I thought I'd add the cmd reading and the class that seems to have a problem.
CMD:
== MCP 5.6 (data: 5.6, client: 1.1, server: 1.1) ==
[22:19:14] 27 achievements
[22:19:14] 174 recipes
[22:19:15] ModLoader 1.1 Initializing...
[22:19:15] Failed to load mod from "mod_FirstBlock.class"
[22:19:15] Done.
[22:19:15] WARNING: Found unknown Windows version: Windows 7
[22:19:15] Attempting to use default windows plug-in.
[22:19:15] Loading: net.java.games.input.DirectAndRawInputEnvironmentPlugin
[22:19:15]
[22:19:15] Starting up SoundSystem...
[22:19:15] Initializing LWJGL OpenAL
[22:19:15] (The LWJGL binding of OpenAL. For more information, see http://w
ww.lwjgl.org)
[22:19:15] OpenAL initialized.
[22:19:16]
Class File:
package net.minecraft.src;
abstract class mod_FirstBlock extends BaseMod
{
public static Block First = new BlockFirst(125, 0).setHardness(1.0F).setResistance(6000.0F).setLightValue(1.0F).setBlockName("First");
public String Version()
{
return "1.1.0";
}
public mod_FirstBlock()
{
ModLoader.RegisterBlock(First);
First.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/FirstBlock.png");
ModLoader.AddName(First, "First Block");
ModLoader.AddRecipe(new ItemStack(First, 1), new Object[] {
"$ $", "$$ ", " $ ", Character.valueOf('$'), Block.dirt.blockID
});
}
}
Any further help would be appreciated :smile.gif:
Thanks,
- Balthazar
P.S. The mod class does say "abstract" yes, but that is because ModLoader's new code requires it to be an abstract class. The public class will no longer work.
I thought I'd add the cmd reading and the class that seems to have a problem.
CMD:
== MCP 5.6 (data: 5.6, client: 1.1, server: 1.1) ==
[22:19:14] 27 achievements
[22:19:14] 174 recipes
[22:19:15] ModLoader 1.1 Initializing...
[22:19:15] Failed to load mod from "mod_FirstBlock.class"
[22:19:15] Done.
[22:19:15] WARNING: Found unknown Windows version: Windows 7
[22:19:15] Attempting to use default windows plug-in.
[22:19:15] Loading: net.java.games.input.DirectAndRawInputEnvironmentPlugin
[22:19:15]
[22:19:15] Starting up SoundSystem...
[22:19:15] Initializing LWJGL OpenAL
[22:19:15] (The LWJGL binding of OpenAL. For more information, see http://w
ww.lwjgl.org)
[22:19:15] OpenAL initialized.
[22:19:16]
Class File:
package net.minecraft.src;
abstract class mod_FirstBlock extends BaseMod
{
public static Block First = new BlockFirst(125, 0).setHardness(1.0F).setResistance(6000.0F).setLightValue(1.0F).setBlockName("First");
public String getVersion()
{
return "1.1.0";
}
public void load()
{
ModLoader.RegisterBlock(First);
First.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/FirstBlock.png");
ModLoader.AddName(First, "First Block");
ModLoader.AddRecipe(new ItemStack(First, 1), new Object[] {
"$ $", "$$ ", " $ ", Character.valueOf('$'), Block.dirt.blockID
});
}
}
Any further help would be appreciated :smile.gif:
Thanks,
- Balthazar
P.S. The mod class does say "abstract" yes, but that is because ModLoader's new code requires it to be an abstract class. The public class will no longer work.
I already found your mistake. You must be using a tutorial that is for an older version of minecraft. Because in Minecraft 1.0+ the "Public String Version()" has been changed to "Public String getVersion()". And the "Public Mod Namehere()" has been changed to "Public void load()". If you look in your code spoilers above, I have changed the code to work so just replace your code with the one above. And if your looking to do anything else I suggest adding "import net.minecraft.src.*;" below the "package net.minecraft.src" to be able to use most of the methods minecraft used. +1 me if i helped :tongue.gif:.
I already found your mistake. You must be using a tutorial that is for an older version of minecraft. Because in Minecraft 1.0+ the "Public String Version()" has been changed to "Public String getVersion()". And the "Public Mod Namehere()" has been changed to "Public void load()". If you look in your code spoilers above, I have changed the code to work so just replace your code with the one above. And if your looking to do anything else I suggest adding "import net.minecraft.src.*;" below the "package net.minecraft.src" to be able to use most of the methods minecraft used. +1 me if i helped :tongue.gif:.
Well that didn't help one bit, so I went back into my code, changed the "abstract class" back into "public class" and got no errors, but I get a new crash report on the CMD, which is all about codes which I have not edited. So, could you take a look guys?
Error
== MCP 5.6 (data: 5.6, client: 1.1, server: 1.1) ==
[07:21:55] 27 achievements
[07:21:55] 174 recipes
[07:21:56] ModLoader 1.1 Initializing...
[07:21:56] Mod Initialized: mod_FirstBlock 1.1.0
[07:21:56] Overriding /terrain.png with /FirstBlock.png @ 30. 43 left.
[07:21:56] Exception in thread "Minecraft main thread" java.lang.ExceptionInInit
ializerError
[07:21:56] at net.minecraft.client.Minecraft.startGame(Minecraft.java:316)
[07:21:56] at net.minecraft.client.Minecraft.run(Minecraft.java:620)
[07:21:56] at java.lang.Thread.run(Unknown Source)
[07:21:56] Caused by: java.lang.RuntimeException: java.lang.NullPointerException
[07:21:56] at net.minecraft.src.ModLoader.init(ModLoader.java:745)
[07:21:56] at net.minecraft.src.ModLoader.AddAllRenderers(ModLoader.java:15
0)
[07:21:56] at net.minecraft.src.RenderManager.<init>(RenderManager.java:78)
[07:21:56] at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:9
)
[07:21:56] ... 3 more
[07:21:56] Caused by: java.lang.NullPointerException
[07:21:56] at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.j
ava:361)
[07:21:56] at net.minecraft.src.ModLoader.AddRecipe(ModLoader.java:344)
[07:21:56] at net.minecraft.src.mod_FirstBlock.load(mod_FirstBlock.java:19)
[07:21:56] at net.minecraft.src.ModLoader.init(ModLoader.java:714)
[07:21:56] ... 6 more
[07:24:14]
[07:24:14]
[07:24:14]
[07:24:14]
[07:24:14]
[07:24:14]
[07:24:14]
Press any key to continue . . .
Well that didn't help one bit, so I went back into my code, changed the "abstract class" back into "public class" and got no errors, but I get a new crash report on the CMD, which is all about codes which I have not edited. So, could you take a look guys?
Error
== MCP 5.6 (data: 5.6, client: 1.1, server: 1.1) ==
[07:21:55] 27 achievements
[07:21:55] 174 recipes
[07:21:56] ModLoader 1.1 Initializing...
[07:21:56] Mod Initialized: mod_FirstBlock 1.1.0
[07:21:56] Overriding /terrain.png with /FirstBlock.png @ 30. 43 left.
[07:21:56] Exception in thread "Minecraft main thread" java.lang.ExceptionInInit
ializerError
[07:21:56] at net.minecraft.client.Minecraft.startGame(Minecraft.java:316)
[07:21:56] at net.minecraft.client.Minecraft.run(Minecraft.java:620)
[07:21:56] at java.lang.Thread.run(Unknown Source)
[07:21:56] Caused by: java.lang.RuntimeException: java.lang.NullPointerException
[07:21:56] at net.minecraft.src.ModLoader.init(ModLoader.java:745)
[07:21:56] at net.minecraft.src.ModLoader.AddAllRenderers(ModLoader.java:15
0)
[07:21:56] at net.minecraft.src.RenderManager.<init>(RenderManager.java:78)
[07:21:56] at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:9
)
[07:21:56] ... 3 more
[07:21:56] Caused by: java.lang.NullPointerException
[07:21:56] at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.j
ava:361)
[07:21:56] at net.minecraft.src.ModLoader.AddRecipe(ModLoader.java:344)
[07:21:56] at net.minecraft.src.mod_FirstBlock.load(mod_FirstBlock.java:19)
[07:21:56] at net.minecraft.src.ModLoader.init(ModLoader.java:714)
[07:21:56] ... 6 more
[07:24:14]
[07:24:14]
[07:24:14]
[07:24:14]
[07:24:14]
[07:24:14]
[07:24:14]
Press any key to continue . . .
OK I FIXED EVERYTHING. CODE IS BELOW.
mod_FirstBlock
package net.minecraft.src;
public class mod_FirstBlock extends BaseMod
{
public static Block First;
public static int firstID = 233;
static
{
First = new BlockFirst(firstID, ModLoader.addOverride("/terrain.png", "/FirstBlock.png")).setHardness(1.0F).setBlockName("First").setResistance(6000.0F).setLightValue(0.3F);
}
public String getVersion()
{
return "1.1.0";
}
public void load()
{
ModLoader.RegisterBlock(First);
ModLoader.AddName(First, "First Block");
ModLoader.AddRecipe(new ItemStack(First), new Object[]{
"X X", "XX ", " X ", Character.valueOf('X'), Block.dirt
});
}
}
The firstID thing means the Block ID.
I changed the way the block is registered. You should use this way next time. To add a block use these statements:
public static Block YOURBLOCKNAMEHERE;
public static int yourblocknamehereID = PUTDESIREDBLOCKIDHERE;
static
{
YourBlockNameHere = new BlockNamehere(yourblocknamehereID, ModLoader.addOverride("/terrain.png", "/nameoftexturehere.png")).setHardness(1.0F).setBlockName("Your Block Name Here").setResistance(6000.0F).setLightValue(0.3F);
}
BlockFirst
package net.minecraft.src;
import java.util.Random;
public class BlockFirst extends Block{
public BlockFirst(int i, int j){
super(i, j, Material.ground);
}
public int idDropped(int i, Random random)
{
return mod_FirstBlock.First.blockID;
}
}
You make only this worldgen your own one for the tree.
At this part, what exactly do you mean? Could you please clarify it a bit? Do you mean you make one for each tree or only one for all the trees (of course assuming your making more than one tree).
package net.minecraft.src;
public class mod_FirstBlock extends BaseMod
{
public static Block First;
public static int firstID = 233;
static
{
First = new BlockFirst(firstID, ModLoader.addOverride("/terrain.png", "/FirstBlock.png")).setHardness(1.0F).setBlockName("First").setResistance(6000.0F).setLightValue(0.3F);
}
public String getVersion()
{
return "1.1.0";
}
public void load()
{
ModLoader.RegisterBlock(First);
ModLoader.AddName(First, "First Block");
ModLoader.AddRecipe(new ItemStack(First), new Object[]{
"X X", "XX ", " X ", Character.valueOf('X'), Block.dirt
});
}
}
The firstID thing means the Block ID.
I changed the way the block is registered. You should use this way next time. To add a block use these statements:
public static Block YOURBLOCKNAMEHERE;
public static int yourblocknamehereID = PUTDESIREDBLOCKIDHERE;
static
{
YourBlockNameHere = new BlockNamehere(yourblocknamehereID, ModLoader.addOverride("/terrain.png", "/nameoftexturehere.png")).setHardness(1.0F).setBlockName("Your Block Name Here").setResistance(6000.0F).setLightValue(0.3F);
}
BlockFirst
package net.minecraft.src;
import java.util.Random;
public class BlockFirst extends Block{
public BlockFirst(int i, int j){
super(i, j, Material.ground);
}
public int idDropped(int i, Random random)
{
return mod_FirstBlock.First.blockID;
}
}
Pictures:
Texture
Pic of block in-game:
+1 me if i helped :tongue.gif:.
Yeah, I actually realised this on my own. the problem was indeed the crafting recipe, and I was just having a brainfart. I think I'll try to use those registry statements for the rest of my block code now. Thanks. Even though I had already figured out the problem, I'll still +1-ing you, just because you wanted to help :smile.gif:
Thanks
- Balthazar
Excuse me sir, but I do seem to be having a bit of a problem.
You see...
I've used your scripts and they're all well and dandy, except for one problem...
My main mod_file says that it is, "Not abstract and does not override abstract method load()in net.minecraft.src.BaseMod" whenever I try to compile it.
Here is the code, if you need it.
package net.minecraft.src;
import java.lang.reflect.Method;
import java.util.*;
public class mod_Test extends BaseMod
{
public void mod_Test()
{
ModLoader.RegisterEntityID(EntityTest.class, "Test", ModLoader.getUniqueEntityId());
ModLoader.AddSpawn(net.minecraft.src.EntityTest.class, 8, 4, 10, EnumCreatureType.creature);
}
public void AddRenderer(Map map)
{
map.put(net.minecraft.src.EntityTest.class, new RenderTest(new ModelTest(), 0.5F));
}
public void load() {}
public String getVersion()
{
return "1.8.1";
}
}
I think that I may need to override the method somehow, but how would I go about doing this?
-EDIT-
Alright, that's fixed. But now my game crashed whenever I try to load the mod, coughing up an, "InstantiationException" error.
Hey i got a question, for the fernflower.jar, where can i get it now that megaupload is down? I really need it to recompile my dimension, everything for the dimension is done, but i need to recompile with the fernflower.jar in my jars folder....please respond ASAP so me and my team can continue working and testing our mod. Thank you.
Hey i got a question, for the fernflower.jar, where can i get it now that megaupload is down? I really need it to recompile my dimension, everything for the dimension is done, but i need to recompile with the fernflower.jar in my jars folder....please respond ASAP so me and my team can continue working and testing our mod. Thank you.
Odd. I've looked at a lot of the tutorials on here, but I haven't seen Fernflower!
DONE!
Divine smoker mod - Hookah in Minecraft: http://www.minecraftforum.net/topic/1689980-172splanspdivine-smoker-water-pipe-modhookahshisha-11/
So my block makes a little creeper proof bunker on a left click, i want to change that to right click, i tried changing the "onblockclicked" thing to rightclick onblockrightclick etc etc, i never got any recompile errors, but i never got any results in game, i rightclicked on it nothing happen, i NEED your help or somone else' check out my mod to see what im doing if you want, also the packing up part, im basically trying to make it a remote base, so that if you rightclick it opens up if you right click on it again it closes i need help their aswell, PLEASE HELP D;
(ive NEVER taken any lessons through school etc for java, ive only learned off of tutorials ;D)
I think you can use interact() or onInteract() but that might just be for entities. Try it anyways.
I will try, thanks!, it said no recompiling errors, as soon as i get in the game same resulsts as everything else nothing happens lol... thanks for trying to help me though! ;D
Use the blockActivated method. Thats the right click one.
Please help me. Realise that all of these classes have been unedited by me, so it should be somewhat easy to tell what the problem is. Thanks
- Balthazar
The problem is that Minecraft has some sort of problem with the ModLoader. Try making a Fresh MCP and porting all of your edited/new classes.
I thought I'd add the cmd reading and the class that seems to have a problem.
CMD:
Thanks,
- Balthazar
P.S. The mod class does say "abstract" yes, but that is because ModLoader's new code requires it to be an abstract class. The public class will no longer work.
I already found your mistake. You must be using a tutorial that is for an older version of minecraft. Because in Minecraft 1.0+ the "Public String Version()" has been changed to "Public String getVersion()". And the "Public Mod Namehere()" has been changed to "Public void load()". If you look in your code spoilers above, I have changed the code to work so just replace your code with the one above. And if your looking to do anything else I suggest adding "import net.minecraft.src.*;" below the "package net.minecraft.src" to be able to use most of the methods minecraft used. +1 me if i helped :tongue.gif:.
Well that didn't help one bit, so I went back into my code, changed the "abstract class" back into "public class" and got no errors, but I get a new crash report on the CMD, which is all about codes which I have not edited. So, could you take a look guys?
Error
OK I FIXED EVERYTHING. CODE IS BELOW.
mod_FirstBlock
The firstID thing means the Block ID.
I changed the way the block is registered. You should use this way next time. To add a block use these statements:
BlockFirst
Pictures:
Texture
Pic of block in-game:
+1 me if i helped :tongue.gif:.
At this part, what exactly do you mean? Could you please clarify it a bit? Do you mean you make one for each tree or only one for all the trees (of course assuming your making more than one tree).
Yeah, I actually realised this on my own. the problem was indeed the crafting recipe, and I was just having a brainfart. I think I'll try to use those registry statements for the rest of my block code now. Thanks. Even though I had already figured out the problem, I'll still +1-ing you, just because you wanted to help :smile.gif:
Thanks
- Balthazar
Excuse me sir, but I do seem to be having a bit of a problem.You see...
I've used your scripts and they're all well and dandy, except for one problem...
My main mod_file says that it is, "Not abstract and does not override abstract method load()in net.minecraft.src.BaseMod" whenever I try to compile it.
Here is the code, if you need it.
I think that I may need to override the method somehow, but how would I go about doing this?-EDIT-
Alright, that's fixed. But now my game crashed whenever I try to load the mod, coughing up an, "InstantiationException" error.
http://www.youtube.com/user/xxmasal22xx
well you could use mediafire