Fix EffKill failing to kill entities#8505
Open
bluelhf wants to merge 1 commit intoSkriptLang:dev/patchfrom
Open
Fix EffKill failing to kill entities#8505bluelhf wants to merge 1 commit intoSkriptLang:dev/patchfrom
EffKill failing to kill entities#8505bluelhf wants to merge 1 commit intoSkriptLang:dev/patchfrom
Conversation
all damage event listeners process the damage before it is actually processed, so having a "normal" damage value both conveys the wrong meaning and leaves us susceptible to bugs where `EffKill` does not actually kill anything
Member
|
Can you confirm this doesn't apply crazy amounts of durability damage to armor? I don't think it should but better to double check. |
Contributor
Author
It does not, since the It also bypasses resistance, invulnerability (incl. totems of undying), and knockback |
sovdeeth
approved these changes
Mar 17, 2026
1 task
Efnilite
approved these changes
Mar 17, 2026
Member
|
Adding label pending confirmation of the issue being fixed by the reporting user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Currently, using the
killeffect to cause an entity to die does not guarantee that the entity dies. In server versions where damage sources are supported, Skript attempts to deal a high amount of damage (100 hearts plus twice the hearts of the entity being killed). However, if an event listener reduces the damage to a number lower than the entity's health, then the entity does not die.For entities other than players, the effect correctly
remove()s the entity if they fail to die. However, since removing players is not possible (throwsUnsupportedOperationException), they are exempt from this last-ditch effort, and end up not dying at all.The bug, also described in #8441, can be reproduced with this code:
Without this PR, the
/slaycommand does not kill the player. With the addition of this PR,/slaykills the player correctly.Solution
This PR fixes the issue by dealing
Double.POSITIVE_INFINITYdamage instead, which event listeners are more likely to handle correctly.It is impossible to fix the root cause of the problem without changing the Paper API to implement a proper
kill()method that bypasses event listeners. It should be noted that for living entities,/minecraft:killbehaves identically to the new implementation added in this PR.Testing Completed
Verified that the PR fixes the issue using the aforementioned script
Supporting Information
Completes: #8441
Related: none
AI assistance: none