Shadows-of-Fire / Apothic-Attributes

Attributes library for Minecraft, used by Apotheosis.
MIT License
7 stars 9 forks source link

Can't land full-strength attacks if Cold Damage + Fire Damage > target's HP or Current HP Damage ≥ 100% #18

Closed James103 closed 3 months ago

James103 commented 4 months ago

If the value of the attribute "Cold Damage" plus the value of the attribute "Fire Damage" is greater than the mob's health, or if the value of the attribute "Current HP Damage" is greater than 100% (assuming no defense on the target), attempting to land a hit on that mob will cause the hit itself to land at zero strength, preventing critical and sweep attacks from working properly.

To reproduce:

  1. Create a new world.
  2. Summon a renamed slime with 1 HP: summon minecraft:slime ~ ~ ~ {Size:0,CustomName:'"A"'}
  3. Make sure Cold Damage, Fire Damage, and Current HP Damage are all 0.
  4. Try to hit the slime normally.
  5. The attack goes through with the correct attack strength.
  6. Run the command: attribute @s attributeslib:cold_damage base set 2, then summon another slime (step 2).
  7. Try to hit the slime again.
  8. The attack goes through at 0% strength (critical hits and sweeps don't work).
  9. Run the command: attribute @s attributeslib:cold_damage base set 0.
  10. Run the command: attribute @s attributeslib:fire_damage base set 2, then summon another slime (step 2).
  11. Try to hit the slime again.
  12. The attack goes through at 0% strength (critical hits and sweeps don't work).
  13. Run the command: attribute @s attributeslib:fire_damage base set 0
  14. Run the command: attribute @s attributeslib:current_hp_damage base set 1, then find any mob such as a cow, pig, villager, or Iron Golem.
  15. Try to hit that mob.
  16. If the mob had no defense, the attack goes through at 0% strength (critical hits and sweeps don't work)

See also: https://github.com/Shadows-of-Fire/Apothic-Attributes/blob/f2c025fe1ba5a97df72b6f2de005360b9e262eeb/src/main/java/dev/shadowsoffire/attributeslib/impl/AttributeEvents.java#L141

Tested on: Minecraft 1.20.1, Apothic Attributes 1.2.1, Placebo 8.6.1