After some discussion, we decided that this was something worth adding. However, coding it turned out to be quite a challenge, as the thing we call “sneak" literally had a whole 26 different meanings in Minecraft. This included things such as dimming your nametag, stopping you from sliding down a ladder, and dismounting you from a horse or minecart – and that's just naming a few!
All these things were lumped together and connected to the shift key, which made it really hard to work with. It also raised many questions such as; If you press shift to sneak under a slab, what exactly should happen when you release shift? If you are under a slab and not holding shift, should you move normally or slowly? Are you technically sneaking or not? What does sneaking even mean?
These questions, including the many different definitions, finally led us to the decision to eliminate "sneaking" as a concept in the code. It was a pretty big undertaking as a technical change and involved disentangling all the different behaviors from each other, to make it possible to configure each behavior separately.
There, that’s the story of how we learned how to crouch under slabs! Oh wait, this article was supposed to be about crawling? Fair enough, let’s continue…
From crouch to crawl
After fixing the crouching problem, we noticed a related issue that affected swimming. When you swim in Minecraft, your character is placed in a horizontal position, and as soon as you exit water, your pose switches back to vertical. But swimming into a one block high space now resulted in a visual glitch that made the character’s head stick up above a block.
Compartilhe esta história