Skip to content

Commit

Permalink
fix: fix Injector not dealing damage before affecting the target with…
Browse files Browse the repository at this point in the history
… the serum
  • Loading branch information
Elenterius committed Jun 16, 2023
1 parent 67691f0 commit 07f1906
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ public static void performScheduledSerumInjection(ServerLevel level, InjectorIte
return;
}

if (stack.getEnchantmentLevel(ModEnchantments.ANESTHETIC.get()) <= 0) {
target.hurt(new EntityDamageSource("sting", player), 0.5f);
}

if (host == victim) {
serum.affectPlayerSelf(Serum.getDataTag(stack), player);
}
Expand All @@ -72,10 +76,6 @@ public static void performScheduledSerumInjection(ServerLevel level, InjectorIte

injector.consumeSerum(stack, player);
stack.hurtAndBreak(1, player, p -> p.broadcastBreakEvent(EquipmentSlot.MAINHAND));

if (stack.getEnchantmentLevel(ModEnchantments.ANESTHETIC.get()) <= 0) {
target.hurt(new EntityDamageSource("sting", player), 0.5f);
}
}
}
}

0 comments on commit 07f1906

Please sign in to comment.