Tutorials/Zero-ticking

This tutorial seeks to teach the player how to make a redstone signal turn on and off in the same gametick, go over how this could be used, particularly with its uses on pistons.

Introduction
When a redstone signal is sent through a pulse limiter, it shortens the pulse. When the pulse is shortened enough, strange behaviors arise. If a sticky piston is powered by a 2-gametick pulse, it will start extending but after two gameticks, the piston will drop it's block and start retracting. If a sticky piston is powered by a 1-gametick pulse, the same behavior will happen, but instead of happening after 2 gameticks it will only happen after one gametick.

When a piston revives a pulse that turns on, and then off in the same gametick, this is known as a 0-tick pulse. This will cause sticky pistons to instantly drop their block and start retracting.. Regular pistons will start retracting instantly when powered by a 0-tick pulse, but the block will not instantly teleport unlike sticky pistons. Because a 0-tick pulse turns on and off in the same gametick, many 0-tick pulses will not render, but the pulse still exists. Due to how 0-tick pulses work, some 0-tick pulses are unable to bud-power pistons in some circumstances.

0-tick pulse generation
All 0-tick pulses are created by powering a redstone line, and then using pistons to remove the power source later in the gametick.

One method of doing so is using tile tick priorities. Since comparators are processed in a tick later than repeaters, one can generate a 0-tick pulse by powering a redstone line using this behavior. In this example, redstone repeater is used to power the output line, and a comparator is used to power a piston which will remove the block in front of repeater to depower the line. Since the comparator always powers after repeaters, the redstone line will always turn off after it turns on, creating a reliable 0-tick pulse. The advantage to this 0-tick generator is that it's 0-tick pulse is earlier in a gametick relative to 0-tick pulses generated through other methods.

Another common method of generating 0-tick pulses is to use budded pistons. As budded pistons only retract when updated, this can be used to control which order pistons move and therefore controlling the order in which a redstone line is powered then unpowered. One example is to have a redstone line that directly powers a sticky piston and bud-poweres two other sticky pistons. The piston directly powered by the redstone line will have a block on its face, and the last piston in the chain will have a redstone block on its face. A secod redstone line will be at the bottom which is the output; it will be powered by the piston with a redstone block and is cut off by the solid block. When the redstone line on top is powered, nothing will happen. But when the input is depowered, then a 0-tick pulse is created. The redstone line will depower, but only cause the piston that is directly powered to start retracting. This will uncut the output line, turning it on. When this piston retracts it will then update the piston in the middle, causing that one to retract which will then cause the last piston to start retracting, which will remove power from the line.

0-tick chaining
0-tick pulses happen within a gametick, but 0-tick pulses can happen after other 0-tick pulses while still being in the same gametick. This is known as 0-tick chaining where two or more 0-tick pulses are activated in a row.

One method of 0-tick chaining is to utilize the fact that tileticks such as repeaters and comparators will process in a gametick before block events such as piston extensions and retractions. In the shown example, when the input is powered, the quartz block will be 0-ticked by both pistons causing it to instantly move two blocks, ending up above the diamond block. The 0-tick generator to the right makes use of tileticks and will activate before the 0-tick generator on the left, which uses block events. This method of chaining is very compact, but it comes at a downside that this method can only be used once per chain.

Another method of chaining is to utilize the fact that update chains can be used to manipulate the order in which things are processed in a gametick. In the shown example, there are two 0-tick generators. The one on the left has an update chain before powering it, while the one on the right is directly powered. When the input is depowered, the 0-tick generator on the right will activate first as it is directly powered causing its output piston to instantly drop its block. While this is happening, the update chain is retracting. Then, the 0-tick generator on the left will will activate causing its output piston to instantly drop its block.

Creating a 0-tick Clock
A 0-tick clock is made by putting two 0-tick block pushers facing each other and pushing a block between themselves, one line will appear on, while the other appears off, each has unique behavior, the "off" line is BUD-proof, while the "on" line allows for BUD pistons, and to set which is which, simply place a lever on the torch under the side you wish to be "on" and flip it twice, also this lever can turn it off.

Another thing to note is that if it is built right, the block WILL NOT seem to move while the piston heads will glitch through it, and the redstone lines WILL NOT pulse at all.





Uses of 0-ticking
Since a comparator does not react to a 0-tick pulse and the pulse will lose its effects if it goes through a repeater, most 0-tick uses involve pistons. Pistons can be used to move blocks before the game has a chance to react as it normally would.

Embedding entities


Normally, when you power a sticky piston with a block on it towards an entity, and the entity has enough room to move, it will be pushed by the block. Zero-ticking a block places it over the space occupied by the entity without moving the entity. This can be used decoratively, e.g. creating 1-block glass 'display cases' with entities (mobs, armor stands) inside, or offensively, causing mobs to suffocate if using solid blocks, or in contraptions where you can overlay an armor stand and a solid block within the same space, e.g. for vertical signal transport using piston and tripwire, crossing with horizontal transport through the block.

Chorus plants
If end stone directly underneath a chorus flower is pushed by a 0-ticked piston, and another end stone takes its place, the chorus flower will instantly grow if it has the space, and instantly mature if it doesn't. Done properly, this can allow a farm to be built where the player plants a chorus flower near bedrock level and the flower's endstone is 0-ticked over and over again until it reaches the build limit where another player can break that chorus flower. The concept can be seen in this video:



Cacti
If sand directly underneath a cactus is pushed by a 0-ticked piston, and another sand takes its place, the cactus growth state will go up by one. This can cause a farm that can produce about 16,000 cacti per hour with a 0-tick cactus farm array or a four-sided setup which produces 2,250 cacti per hour.

教程/零刻活塞