I need some help. I already made a thread about this, but I still haven't solved the problem and I didn't want to bump too much. 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;
}
}
I'm pretty sure it might be because the ItemPotion file isn't referring to the mod_Potion file. How would I do that, anyway?
mod_Potion.java
ItemPotion.java
I'm pretty sure it might be because the ItemPotion file isn't referring to the mod_Potion file. How would I do that, anyway?
I have been. Unfortunately, I wasn't able to find anything that resolves my problem. I'll keep looking, though.
Apparently, it wasn't working because here:
I'm supposed to put:
Well, that was fun...