當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。