use of net.minecraft.entity.effect.StatusEffectInstance in project Neutrino by FrostWizard4.
the class PlayerEntityMixin method neutrino$tickWitherTanzanite.
@Inject(at = @At("HEAD"), method = "tick()V")
private void neutrino$tickWitherTanzanite(CallbackInfo ci) {
if (this.hasStatusEffect(StatusEffects.WITHER)) {
if (this.inventory.getArmorStack(0).isOf(ItemRegistry.JEWELED_DIAMOND_BOOTS) && this.inventory.getArmorStack(1).isOf(ItemRegistry.JEWELED_DIAMOND_LEGGINGS) && this.inventory.getArmorStack(2).isOf(ItemRegistry.JEWELED_DIAMOND_CHESTPLATE) && this.inventory.getArmorStack(3).isOf(ItemRegistry.JEWELED_DIAMOND_HELMET)) {
int duration = this.getStatusEffect(StatusEffects.WITHER).getDuration();
int amplifier = this.getStatusEffect(StatusEffects.WITHER).getAmplifier();
this.removeStatusEffect(StatusEffects.WITHER);
this.addStatusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, duration, amplifier));
}
}
if (this.isOnFire() && (this.inventory.getArmorStack(0).isOf(ItemRegistry.JEWELED_DIAMOND_BOOTS) || this.inventory.getArmorStack(1).isOf(ItemRegistry.JEWELED_DIAMOND_LEGGINGS) || this.inventory.getArmorStack(2).isOf(ItemRegistry.JEWELED_DIAMOND_CHESTPLATE) || this.inventory.getArmorStack(3).isOf(ItemRegistry.JEWELED_DIAMOND_HELMET))) {
this.damage(DamageSource.ON_FIRE, 0.5F);
}
if (this.getDamageTracker().wasRecentlyAttacked() && this.getDamageTracker().getMostRecentDamage() != null && this.getDamageTracker().getMostRecentDamage().getDamageSource().isMagic()) {
this.heal(this.getDamageTracker().getMostRecentDamage().getDamage() - (this.getDamageTracker().getMostRecentDamage().getDamage() / 2));
}
}
use of net.minecraft.entity.effect.StatusEffectInstance in project Neutrino by FrostWizard4.
the class GoatHorn method use.
@Override
public TypedActionResult<ItemStack> use(World world, PlayerEntity playerEntity, Hand hand) {
// Play Sound
playerEntity.playSound(WAR_HORN_USE, 1.0F, 1.0F);
// Apply Effects
for (Entity e : world.getOtherEntities(playerEntity, Box.of(playerEntity.getPos(), 10, 10, 10))) {
if (e instanceof MobEntity) {
if (playerEntity.distanceTo(e) < 10) {
((MobEntity) e).addStatusEffect(new StatusEffectInstance(StatusEffects.WEAKNESS, 250, 2));
}
}
}
// Set 20 second Cooldown
playerEntity.getItemCooldownManager().set(ItemRegistry.GOAT_HORN, 400);
return TypedActionResult.success(playerEntity.getStackInHand(hand));
}
use of net.minecraft.entity.effect.StatusEffectInstance in project Neutrino by FrostWizard4.
the class DaturaBlade method postHit.
@Override
public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) {
target.addStatusEffect(new StatusEffectInstance(StatusEffects.POISON, 300));
stack.damage(1, attacker, (e) -> e.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND));
return true;
}
use of net.minecraft.entity.effect.StatusEffectInstance in project Neutrino by FrostWizard4.
the class UpdraftTomeArtifact method use.
@Override
public TypedActionResult<ItemStack> use(World world, PlayerEntity playerEntity, Hand hand) {
// Play Sound
playerEntity.playSound(UPDRAFT_TOME_ACTIVATE, 1.0F, 1.0F);
// Add Levitation
for (Entity e : world.getOtherEntities(playerEntity, Box.of(playerEntity.getPos(), 10, 10, 10))) {
if (e instanceof MobEntity) {
if (playerEntity.distanceTo(e) < 10) {
((MobEntity) e).addStatusEffect(new StatusEffectInstance(StatusEffects.LEVITATION, 20, 15));
}
}
}
// Set 10 second Cooldown
playerEntity.getItemCooldownManager().set(ItemRegistry.UPDRAFT_TOME, 200);
return TypedActionResult.success(playerEntity.getStackInHand(hand));
}
Aggregations