it dont matter now I got it.
I had to point my workspace to Eclipse rather than Forge Folder. Derp!
No double posting. If you have something else to say edit your original post. Edit what your second post into your first post, and report the second post using the report button and say "this is a double post" so a mod will be notified and delete it. Glad you figured it out though!
Rollback Post to RevisionRollBack
"The signature should be a place of thought and power, with images and personalities, not an advertising banner"
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
So I tried to create a random generator to randomize the amount of damage a sword does.
//random gen
Random rand = new Random();
static int [] randArray; {
randArray[0] = rand.nextInt(100) + 1;
randArray[1] = rand.nextInt(100) + 1;
randArray[2] = rand.nextInt(100) + 1;
randArray[3] = rand.nextInt(100) + 1;
randArray[4] = rand.nextInt(100) + 1;
}
static int swordDmg = randArray[0];
//enum for sword/tools
public static EnumToolMaterial sword = EnumHelper.addToolMaterial("sword", 3, 9001, 100.0F, swordDmg, 15); //The material
Eclipse does not report any errors, but but minecraft crashes. It didn't even crash to report a crash log, so i copy from eclipse console.
2013-02-11 19:14:07 [INFO] [ForgeModLoader] Forge Mod Loader version 4.7.4.520 for Minecraft 1.4.7 loading
2013-02-11 19:14:09 [INFO] [STDOUT] 27 achievements
2013-02-11 19:14:09 [INFO] [STDOUT] 210 recipes
2013-02-11 19:14:09 [INFO] [STDOUT] Setting user: Player368, -
2013-02-11 19:14:09 [INFO] [STDERR] Client asked for parameter: server
2013-02-11 19:14:09 [INFO] [STDOUT] LWJGL Version: 2.4.2
2013-02-11 19:14:09 [INFO] [ForgeModLoader] Attempting early MinecraftForge initialization
2013-02-11 19:14:09 [INFO] [STDOUT] MinecraftForge v6.6.0.497 Initialized
2013-02-11 19:14:09 [INFO] [ForgeModLoader] MinecraftForge v6.6.0.497 Initialized
2013-02-11 19:14:09 [INFO] [STDOUT] Replaced 84 ore recipies
2013-02-11 19:14:09 [INFO] [ForgeModLoader] Completed early MinecraftForge initialization
2013-02-11 19:14:09 [INFO] [ForgeModLoader] Searching C:\Users\Brian\Desktop\MinecraftCoding\forge\mcp\jars\mods for mods
2013-02-11 19:14:10 [INFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load
2013-02-11 19:14:10 [INFO] [STDERR] Exception in thread "Minecraft main thread" java.lang.ExceptionInInitializerError
2013-02-11 19:14:10 [INFO] [STDERR] at java.lang.Class.forName0(Native Method)
2013-02-11 19:14:10 [INFO] [STDERR] at java.lang.Class.forName(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:416)
2013-02-11 19:14:10 [INFO] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-02-11 19:14:10 [INFO] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:268)
2013-02-11 19:14:10 [INFO] [STDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:140)
2013-02-11 19:14:10 [INFO] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-02-11 19:14:10 [INFO] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:268)
2013-02-11 19:14:10 [INFO] [STDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:83)
2013-02-11 19:14:10 [INFO] [STDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:479)
2013-02-11 19:14:10 [INFO] [STDERR] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:161)
2013-02-11 19:14:10 [INFO] [STDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:410)
2013-02-11 19:14:10 [INFO] [STDERR] at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
2013-02-11 19:14:10 [INFO] [STDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:744)
2013-02-11 19:14:10 [INFO] [STDERR] at java.lang.Thread.run(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] Caused by: java.lang.NullPointerException
2013-02-11 19:14:10 [INFO] [STDERR] at bhavik.gypsycraft.GypsyCraft.<init>(GypsyCraft.java:79)
2013-02-11 19:14:10 [INFO] [STDERR] at bhavik.gypsycraft.GypsyCraft.<clinit>(GypsyCraft.java:56)
2013-02-11 19:14:10 [INFO] [STDERR] ... 29 more
Edit: I figured it out. I need to learn array's better . On the other hand, how do I make it change when you hit an entity?
OH YEAH Deverion can you do when you hit something it plays a sound so I can annoy the heck out of my friends? XD
Rollback Post to RevisionRollBack
"The signature should be a place of thought and power, with images and personalities, not an advertising banner"
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
Hey I have been trying to make my Ore only work with diamond and above pickaxes but I can't seem to make it work. It still lets me get back the ore with a wooden pick. Can anyone help?
Hey I have been trying to make my Ore only work with diamond and above pickaxes but I can't seem to make it work. It still lets me get back the ore with a wooden pick. Can anyone help?
Should be:
MinecraftForge.setBlockHarvestLevel(techOre, "pickaxe", 3);
Watch your caps they need to be right for everything to work. You had too many args and the last argument should be a 3 for it to only be harvested with diamond tools.
Just wanted to say that I tried your custom sword tutorial and everything worked great, but I could not enchant the sword no matter what I did. I found out from other posts on the subject that the sword needs to extend the ItemSword class instead of Item class in order for the game to recognize it as a sword. It was only a few lines that needed to be changed to make it work and it started working fine after that. Has anyone had any similar issues or ideas on the subject? I would like to make the custom tools and be able to enchant them but they also are extending the "item" class and I am afraid it will have a similar result as with the sword (but there is just too much code in the custom tool classes for me to figure out how to change it everything else still working)
Just wanted to say that I tried your custom sword tutorial and everything worked great, but I could not enchant the sword no matter what I did. I found out from other posts on the subject that the sword needs to extend the ItemSword class instead of Item class in order for the game to recognize it as a sword. It was only a few lines that needed to be changed to make it work and it started working fine after that. Has anyone had any similar issues or ideas on the subject? I would like to make the custom tools and be able to enchant them but they also are extending the "item" class and I am afraid it will have a similar result as with the sword (but there is just too much code in the custom tool classes for me to figure out how to change it everything else still working)
Yeah I was having the same problem! Your solution worked. Thanks!
Rollback Post to RevisionRollBack
"The signature should be a place of thought and power, with images and personalities, not an advertising banner"
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
Just wanted to say that I tried your custom sword tutorial and everything worked great, but I could not enchant the sword no matter what I did. I found out from other posts on the subject that the sword needs to extend the ItemSword class instead of Item class in order for the game to recognize it as a sword. It was only a few lines that needed to be changed to make it work and it started working fine after that. Has anyone had any similar issues or ideas on the subject? I would like to make the custom tools and be able to enchant them but they also are extending the "item" class and I am afraid it will have a similar result as with the sword (but there is just too much code in the custom tool classes for me to figure out how to change it everything else still working)
The type of item that can be enchanted is declared in the enchantment, not the item
Should be:
MinecraftForge.setBlockHarvestLevel(techOre, "pickaxe", 3);
Watch your caps they need to be right for everything to work. You had too many args and the last argument should be a 3 for it to only be harvested with diamond tools.
Config tutorial is up, and I have the sudden urge to make a flowers tutorial next
yay! implemented your config. I think that there should be something to catch errors (cuz adding all those items and stuff can mean typos) so maybe add a try{config.load and all other config stuff,catch{exception}, finally{config.save} block to catch errors.
also, i was looking through your tutorials, and I think you should put the config tutorial under the items and blocks, because people should realize a config is necessary to releasing a mod!
Rollback Post to RevisionRollBack
"The signature should be a place of thought and power, with images and personalities, not an advertising banner"
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
yay! implemented your config. I think that there should be something to catch errors (cuz adding all those items and stuff can mean typos) so maybe add a try{config.load and all other config stuff,catch{exception}, finally{config.save} block to catch errors.
also, i was looking through your tutorials, and I think you should put the config tutorial under the items and blocks, because people should realize a config is necessary to releasing a mod!
1) Typos will only be a problem if you aren't using eclipse
2) Good idea, will do Take a look, I made an extremely inelegant and effective way of telling people to do this
Hey thanks for the great tutorials. Just got done making custom food items was thinking that would be a really easy tutorial for you to add some day. Can't wait to see armor tutorial! Thanks again!
Yay config tutorial!
No double posting. If you have something else to say edit your original post. Edit what your second post into your first post, and report the second post using the report button and say "this is a double post" so a mod will be notified and delete it. Glad you figured it out though!
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
Also in step one, you ought to tell people they need the Java JDK.
I guess it's kinda obvious but that's just my opinion.
Eclipse does not report any errors, but but minecraft crashes. It didn't even crash to report a crash log, so i copy from eclipse console.
2013-02-11 19:14:07 [INFO] [ForgeModLoader] Forge Mod Loader version 4.7.4.520 for Minecraft 1.4.7 loading
2013-02-11 19:14:09 [INFO] [STDOUT] 27 achievements
2013-02-11 19:14:09 [INFO] [STDOUT] 210 recipes
2013-02-11 19:14:09 [INFO] [STDOUT] Setting user: Player368, -
2013-02-11 19:14:09 [INFO] [STDERR] Client asked for parameter: server
2013-02-11 19:14:09 [INFO] [STDOUT] LWJGL Version: 2.4.2
2013-02-11 19:14:09 [INFO] [ForgeModLoader] Attempting early MinecraftForge initialization
2013-02-11 19:14:09 [INFO] [STDOUT] MinecraftForge v6.6.0.497 Initialized
2013-02-11 19:14:09 [INFO] [ForgeModLoader] MinecraftForge v6.6.0.497 Initialized
2013-02-11 19:14:09 [INFO] [STDOUT] Replaced 84 ore recipies
2013-02-11 19:14:09 [INFO] [ForgeModLoader] Completed early MinecraftForge initialization
2013-02-11 19:14:09 [INFO] [ForgeModLoader] Searching C:\Users\Brian\Desktop\MinecraftCoding\forge\mcp\jars\mods for mods
2013-02-11 19:14:10 [INFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load
2013-02-11 19:14:10 [INFO] [STDERR] Exception in thread "Minecraft main thread" java.lang.ExceptionInInitializerError
2013-02-11 19:14:10 [INFO] [STDERR] at java.lang.Class.forName0(Native Method)
2013-02-11 19:14:10 [INFO] [STDERR] at java.lang.Class.forName(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:416)
2013-02-11 19:14:10 [INFO] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-02-11 19:14:10 [INFO] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:268)
2013-02-11 19:14:10 [INFO] [STDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:140)
2013-02-11 19:14:10 [INFO] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-02-11 19:14:10 [INFO] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
2013-02-11 19:14:10 [INFO] [STDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:268)
2013-02-11 19:14:10 [INFO] [STDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:83)
2013-02-11 19:14:10 [INFO] [STDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:479)
2013-02-11 19:14:10 [INFO] [STDERR] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:161)
2013-02-11 19:14:10 [INFO] [STDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:410)
2013-02-11 19:14:10 [INFO] [STDERR] at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
2013-02-11 19:14:10 [INFO] [STDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:744)
2013-02-11 19:14:10 [INFO] [STDERR] at java.lang.Thread.run(Unknown Source)
2013-02-11 19:14:10 [INFO] [STDERR] Caused by: java.lang.NullPointerException
2013-02-11 19:14:10 [INFO] [STDERR] at bhavik.gypsycraft.GypsyCraft.<init>(GypsyCraft.java:79)
2013-02-11 19:14:10 [INFO] [STDERR] at bhavik.gypsycraft.GypsyCraft.<clinit>(GypsyCraft.java:56)
2013-02-11 19:14:10 [INFO] [STDERR] ... 29 more
Edit: I figured it out. I need to learn array's better . On the other hand, how do I make it change when you hit an entity?
OH YEAH Deverion can you do when you hit something it plays a sound so I can annoy the heck out of my friends? XD
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
Try making the numbers higher, that might fix it
1) Hmm, not sure why that is...
2) These tutorials assume at least a basic knowledge of java, which includes JDK...
1) In getDamageVsEntity, return YouMod,randArray[rand.nextInt(5)]
2) Definitely going to look into that! Then I'll make a squeaky hammer xD
MinecraftForge.setBlockHarvestLevel(TechOre, 3, "Pickaxe", 2);
Am I doing this right?
Should be:
MinecraftForge.setBlockHarvestLevel(techOre, "pickaxe", 3);
Watch your caps they need to be right for everything to work. You had too many args and the last argument should be a 3 for it to only be harvested with diamond tools.
Yeah I was having the same problem! Your solution worked. Thanks!
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
Welcome, glad it helped
The type of item that can be enchanted is declared in the enchantment, not the item
I will be doing a tutorial on that, but in the mean time, just check out the code for fences
EDIT:
I'll change the sword tut now to work
Dude this worked perfectly thanks man.
You can have the second parameter if you're working with metadata, but the problem was that you had "Pickaxe" and only 2 at the end
Get Eclipse Juno Classic
I'll do armor soon
yay! implemented your config. I think that there should be something to catch errors (cuz adding all those items and stuff can mean typos) so maybe add a try{config.load and all other config stuff,catch{exception}, finally{config.save} block to catch errors.
also, i was looking through your tutorials, and I think you should put the config tutorial under the items and blocks, because people should realize a config is necessary to releasing a mod!
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
1) Typos will only be a problem if you aren't using eclipse
2)
Good idea, will doTake a look, I made an extremely inelegant and effective way of telling people to do thisTake a look at the hoe in the tool tutorial, then give your item a max damage of 1, and call itemstack.damageItem(1,entityPlayer) in onItemUse
ALSO: I messed up the config tutorial, all of the tools are ItemTutorialSword, will fix!