This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
package mod.RPGMyths; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntitySmallFireball; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Vec3; import net.minecraft.world.World; public class wandSFire extends Item { public String getTextureFile () { return CommonProxy.ITEMS_PNG; } public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { if (!world.isRemote) { Vec3 look = entityplayer.getLookVec(); EntitySmallFireball fireball2 = new EntitySmallFireball(world, entityplayer, 1, 1, 1); fireball2.setPosition( entityplayer.posX + look.xCoord * 1, entityplayer.posY + look.yCoord * 1, entityplayer.posZ + look.zCoord * 1); fireball2.accelerationX = look.xCoord * 0.1; fireball2.accelerationY = look.yCoord * 0.1; fireball2.accelerationZ = look.zCoord * 0.1; world.spawnEntityInWorld(fireball2); } return itemstack; } public wandSFire(int id) { super(id); // Constructor Configuration setMaxStackSize(1); setCreativeTab(mod_RPGMyths.RPGMythsTab); setItemName("wandSFire"); } }
itemstack.damageItem(1, entityplayer);
Quote from TechGuy543 Use setMaxDamage(int) in the constructor. Then in the onItemRightClick method use itemstack.damageItem(1, entityplayer);
Quote from TekZappa Do you know how i can make for example a broken tool, when ItemDamage = 0 the pickaxe turns into a broken pickaxe?
if(item.getItemDamage() >= 0) { item = new ItemStack(Mod.brokenPickThingyHere, 1, 0); }
It says "itemstack cannot be resolved"
How do I fix this?
Here is the code i want it to be implemented in:
If you can help that's be awesome
together they are powerful beyond imagination."
Okay ill try that now and by the way I used to love your modloader tutorials
edit- it worked thanks a lot 1+ for you
It says "itemstack cannot be resolved"
How do I fix this?