use of net.minecraft.entity.effect.StatusEffectInstance in project bewitchment by MoriyaShiine.
the class PowerFortune method tick.
@Override
public boolean tick(ServerWorld world, PlayerEntity target) {
if (target.getAttacker() != null) {
target.addStatusEffect(new StatusEffectInstance(StatusEffects.STRENGTH, 600));
target.addStatusEffect(new StatusEffectInstance(StatusEffects.RESISTANCE, 600));
return true;
}
return super.tick(world, target);
}
use of net.minecraft.entity.effect.StatusEffectInstance in project bewitchment by MoriyaShiine.
the class BottleOfBloodItem method finishUsing.
@Override
public ItemStack finishUsing(ItemStack stack, World world, LivingEntity user) {
if (BewitchmentAPI.isVampire(user, true)) {
BWComponents.BLOOD_COMPONENT.get(user).fillBlood(20, false);
} else {
user.addStatusEffect(new StatusEffectInstance(StatusEffects.POISON, 200));
user.addStatusEffect(new StatusEffectInstance(StatusEffects.NAUSEA, 200));
}
return Items.POTION.finishUsing(stack, world, user);
}
use of net.minecraft.entity.effect.StatusEffectInstance in project bewitchment by MoriyaShiine.
the class CourageFortune method tick.
@Override
public boolean tick(ServerWorld world, PlayerEntity target) {
if (target.getAttacker() != null) {
target.addStatusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, 600, 1));
target.addStatusEffect(new StatusEffectInstance(StatusEffects.SPEED, 600, 1));
return true;
}
return super.tick(world, target);
}
use of net.minecraft.entity.effect.StatusEffectInstance in project bewitchment by MoriyaShiine.
the class PurityStatusEffect method applyUpdateEffect.
@Override
public void applyUpdateEffect(LivingEntity entity, int amplifier) {
if (!entity.world.isClient && entity.age % 20 == 0) {
Registry.STATUS_EFFECT.stream().forEach(effect -> {
if (effect.getCategory() == StatusEffectCategory.HARMFUL && entity.hasStatusEffect(effect)) {
StatusEffectInstance currentPurity = entity.getStatusEffect(this);
if (currentPurity != null) {
entity.removeStatusEffect(this);
if (currentPurity.getAmplifier() > 0) {
entity.addStatusEffect(new StatusEffectInstance(this, currentPurity.getDuration(), currentPurity.getAmplifier() - 1, currentPurity.isAmbient(), currentPurity.shouldShowParticles(), currentPurity.shouldShowIcon()));
}
StatusEffectInstance currentNegative = entity.getStatusEffect(effect);
entity.removeStatusEffect(effect);
if (currentNegative.getAmplifier() > 0) {
entity.addStatusEffect(new StatusEffectInstance(effect, currentNegative.getDuration(), currentNegative.getAmplifier() - 1, currentNegative.isAmbient(), currentNegative.shouldShowParticles(), currentNegative.shouldShowIcon()));
}
}
}
});
}
}
use of net.minecraft.entity.effect.StatusEffectInstance in project Therrassium by codeman1o1.
the class TherrassiumBlock method onUse.
@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
if (!world.isClient) {
player.addStatusEffect(new StatusEffectInstance(StatusEffects.NIGHT_VISION, 1200));
player.addStatusEffect(new StatusEffectInstance(StatusEffects.SPEED, 1200));
player.addStatusEffect(new StatusEffectInstance(StatusEffects.JUMP_BOOST, 1200));
player.addStatusEffect(new StatusEffectInstance(StatusEffects.HASTE, 1200));
player.addStatusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, 1200));
player.addStatusEffect(new StatusEffectInstance(StatusEffects.STRENGTH, 1200));
}
return ActionResult.SUCCESS;
}
Aggregations