EssentialsX / Essentials

The modern Essentials suite for Spigot and Paper.
https://essentialsx.net
GNU General Public License v3.0
1.9k stars 966 forks source link

Fix `/kill` behaving differently to `/minecraft:kill` #5850

Open zp4rker opened 3 days ago

zp4rker commented 3 days ago

Information

This PR fixes #5842.

Details

Proposed fix:

Environments tested:

OS: Windows 11

Java version: Corretto-21.0.3.9.1

Demonstration:
Triggers minecraft:entity_hurt_player which was previously not being triggered as mentioned in #5842 image

CyberFlameGO commented 2 days ago

I thought it intentionally was different to vanilla behavior - this change would also break /kill bypassing god mode iirc

zp4rker commented 2 days ago

Thanks for pointing that out, it does indeed break when in god mode. If older versions had a damage cause, could just use that but doesn't seem they do. Other solution I can think of is to check for Float.MAX_VALUE since I can't think of any example of something other than /kill using that value.