本文整理汇总了Java中net.minecraft.entity.EntityLivingBase.clearActivePotions方法的典型用法代码示例。如果您正苦于以下问题:Java EntityLivingBase.clearActivePotions方法的具体用法?Java EntityLivingBase.clearActivePotions怎么用?Java EntityLivingBase.clearActivePotions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.EntityLivingBase
的用法示例。
在下文中一共展示了EntityLivingBase.clearActivePotions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onItemUseFinish
import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
* Called when the player finishes using this Item (E.g. finishes eating.). Not called when the player stops using
* the Item before the action is complete.
*/
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase entityLiving)
{
if (entityLiving instanceof EntityPlayer && !((EntityPlayer)entityLiving).capabilities.isCreativeMode)
{
stack.func_190918_g(1);
}
if (!worldIn.isRemote)
{
entityLiving.clearActivePotions();
}
if (entityLiving instanceof EntityPlayer)
{
((EntityPlayer)entityLiving).addStat(StatList.getObjectUseStats(this));
}
return stack.func_190926_b() ? new ItemStack(Items.BUCKET) : stack;
}