I need some help. I was already making this quick mod for practice before seeing this thread, but I thought I'd ask for help. I'm trying to make a potion, but onItemRightClick isn't working at all. Here's the code:
mod_Potion.java
package net.minecraft.src;
public class mod_Potion extends BaseMod {
public mod_Potion() {
ModLoader.AddName(potion, "Potion");
ModLoader.AddRecipe(new ItemStack(potion, 64), new Object[] {
"X", Character.valueOf('X'), Block.dirt});
potion.iconIndex = ModLoader.addOverride("/gui/items.png", "/gui/potion.png");
}
@Override
public String Version() {
return "1.7.3";
}
public static final Item potion = new Item(97).setItemName("potion");
}
ItemPotion.java
package net.minecraft.src;
public class ItemPotion extends Item {
public ItemPotion(int i) {
super(i); //<<<< Don't know exactly what to put there.
}
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) {
itemstack.stackSize--;
entityplayer.heal(5);
return itemstack;
}
}
Any suggestions? Also, how would I have ItemPotion.java refer to the potion item? I think that might be the problem.
Thanks for the one on trees, who knows, I might use that some day! Good job on the tutorials btw, but you might want to explain what some functions do (not in the mod_ files since those are pretty simple, but the other files you use).
If you are wondering what other types of tutorials you should do or what you can do to make yours better her you go!
Make sure you always explain what the majority of the code does and means. I can understand all of it because i already know how to do it but many people would have trouble using these tutorials. They are still very good though.
You did not finish explaining the code on the tree section you may want to do that especially because the tree code is more complicated than any of the other tutorials you have put up.
Some other tutorial ideas are these:
--How to make custom plants similar to wheat, that grow in stages and have custom drops at each stage.
--How to make custom plants similar to bamboo and cactus that grow stacked on top of each other and also can have custom drops.
--How to make things like custom doors, stairs, slabs, halfblocks, things like those because they require different coding than normal blocks.
--How to make custom chests, furnaces, and crafting tables.
--How to make custom gui using type of block similar to a furnace but can perform different operations.
--How to make a furnace that can smelt only certain blocks.
-How to make a chest that can hold more items than a normal chest.
Those are all i can think of for now but that should give you something to do:). I really love your tutorials because when i was starting out i didnt get much help from more experienced users(they mostly hate helping out newbies) So tutorials are what i used and just reading the code. If you need any help planning out the tutorials just PM me and we can plan some of them out together.
I'm just going to steal some code:
Namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Namehere.png");
Where, as in, what directory, would I place Namehere.png?
in the minecraft.jar same place where you put the actual files. Does that make sense?
Should've noticed, I want to test it using Eclipse; I recall there being a place to just dump these and then it works when you compile from within Eclipse.
Edit: that does make sense yes, but unfortunately, does not apply for me.
If your just testing the code it does not matter where the image is because the code will work if its correct. Its when the code is recompiled and reobfuscated that it will matter where the image is when its place din the minecraft.jar
Ok, this is going to sound dumb, but..... when you add the ModLoader files to the minecraft.jar inside the jars folder, do you delete the META-INF? please reply!
and i also get this error EVERYTIME I install ModLoader when I decompile and then when I try to run the StartClient.batch, it crashes.::
== ERRORS FOUND ==
2 out of 2 hunks FAILED -- saving rejects to file 'net\minecraft\src\RenderBlock
s.#'
==================
Ok, this is going to sound dumb, but..... when you add the ModLoader files to the minecraft.jar inside the jars folder, do you delete the META-INF? please reply!
and i also get this error EVERYTIME I install ModLoader when I decompile and then when I try to run the StartClient.batch, it crashes.::
== ERRORS FOUND ==
2 out of 2 hunks FAILED -- saving rejects to file 'net\minecraft\src\RenderBlock
s.#'
==================
Ok thats the code! hope someone helps me!
That "error" is normal, just disregard it, and you should delete the meta-inf from inside your jars/bin folder in MCP.
mod_Potion.java
ItemPotion.java
Any suggestions? Also, how would I have ItemPotion.java refer to the potion item? I think that might be the problem.
hey could you help me with an error?
here is the topic: http://www.minecraftforum.net/topic/474182-help-growing-block-like-grass/
hope you can help mate :wink.gif:
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
like a dungeon :smile.gif:
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
here is the topic: http://www.minecraftforum.net/topic/474381-help-a-random-error-with-my-tnt-block/
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
Check out my Minecraft Modding Tutorials!
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
I have tried numerous times to get it to work, but it never does. I even used and modified the code from pumkins, furnaces, and pistons. It's no help.
Also, another good advanced block tutorial would be making non-regular blocks (similar idea to pipes from BuildCraft)
Make sure you always explain what the majority of the code does and means. I can understand all of it because i already know how to do it but many people would have trouble using these tutorials. They are still very good though.
You did not finish explaining the code on the tree section you may want to do that especially because the tree code is more complicated than any of the other tutorials you have put up.
Some other tutorial ideas are these:
--How to make custom plants similar to wheat, that grow in stages and have custom drops at each stage.
--How to make custom plants similar to bamboo and cactus that grow stacked on top of each other and also can have custom drops.
--How to make things like custom doors, stairs, slabs, halfblocks, things like those because they require different coding than normal blocks.
--How to make custom chests, furnaces, and crafting tables.
--How to make custom gui using type of block similar to a furnace but can perform different operations.
--How to make a furnace that can smelt only certain blocks.
-How to make a chest that can hold more items than a normal chest.
Those are all i can think of for now but that should give you something to do:). I really love your tutorials because when i was starting out i didnt get much help from more experienced users(they mostly hate helping out newbies) So tutorials are what i used and just reading the code. If you need any help planning out the tutorials just PM me and we can plan some of them out together.
Please post your code and i can help.
in the minecraft.jar same place where you put the actual files. Does that make sense?
If your just testing the code it does not matter where the image is because the code will work if its correct. Its when the code is recompiled and reobfuscated that it will matter where the image is when its place din the minecraft.jar
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
and i also get this error EVERYTIME I install ModLoader when I decompile and then when I try to run the StartClient.batch, it crashes.::
Ok thats the code! hope someone helps me!
That "error" is normal, just disregard it, and you should delete the meta-inf from inside your jars/bin folder in MCP.
Is this true?