Piston

Pistons are blocks capable of pushing most blocks, depending on the direction they are facing.

Sticky Pistons are similar to the Piston; the difference is that it can pull blocks as well as push them.

When extending, sticky pistons act exactly as regular pistons, pushing up to 12 blocks. When retracting, sticky pistons will pull along the block immediately in front of it. Obsidian, bedrock, Note Blocks, tile entities, Enchantment Table, and extended pistons cannot be pulled, just as they cannot be pushed.

It is possible for the block “stuck” to a sticky piston to be pushed aside by another piston, and sticky pistons do not hold up sand and gravel against gravity; the stickiness is only in effect during the retraction of the piston.

Crafting
Sticky pistons can be crafted in the 2×2 Crafting grid, because they only require two spaces.

Functionality

 * Pistons always face the player when placed.
 * Pistons are redstone triggered. When powered, their wooden surface extends outwards by 1 block, pushing up to a maximum of 12 blocks.
 * When going back to the unpowered state, the regular piston does not pull any block back (Blocks affected by gravity still fall back down).
 * Its wooden surface can also push players, mobs and other entities on the floor by 1 block if they are in the way. However, if there is no space for the player/mob/entity to be pushed, the extended piston head will just pass through them without harm(unless the block the player is being pushed towards is a staircase/slab). The piston can still push a mob or player off a one block wide walkway, which can be coupled with a Pressure Plate for a fairly effective trap.
 * The extended piston head is considered solid and transparent (just like Glass). If a piston head extends into a player/mob this way, they will not suffocate, and the player/mob can move out of it but not back into it.
 * Similarly, if a block pushed by a piston is pushed into a player/mob, the player/mob will get pushed if there is space. If there is no space, the block will start to occupy the same space as the player/mob and cause suffocation if the block is opaque.
 * When blocks are pushed by a piston, they are momentarily non-solid and cause any players/items on the moving block to fall through the moving block.
 * Pistons can be used to toggle fluid flows like a flood gate by extending into or retracting from the space where the fluid would flow through.
 * Pistons can push Minecarts and Boats. Note that if the minecart is on a rail, the rail will also get pushed if there is space. If there is no space, or it is pushed over an edge, the rail will turn into a drop.

Pushing Blocks

 * Some blocks cannot be pushed by Pistons and the piston head will not extend:
 * Obsidian, Bedrock, End Portals and Nether Portals to avoid abuse
 * Blocks with extra data (tile entities) attached - Note Blocks, Chests, Furnaces, Jukeboxes, Dispensers, Monster Spawners, Brewing Stands, Enchantment Tables and End Portal Frame blocks.
 * Pistons will not push blocks into The Void or the top of the map.
 * Extended pistons (both sticky and normal)
 * Cactus, Pumpkins, Jack-O-Lanterns, Sugar Cane, and Dragon Eggs are turned into drops when pushed. (If trying to create extendable/retractable lighting, you can use Glowstone Block instead. See also: Redstone Lamp.)
 * Melons will turn into slices if pushed by a piston.
 * Cobwebs will turn into string if pushed by a piston.
 * Pistons cannot push water or lava, only obstruct it. A piston head extending into a water or lava source block will destroy the source block.
 * Pistons cannot push most blocks that are "attached to a block” such as levers, torches, redstone, signs, etc. They will be detached and drop as an item. Exceptions include:
 * Trapdoors, as long as their hinged side remains attached to a solid block in their new position.
 * Rails (and Powered Rail, Detector Rail) as long as they remain on top of a solid block in their new position. Rails will re-orient themselves after being pushed just as they do when placed manually.
 * Blocks that are attached to pushed blocks will be broken off unless the block which is now under/behind them is also acceptable; for example, torches can be placed on a "self-repairing" cobblestone structure.
 * Pistons cannot push a chain of blocks more than 12 blocks long. They will simply not extend.

Powering Pistons

 * Pistons can be powered horizontally through single blocks by way of either redstone or repeaters.
 * Pistons can be powered by a redstone torch directly adjacent to them (above, below, or to the side).
 * Pistons can be powered by a redstone torch from below when said torch would power the block the pistons are resting on (just like powered rails).
 * Pistons can be powered by any powered block directly adjacent to them, and by any powered block one block above and to the side. However, the piston won't recompute its state unless a block directly next to it is changed. An adjacent piston retracting causes a recompute, but an adjacent piston extending doesn't.
 * Both redstone dust and repeaters will power the piston directly in front of it as well as a second piston below this piston. This allows a wall made completely of pistons to be constructed. Redstone dust will also power the block beneath itself which in turn will power the third piston below the first two, but due to the bug mentioned above it won't recompute its state.
 * When toggled between on and off rapidly with a gravity affected block (such as sand) above it, a piston will eventually break the block, which can be picked up as a resource. However, gravel will never break into flint.
 * A repeater cannot transfer power through a piston.

Common Usage



 * Pistons are commonly used to push/pull blocks to simulate opening and closing doors, gates and to create traps.
 * Pistons can be used to make self-repairing bridges by using cobblestone from a cobblestone generator, or stone from a stone generator. The same principle can be used to make a self-repairing house.
 * When used in conjunction with redstone repeaters, one can create virtually any logic gate without the use of Redstone torches, bypassing the "burnout" speed limit.
 * Pistons can be used to make traps, as pushing a block into a player will suffocate him. Their advantage is that they are easily resetable, and are very subtle.
 * A piston powered clock linked up to a square of blocks designed to be pushed round in a loop can create an endless loop of data. Combined with the inability of transparent blocks (such as glass) to transmit power, a redstone repeater can be run into the pushed data block to optionally perform a function on the other side. Scale this up into 3 dimensions and you get an array of data looping round, being tested to see if it transmits the power or not. This can be used to create redstone sign outputs, to play musical sequences, and a countless list of other things. A single cell can also hold at least five different states as opposed to standard two.
 * Another use for Pistons is to put a block on top an upward facing piston, with a track on top of that, then have a minecart one block away from it on the track so that when you activate the Piston it will slant the track and get the minecart started.
 * Pistons can be used to move blocks like glass or ice that cannot be picked up.
 * Pistons can be used for semi-automated farming. Using a sticky piston with a dirt block or similar solid block attached, the piston is capable of pushing wheat or sugarcane off soil- the blocks will subsequently turn it into their respective items. Then replant manually.
 * Pistons can be used to build downward from a platform in the air by placing it on a block above you, and pushing blocks downward into place.
 * Pistons can be used to build opening and closing windows.
 * Pistons can be used to build an elevator of arbitrary height. This is achieved by placing vertical pistons like a circular stairway around a central 1-block shaft, and for each such vertical piston, have a horizontal piston three blocks higher that pushes the player onto the next vertical one. This construction needs a lot of space (11x11 block area) and a huge amount of redstone ore (each piston except the first needs a redstone repeater set to the third position, to delay the action). A simpler design without a vertical shaft with a smaller 8x8 footprint can be built, too (see screenshots).
 * Instead of placing the pistons like a circular stairway around a central shaft, they can be placed like a regular stairway in a linear fashion as well, creating an escalator. The principle is still the same, you have a horizontal piston for each vertical one, that pushes the player onto the next higher piston.
 * It's possible to construct an automatic bridge from pistons that can be submerged with the pull of a lever. The pistons are powered from below using redstone torches, and those are wired from the side (first from left, second from right, third from left, etc.). This requires a hollow space below the pistons that is as long as the piston bridge, 2 high and 5 wide (redstone torch in middle, block below it, redstone wiring to the blocks from left or right using 2 tiles each). The bridge can be toggled with two levers from each side, by connecting the pistons to an out of an xor gate and connecting the two levers to the two ins of the gate. Another possibility to trigger the bridge is an or gate, a 1-bit memory cell and two pressure plates.

Controlling Water

 * Sticky pistons provide the much needed method for controlling water, without the previous method's needs for manually resetting the mechanism.

A simple water control example (from top looking down perspective) is:


 * Note: The piston in the schematic is a sticky piston.

Toggling power on the sticky piston will open/close the air space below the water block, while hiding the sticky piston from player view. Water will flow out below. Anything can be used in place of the cobblestone, additionally the same model can be scaled length, width, or even up/down (to control water release on floors/levels). Having a sticky piston is not necessary for controlling water, if only a normal piston is available, one can still use the arm of that piston to block the water.

Piston Elevators
Sticky Pistons can also be used to make fast piston elevators.

Synchronized Stacked Pistons
Sticky pistons do not stick when they aren't retracting. This prevents them from being used as self-resetting fast elevators without difficulty.

An example of 13 vertically stacked sticky pistons that could expand as one gigantic sticky piston, that make a big piston the size of 13 blocks, expand to 26 blocks with only one input and only one on/off instruction signal is at http://www.youtube.com/watch?v=EPLzNdu7Soo

History
The original piston was a mod posted on the Minecraft Forums by Hippoplatimus. The code for that version was given to Jeb, who then worked on implementing pistons into vanilla Minecraft. Another user, DiEvAl, privately submitted code as well, including the idea of Tile Entities to track moving blocks. However, due to his work on the Pocket Edition, pistons were delayed, and were not released for the Beta 1.5 update nor for the Beta 1.6 update.

Finally, when the Pocket Edition was good enough to show at E3, Jeb went back to work on the PC version of Minecraft and pistons were finally added in version Beta 1.7, including Sticky Pistons.

In Beta 1.7_01 and Beta 1.7.2, there was a bug that duplicates blocks and uses a sticky and regular piston, it was later fixed in 1.7.3

As of 1.7_01, Sticky pistons do not stick when they aren't retracting.

As of the 1.7.3 Beta update, it is impossible to place a Jack-o-Lantern onto a sticky piston.

Hippoplatimus is in the game's credits under "Additional Programming", like other modders whose work made it into vanilla Minecraft.

Bugs

 * If walking on an extended piston from the piston body to the piston arm, you may walk across, but when walking from a block on the end of the piston arm to the piston body, you fall through the arm.
 * If pistons push a block rapidly, and you break the block, you will get Block 36, or the Piston Arm if you break a block near the piston's arm.
 * An extended piston will not retract if one of the blocks diagonal to it is powered.
 * If two extended pistons are one above the other, the lower one cannot retract until the upper one retracts. If the top one will start extending while bottom one is still retracting, the last will start extending as well.
 * If a sticky piston would pull a block back and another piston is waiting to push out to the spot that block would occupy after being pulled, the block is deleted.
 * Powering pistons with a redstone torch in some cases seems to always consider the torch as "on", even if powered off.
 * Rear part of a piston during retracting has no collision: when pistons point down it is possible to glitch through them when they retract, it is also possible to glitch through a retracting piston while walking against it.
 * Blocks being pushed by a piston have no collision in certain places.
 * When a sticky piston pulls a door, it becomes a half door attached to the piston.
 * A piston attached to a sticky piston may disappear when extended into flowing water.
 * Light passes through pistons, both normal and sticky, powered and unpowered of both types.
 * If a sticky piston is pulled down by another sticky piston, it will not pull the block it is attached to with it.
 * If a piston (or a block being moved by a piston) attempts to push a gravity-affected block in the proccess of falling, it will destroy the block, sometimes without dropping it to be collected. Therefore, mechanisms that invole repeatedly moving sand or gravel towers must let all blocks come to rest before continuing.
 * Double piston can be created using unknown methods, The side piston can only be powered from above and if its powered from beneath it will retract and vanish, this bug seems to break SMP servers, therefore no tutorials are available yet.
 * Pistons can get stuck on and off simultaneously. The only way to fix this is to either destroy the piston and replace it or pull the stuck piston with a sticky piston.
 * When a piston or a sticky piston is placed upwards (with the redstone input being located 1 block bellow) and a rapid pulse signal is applied to the redstone, if the player tries to break the piston or sticky piston with any item, block, tool, or hand, the piston or sticky piston will break, dropping an item, but leaving a breakable piston head in mid-air. Click the following reference to see this bug.
 * If a Piston is facing upwards and a gravity-effected block (such as Sand) is put on it (if using a Sticky Piston, any block works) and Redstone Dust is put near it, and the player puts a Redstone Torch on top of the Redstone Dust, then the player gets an extra Redstone Torch. However, this only works if the player if the Redstone Dust is on the North or South sides. This is demonstrated in this video.
 * Although Sticky Pistons can also move Minecart Rail up like normal ones, retracting the Piston turns the rail back into an item. It is advised to use normal Pistons for rail movement to avoid losing them when the Piston is turned off.
 * if the player was to place 4 pistons in water together and put sand inside all four,making sure that they were facing outwards,then putting a piston on top of the sand and then more sand on top followed by a lever,standing on the sand and pulling the lever they would get the saving chunks screen and crashing. Unknown if fixed.
 * In Beta 1.7, it was possible to crash a server using pistons and redstone.
 * Stacking 2 pistons on top of each other (facing to any side, not up or down), then powering the top piston only, then breaking the block below the stack, will cause the bottom piston to extend by a phantom power source, and get stuck. Powering/unpowering the bottom piston normally usually will not retract it, unless it is perfectly synchronized with the upper piston.  All blocks around the glitched piston can be removed, creating an extended piston that floats in the air, powered by itself.
 * In the 1.2.5 snapshot, if a extended piston arm is "picked" in creative mode, it will give a glitched block with no tooltip and cannot be placed.
 * When attempting to pull beds or doors with a sticky piston, only half of the bed/door will be pulled by the piston, and the other half will disappear. If you activate or break the sticky piston, you'll also break the bed/door and be able to collect it.
 * When placing cake on a piston that isn't activated, then activate the piston, the cake disappears.
 * While standing next to a block that can be affected by a piston and activate the piston, pushing the block into you, occasionally a block will spawn next to the block affected. This usually happens with piston doors using two pistons stacked on top of each other.
 * When a sticky piston is extended and retracted very quickly (with a 1-tick pulse), it will not pull a block back, i.e. the block it is attached to will not be moved back with the piston. However, on the next extend/retract-cycle it will pull the block back, this can be used as a simple T-flip-flop.
 * Sticky pistons cannot pull pumpkins, melons, and Jack 'o' Lanterns, even though they can be pushed(but the block will break).
 * Sticky piston transparency for redstone wire is affected by the extension of the pusher.
 * If a sticky piston is retracted with an extended piston above it, the activated sticky piston above will not go down with the sticky piston below.
 * Light can pass through sticky pistons.
 * When creating bud switch with sticky piston,after using it it will create an extra piston arm as shown in this video http://www.youtube.com/watch?v=9h-IAA8A6ZQ
 * ( This sometimes works in 1.2.4!) If putting a button on a block with a redstone torch on the block, and a piston in front of it, if you press the button two times, even though the redstone torch is on, the piston isn't pushed.
 * If you middle click the extended piston arm while in creative mode your game will crash.
 * If the player is to activate a sticky piston then left click the end of the arm (square end),it won't destroy the body of the piston,you will just see a hole. However, if you do that with a normal piston, it will disappear immediately, but still drop a resource.

Trivia

 * The sticky piston may also be used for pushing Spike Blocks instead of having a spiky piston.
 * If a piston pushes a gravity-affected block over a hole, the block will fall, even if attached to a sticky piston.
 * Pistons cannot be used to 'crush' players or mobs against walls. A piston will simply pass through them if this is attempted. However, blocks being pushed by piston will crush players and mobs and suffocate them, making it useful for traps.
 * If attached from up above, pistons may be able to push blocks downwards and suffocate the player or mobs.
 * Pistons can be placed near cacti so that when they are activated, and if the pushing end is adjacent to the base of a cactus, the cactus will break.
 * Pistons will break leaves when pushed.
 * If you push a burning block, the block will be put out. If you push a row of burning blocks, they will all stay on fire except for the farthest one.
 * Pistons can be used to create logic gates. These may be more space efficient than standard gates and clocks created from them can also operate at much higher speeds without burnout.
 * Pistons may also be used the same way one-way or minecart-only soul sand gates work by putting an extended piston one block above a minecart track allowing only small or tiny slimes, cave spiders, and chickens to enter. Doing this keeps pursuing mobs out (except for slimes). When a minecart passes through the player will not be suffocated and continue going. Alternatively they can be used to make entire 2 block high doors for minecarts on a slope, since if a block is put adjacent to the theoretical hypotenuse of the slope it will touch the rails, but not cut them off and will allow no space for any mobs at all.
 * Pistons can be mined with bare hands in less than 2 seconds.
 * Pistons Share the #1 spot with cake for crafting complexity, each requiring 4 individual items to make the item itself. However, Pistons have a much shorter crafting chain, requiring at minimum having crafted an iron pick.
 * Pistons do not work at the lowest level of bedrock (or the level above the Void).
 * The original piston texture had an iron band running over the head, it was later removed, only leaving iron brackets around the corners and edges.
 * If a sticky piston blocks a redstone wire vertical connection that is the same one giving the piston power, it will extend and retract over and over very quickly, making it possible to make a simple arrow turret.