
Death block can be bypassed if next to air
mindw0rm opened this issue ยท 1 comments
You can walk on blocks if your position is in the adjacent block but close (< 0.3) to the border, even if this block (the one below) is air.
Imagine the following setup (viewed from above). S is safe, D are death blocks, A is air:
AAAAAAA
SSDDDSS
AAAAAAA
And you start on the left. Now walk towards Air as much as possible, and then along the death blocks to the other side.
You won't get killed, because the block below you is air, but imho you should die, because the block you are actually standing on is the adjacent (death) block.
Of course the same is true if the air blocks would be other safe blocks where you could wlk on. Technically you are already on the death block.
So - either always, or at least if the block below is air - the adjacent blocks should be checked for death blocks if the player position is closer than 0.3 to them (because the base of the player hitbox is 0.6x0.6) and on the ground.
Note that it is quite tricky to determine if the player is standing on ground or in the air: if you jump, but don't move, the distance to the block below will be approx. 0.1213 (fun fact: if the block below is a bed, it's even more (slightly below 0.24)) and only drop to 0 if you move - at least that was true with 1.15.2 or 1.16.1, which was the current version when I stumbled upon that fact.
This might be even more if you are standing on a carpet or something like that ...
Tested on both 5.3 and 6.2.
This has been implemented in the pending 7.0.0 release.
An improvement was made to detect when Players are floating next to a death block.
This isn't perfect as when a Player is on the corner of a death block they can still be bypassed, but this at least prevents the Player from walking alongside them.