当前位置: 首页>>代码示例>>Java>>正文


Java EntityLivingBase.removePotionEffect方法代码示例

本文整理汇总了Java中net.minecraft.entity.EntityLivingBase.removePotionEffect方法的典型用法代码示例。如果您正苦于以下问题:Java EntityLivingBase.removePotionEffect方法的具体用法?Java EntityLivingBase.removePotionEffect怎么用?Java EntityLivingBase.removePotionEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.EntityLivingBase的用法示例。


在下文中一共展示了EntityLivingBase.removePotionEffect方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onItemUse

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@SubscribeEvent
public void onItemUse(LivingEntityUseItemEvent event)
{
    EntityLivingBase living = event.getEntityLiving();
    ItemStack stack = event.getItem();
    PotionEffect effect = living.getActivePotionEffect(this);

    if(ItemUtil.matchesOreDict(stack,"torch") && effect != null)
    {
        //TODO: Blow a cloud of fire out
        if(effect.getDuration() > 10)
        {
            PotionEffect reducedEffect = new PotionEffect(this, effect.getDuration() - 5, effect.getAmplifier(), effect.getIsAmbient(), effect.doesShowParticles());
            reducedEffect.setCurativeItems(effect.getCurativeItems());
            living.addPotionEffect(reducedEffect);
        }
        else
        {
            living.removePotionEffect(this);
        }
    }
}
 
开发者ID:DaedalusGame,项目名称:Soot,代码行数:23,代码来源:PotionFireLung.java

示例2: onWornTick

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@Override
public void onWornTick(ItemStack itemstack, EntityLivingBase player) {
	if (itemstack.getItemDamage() == 0 && player.ticksExisted % 40 == 0) {
		if (player.getActivePotionEffect(MobEffects.UNLUCK) != null) {
			player.removePotionEffect(MobEffects.UNLUCK);
		}
	}
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:9,代码来源:ItemNazar.java

示例3: onLivingUpdate

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@SubscribeEvent
public void onLivingUpdate(LivingEvent.LivingUpdateEvent event) {
    EntityLivingBase living = event.getEntityLiving();
    if(living.equals(MC.player)) {
        living.setInvisible(false);
        living.removePotionEffect(MobEffects.NAUSEA);
        living.removePotionEffect(MobEffects.INVISIBILITY);
        living.removePotionEffect(MobEffects.BLINDNESS);
        // removes particle effect
        FastReflection.Methods.EntityLivingBase_resetPotionEffectMetadata.invoke(living);
    } else if(no_particles.get()) {
        living.setInvisible(false);
        FastReflection.Methods.EntityLivingBase_resetPotionEffectMetadata.invoke(living);
    }
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:16,代码来源:AntiEffectsMod.java

示例4: apply

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@Override
public boolean apply(Vec3d location, EntityLivingBase activator, AbilityContext context) {
    if (context.getType() == AbilityType.ARMOR_PASSIVE) {
        activator.removePotionEffect(this.potion);
        activator.addPotionEffect(new PotionEffect(this.potion, this.ticks, this.amplifier, false, false));
    } else if (context.getType() == AbilityType.ARMOR_ACTIVE) {
        this.addEffect(context.getAttacker());
    } else if (context.hasTarget()) {
        this.addEffect(context.getTarget());
    }

    return true;
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:14,代码来源:PotionEffectAbility.java

示例5: remove

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@Override
public void remove(Vec3d location, EntityLivingBase activator, AbilityContext context) {
    if (context.getType() == AbilityType.ARMOR_PASSIVE) {
        activator.removePotionEffect(this.potion);
    } else if (context.getType() == AbilityType.ARMOR_ACTIVE) {
        context.getAttacker().removePotionEffect(this.potion);
    } else if (context.hasTarget()) {
        context.getTarget().removePotionEffect(this.potion);
    }
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:11,代码来源:PotionEffectAbility.java

示例6: addEffect

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
private void addEffect(EntityLivingBase entity) {
    entity.removePotionEffect(this.potion);
    entity.addPotionEffect(new PotionEffect(this.potion, this.ticks, this.amplifier));
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:5,代码来源:PotionEffectAbility.java

示例7: holster

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@Override
public void holster(WeaponsCapability cap, ItemStack stack, EntityLivingBase living, World world) {
	cap.setHealTarget(-1);
	living.removePotionEffect(TF2weapons.uber);
	super.holster(cap, stack, living, world);
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:7,代码来源:ItemMedigun.java


注:本文中的net.minecraft.entity.EntityLivingBase.removePotionEffect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。