Hello and sry for my silly questions.
I want to add a effect on my Item if I hold it.
But I everytime i get the effect if it just in the inventory...
How can I fix it?
(This is a Code I've used in 1.6 but I deleted some code in it to fix errors... this is maybe the problem..)
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
{
EntityPlayer Player = (EntityPlayer) entity;
if(Player.getCurrentEquippedItem() !=null)
{
Player.addPotionEffect((new PotionEffect(Potion.fireResistance.getId(), 25, 0)));
}
else
{
Player.curePotionEffects(itemstack);
}
}
I've changed this:
if(Player.getCurrentEquippedItem() !=null && Player.getCurrentEquippedItem().itemID == this.itemID
To this:
if(Player.getCurrentEquippedItem() !=null)
How can I replace .itemID?