This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
import java.util.Random; public class ItemFireRock extends Item { public ItemFireRock(int i) { super(i); maxStackSize = 1; setMaxDamage(384); } public int getMaxItemUseDuration(ItemStack itemstack) { return 0x11940; } public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { EntityFireball entityfireball = new EntityFireball(world, entityplayer, 0.9F, 1, 1); itemstack.damageItem(1, entityplayer); world.playSoundAtEntity(entityplayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + 0.5F); if (!world.isRemote) { world.spawnEntityInWorld(entityfireball); } return itemstack; } }
shooting an entity from an item thats not a bow