Home Why Minecraft's 12 block piston limit exists
Post
Cancel

Why Minecraft's 12 block piston limit exists

For those that don’t know, I’ve been playing Minecraft for over 5 years and I enjoy creating nonsense in Java to add random little features for Minecraft servers. This time, I took things a little too far by trying to go beyond the limits of regular Minecraft.

Spigot is the most popular modified Minecraft server software (probably) in the world. Even though in the past it has had it’s difficulties due to legal issues (CraftBukkit and the DCMA takedown), it has certainly made a name for itself for being a much better performing server compared to CraftBukkit (another modified Minecraft software). Due to the DMCA takedown, Spigot created a project known as BuildTools which allows anyone to compile Spigot on their own computer.

As people can compile a copy of Spigot on their own computer, it is possible to create “patches” which are inserted during the compilation stage to modify the features of the Minecraft server. By creating patches of my own, I am able to modify the piston limit of 12 blocks to whatever number of my choosing. I had attained this idea from YouTuber Mumbo Jumbo, where in a video, he mentioned that his projects had to form to the constraints of Minecraft (in particular, the 12 block piston limit).

After creating my custom patch, (which modifies the PistonExtendsChecker class), I start up a little testing server to play around with this custom Spigot build of mine. I start simple, letting the piston limit be 30 blocks (not going too wild, I don’t want to crash the server now) and I test it by pushing a line of 30 blocks. Surprisingly, it works! It really works!! Of course, now all we have to do is ramp up the number and keep playing around to see where the limitations of the piston limit lies! Of course, there’s only a small graphical glitch where instead of appearing that the block moves between one place and another, it just disappears for a split second and appears where it should (I assume this graphical issue is purely client side).

I change the value of the piston limit to 1000 and create a 5x5 hollow tower out of slime blocks, about 30 blocks in height (I don’t really know how slime blocks work, all I know is that if you put slime blocks next to each other, it’ll allow you to pull and push them at will). I place a piston underneath the tower and give it power. Surprise, surprise, the single pathetic little piston that would normally only push 12 blocks was able to push an entire tower upwards by one block. But how large can we get?

I change the piston limit to 65000 (roughly the number of blocks in a chunk (16 x 16 x 256)). Since I was in a flat world (4 blocks deep), I replaced a chunk with only slime blocks (using good old WorldEdit), giving me a total of 1024 movable blocks (technically, 1216 movable blocks when you count the sides). I place a sticky piston above, power it with a lever and then flick the lever. Of course, without fail, the floor raises one block. At this point, I began to get bored - I could tell that the piston limit was working (I was surprised that this would even work in the first place), so let’s take things to the max already.

Using WorldEdit, I create a solid 16 x 16 x 246 cuboid of slime blocks and place a piston under it. Just one little flick of a lever is all it takes to pull this monstrosity down a block. I create a mental countdown: 3, 2, 1… The piston head moves down. The cuboid of slime blocks remains in the air. As far as I was concerned, the computer was just busy trying to do all of the calculations necessary to pull this obstacle down. A minute goes by. The server is still running (commands don’t work, but I can still walk around). I’m sure the computer just needs more time - I’ve got an Intel Core i5 processor and 8GB of RAM, it’ll be fine…

The server dies. To be expected I guess. Nobody in their right mind would try to pull 62,976 blocks with a single piston. Or rather, one person in their right mind would try to pull 62,976 blocks with a single piston. At this point, I would normally turn down the piston limit and, since I know it works, continue programming with something else - probably creating some other patch to play around with. But oh no. Abnormal piston mechanics seem to have caught my attention more than anything else. It’s time to make a flying machine.

Since I don’t know the slightest thing about flying machines, instead of looking at the wiki page (which is probably the better option), I just look up some simple video and chain a tonne of slime blocks to the end. I make a flying machine powered fortress and let it fly into the sunset (however, due to the weird “graphical glitch”, I fall through the machine).

After all of that experimentation, I think I’ll stick to Mojang’s decision of a 12 block piston limit, for my computer’s sake.

This post is licensed under CC BY 4.0 by the author.

It's all gone wrong

Programming for non-programmers