Can't understand why it is not working... HitEntity working fine, i also tryed to use spawnParticles in onItemRightClick, it's work, but when hit entity it isn't working!
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) {
par2EntityLivingBase.addPotionEffect(new PotionEffect(Potion.poison.id, 60, 2));
par2EntityLivingBase.worldObj.spawnParticle("lava", par2EntityLivingBase.posX, par2EntityLivingBase.posY, par2EntityLivingBase.posZ, 1.0D, 1.0D, 1.0D);
par1ItemStack.damageItem(1, par2EntityLivingBase);
return true;
}
Mob became poisoned, but particles arent working.
Here all fine:
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
par3EntityPlayer.worldObj.spawnParticle("lava", par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, 1.0D, 1.0D, 1.0D);
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
return par1ItemStack;
}