I am currently working on an item that will poison an entity on hit and I'm not sure why everything I have tried has not worked. I am using this code at the moment, but it does not work:
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving) {
par2EntityLiving.addPotionEffect(new PotionEffect(Potion.poison.id, 200, 1));
return true;
Thanks for Any Help or Suggestions