The bug
When placing slabs very fast, it is possible to place double slabs even though that should not be possible based on the viewing angle of the player.
To reproduce
Set your "Use Item/Place Block" controls setting to a keyboard key
Look straight at a wall
Sneak
Place slabs
→ ❌ Sometimes, double slabs will be placed
Original description
When using a macro to place slabs really fast at eye level, i expected all the slabs to be placed as if i had placed them 1 by 1, creating a floor.
What actually happened was they all became double slabs, even though my cursor was never on the bottom or top of the slabs (this happens for both upper and lower slabs, as well as in the different game modes).
Steps to Reproduce:
1. Align your cursor to place slabs at eye level (top or bottom half works)
2. Click absurdly fast using a macro
3. Voila, a row of double slabs, rather than a row of normal slabs
Code analysis
Code analysis by @unknown in this comment:
In the SlabBlock
class, the getStateForPlacement(...)
method does not check if the click location height matches that of the empty half before making it a double slab.
Linked issues
is duplicated by 1
relates to 1
Attachments
Comments 3
Still happens in 1.17.1. I believe the problem lies in SlabBlock.class in the getStateForPlacement method. When there is a top or bottom slab it doesn't check if the click location y height matches that of the empty half before it makes it a double slab.
Can confirm. I didn't use a macro, but instead used the fact that when you hold down a keyboard key, the action is repeated very fast. So I set "Use Item/Place Block" to a key and was able to reproduce.