diff --git a/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/env/PlayerBasedCastEnv.java b/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/env/PlayerBasedCastEnv.java index 750a48fa2..83e58a818 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/env/PlayerBasedCastEnv.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/env/PlayerBasedCastEnv.java @@ -147,6 +147,9 @@ protected long extractMediaFromInventory(long costLeft, boolean allowOvercast, b double healthToRemove = Math.max(costLeft / mediaToHealth, 0.5); if (simulate) { long simulatedRemovedMedia = Mth.ceil(Math.min(this.caster.getHealth(), healthToRemove) * mediaToHealth); + if (this.caster.isInvulnerableTo(this.caster.damageSources().source(HexDamageTypes.OVERCAST))) { + simulatedRemovedMedia = 0; + } costLeft -= simulatedRemovedMedia; } else { var mediaAbleToCastFromHP = this.caster.getHealth() * mediaToHealth;