Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Damage from a falling dripstone is inaccurate #9555

Closed
xKomer opened this issue Jul 31, 2023 · 4 comments
Closed

Damage from a falling dripstone is inaccurate #9555

xKomer opened this issue Jul 31, 2023 · 4 comments
Assignees
Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: bug Something doesn't work as it was intended to. upstream: spigot Issues exists in Spigot.

Comments

@xKomer
Copy link

xKomer commented Jul 31, 2023

Expected behavior

When you wear a helmet in Minecraft, damage from a falling anvil or a falling pointed dripstone should be reduced by 1/4. However, because vanilla Minecraft doesnt reduce the damage by 1/4 since a few version ago (which is not intended, i guess), i at least expected it to be the same amount of damage, when you are wearing only boots and when you are wearing only a helmet.

The first Screenshot is after getting hit by a dripstone while only wearing boots, max Health is 100, so the damage was 11.712 health. Second screenshot is only wearing a helmet and getting the same damage.

Third screenshot is while wearing everything except a helmet and getting 5.1953 damage. Fourth screenshot is wearing everything except for boots and getting 5.1953 damage, too.

Those Screenshots are from my Singleplayer test.

2023-07-31_08 00 18
2023-07-31_08 00 59
2023-07-31_08 01 17
2023-07-31_08 01 43

Observed/Actual behavior

When i tested a plugin, where i wanted to rewrite the damage system of minecraft a little bit, i saw that a I get more damage when I wear a helmet than just boots. But this only happened with pointed Dripstone. Anvils, on the other hand, had the reduced damage that Vanilla minecraft doesnt have anymore. This is a weird behaviour, because i expected anvils and pointed dripstone to be treated exactly the same.

The first Screenshot is after getting hit by a dripstone while only wearing boots, the damage was 11.712. Second screenshot is only wearing a helmet and getting 11.784 damage (0.072 more!)

Third screenshot is while wearing everything except a helmet and getting 5.1953 damage. Fourth screenshot is wearing everything except for boots and getting 6.6424 damage (which is 1.4471 health more damage, nearly a heart!)

Those Screenshots are from my Server. The "What it should be"-damage is what it would be if you first multiplied the damage by 0.75 when wearing a helmet, then applying all of the other rules (damage-reduction by armor). Formula is correct i think, at least it outputs the right damage when getting hit by an anvil.

2023-07-31_07 56 04
2023-07-31_07 55 48
2023-07-31_07 57 19
2023-07-31_07 57 09

Steps/models to reproduce

You dont need a Plugin to test it, because the command "/data get entity " outputs the health of a player too, but a Plugin might be more comfortable. I used a Plugin on the Server and got the damage amount by writing: double finalDamge = EntityDamageEvent.getFinalDamage();

Plugin and Datapack List

Plugins i currently have installed on the server:

villagernomending.jar (Plugin i made myself, preventing Villager from giving the Mending trade)
NotTooExpensive.jar (Plugin to remove the 40 Level limit in the anvil)
Gsit-1.4.6.jar
Graves-4.9.jar
enchantmentsoverhaul.jar (The Plugin i am writing currently, which i tested when finding the bug)

Paper version

git-Paper-97 (MC: 1.20.1)

Other

No response

@xKomer xKomer added status: needs triage type: bug Something doesn't work as it was intended to. labels Jul 31, 2023
@Lulu13022002
Copy link
Contributor

It seems that spigot accidentally fixed the helmet bug that Vanilla introduced (this is handled but a little bit too late to be taken in account for the final health). So that's why you don't get the same damage as vanilla for raw helmet vs boots for all your cases. I don't think it's worth to reintroduce the bug before reworking the damage modifier api.

@Lulu13022002
Copy link
Contributor

Lulu13022002 commented Aug 16, 2023

The reason for the falling dripstone to not behave like the anvil is due to when the damagemodifer are added into the map. If you see where the event is prepared (CraftEventFactory#handleLivingEntityDamageEvent) the DamageModifer.HARD_HAT is not updated for falling stalactite, Bukkit explicitely only allow anvil and falling block to handle the 1/4 reduction instead of checking with the DAMAGES_HELMET type tag (to also include the falling stalactite damage type).

So in reality there are two issues here (one fixed by spigot and another one introduced by spigot (more or less a reintroduction of the vanilla bug for falling stalactite)).

@Lulu13022002 Lulu13022002 added status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. upstream: spigot Issues exists in Spigot. status: unlikely Unlikely to ever be worked on due to complexity or risk version: 1.20 and removed status: needs triage labels Aug 16, 2023
@Lulu13022002
Copy link
Contributor

Good news! The first issue has been fixed on Mojang's end (here: https://bugs.mojang.com/browse/MC-251027). This doesn't fix anything on Spigot since they rewrote the whole logic with the DamageModifier but this is not anymore unlikely to happens before the DamageModifier is gone. Thus the parity would be complete for that type of damage.
So i will fix the remaining issue once 1.20.5 is out.

@Lulu13022002 Lulu13022002 removed the status: unlikely Unlikely to ever be worked on due to complexity or risk label Feb 9, 2024
@Lulu13022002 Lulu13022002 self-assigned this Feb 9, 2024
@Lulu13022002
Copy link
Contributor

Fixed in 0b1b1fe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: bug Something doesn't work as it was intended to. upstream: spigot Issues exists in Spigot.
Projects
Status: Done
Development

No branches or pull requests

3 participants