So anyways, I'm relatively new to modding and so I just need some help.
The mod is supposed to create fire but I'm not really sure how to do that.
Everything works fine except the fire part of the mod.
Class Files:
mod_firebook:
package net.minecraft.src;
public class mod_firebook extends BaseMod
{
public static final Item ItemFireBook = new Item(3000).setItemName("firebookItem");
The mod is supposed to create fire but I'm not really sure how to do that.
Everything works fine except the fire part of the mod.
Class Files:
mod_firebook:
public class mod_firebook extends BaseMod
{
public static final Item ItemFireBook = new Item(3000).setItemName("firebookItem");
public mod_firebook()
{
ModLoader.AddName(ItemFireBook, "Inferno Spell");
ItemFireBook.iconIndex = ModLoader.addOverride("/gui/items.png", "/spells/firebook.png");
ModLoader.AddRecipe(new ItemStack(ItemFireBook, 1), new Object[] {
"CCC", "CXC", "CCC", Character.valueOf('X'), Item.book, Character.valueOf('C'), Item.coal
});
}
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
{
if(l == 0)
{
j--;
}
if(l == 1)
{
j++;
}
if(l == 2)
{
k--;
}
if(l == 3)
{
k++;
}
if(l == 4)
{
i--;
}
if(l == 5)
{
i++;
}
int i1 = world.getBlockId(i, j, k);
if(i1 == 0)
{
world.playSoundEffect((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, "fire.ignite", 1.0F, Item.itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlockWithNotify(i, j, k, Block.fire.blockID);
}
itemstack.damageItem(1, entityplayer);
return true;
}
@Override
public String Version() {
// TODO Auto-generated method stub
return "1.7.3";
}
}
public class ItemFireBook extends Item {
public ItemFireBook (int i)
{
super(i);
maxStackSize = 1;
}
}
Thanks to anyone that helps!
Bump.