Piston

A piston is a block capable of pushing blocks, players, and mobs when given a redstone pulse.

A sticky piston has the same function as a piston but can also pull the block on its face back when it retracts, unlike the regular piston, which leaves the pushed block in place.

Breaking
A piston can be broken using any tool with equal efficiency, and always drops itself. $$, it is faster to break them with a pickaxe. The pickaxe is also the preferred tool for breaking the head when extended.

Natural generation
Three sticky pistons generate as part of each jungle temple. Sticky pistons also generate in ancient cities.

Usage
Pistons are always placed facing toward the player. When powered, the piston's wooden surface (the "head") starts extending immediately $$; or either 2 game tick later or immediately, depending on how it was powered, $$. When it extends, it pushes at most 12 blocks. The piston makes a sound that can be heard within a 31×31×31 cube centered on the activating piston. Any entities in the path of the extending head are pushed with the blocks. If there is no place for the entities to go, the block pushes inside them, suffocating mobs if the block is not transparent when pushed into the eye height of the mob.

When a piston loses power, its head retracts. Like extending, this retraction starts immediately $$; or, depending on how it was powered, after 1 tick $$. It finishes retracting 2 game tick after it starts. A sticky piston also pulls the block attached to its head, but not any of the other blocks it may have pushed.

Sticky pistons stick to a block only when retracting, so a block next to the piston head can be pushed aside by another piston and sticky pistons cannot hold falling blocks horizontally against gravity. $$, pistons finish extending early and start retracting if given a pulse shorter than 3 game tick. These shorter pulses cause sticky pistons to "drop" their block, leaving it behind when trying to push it with a short pulse. Also, this causes the block to end up in its final position earlier.

A piston that pushes a slime block bounces any entity that it displaces in the direction the piston is facing. In addition, when a slime block is moved by a piston, any movable blocks adjacent (not diagonally) to the slime block also moves. See the "Slime blocks" section below for more details.

$$, blocks that stick to walls (such as levers) can be placed on pistons or sticky pistons.

Limitations
Pistons can push most blocks, and sticky pistons can pull most blocks, except those listed in the table below. A sticky piston simply leaves a block behind if it cannot pull it.

Pistons cannot push blocks into the void or beyond the top of the map. They also cannot push more than 12 blocks. If the requirements for a block to be pushed are not met, the piston simply does not extend.

Pistons do not move blocks that are "attached to a block", as they detach and drop as an item.

Exceptions

 * : as long as they remain on top of a solid face of a block in their new position, and that block isn't moving at the same time.
 * An exception is when the rail and block supporting it are on two parallel extended pistons at which the rail remains attached. Trying to move both on the same piston using slime blocks does not work, nor does moving them on perpendicular pistons (although the latter temporarily appears to work because of a bug ).
 * Rails re-orient themselves after being pushed, similar to when placed manually.

Powering pistons
Pistons can be powered in various ways:
 * If a redstone wire is in a line shape toward the piston. $$, the wire does not automatically curve to the piston.
 * Pistons can be powered by a powered block directly adjacent to them, whether it is strongly powered or weakly powered.
 * Pistons can be powered by a redstone torch directly adjacent to them.
 * $$, pistons can be powered by any powered block one block above and to the side, including the "activated space" above it (if a piston, both sticky and normal were to be facing up and a block of redstone placed on its head, it extends when powered, but doesn't retract when the power it receives from the side or back turns off). However, the piston doesn't extend or retract until it receives a block update. This property is called quasi-connectivity and can be used to make a BUD switch.
 * A repeater cannot transfer power through a piston, as pistons are a transparent block.
 * An upward-facing piston can't be powered by a block above it, unless it is extended $$.
 * $$ a redstone torch attached to a piston turns off whenever the piston is powered.
 * Pistons can also be powered by observers. This will create a clock if the setup is correct

Slime blocks and honey blocks
When a slime block is pushed or pulled by a piston, while moving, adjacent blocks also move with the slime block, unless a non-piston movable block stops the blocks that are "grabbed" by the slime blocks. These blocks may in turn push other blocks, not just the blocks in the line in front of the piston. For example, a slime block sitting on the ground attempts to move the ground block underneath itself, which in turn has to push additional ground blocks in the direction of motion just as if it were being pushed directly by a piston.

Glazed terracotta is an exception; it does not move when adjacent slime blocks are moved.

The same occurs when a slime block is moved by an adjacent Slime Block. For example, a 2×2×2 cube of Slime Blocks may be pushed or pulled as a unit by a single piston acting on any of the blocks in the cube.

A slime block adjacent to a block that cannot be moved by pistons ignores the immobile block. But if an adjacent block could be moved but is prevented by the presence of an immobile block, the slime block is prevented from moving.

Slime blocks are not pulled by a non-sticky piston, nor are they moved if an adjacent (non-Slime) block is moved by a piston.

The maximum of 12 blocks moved by a piston still applies. For example, a 2×2×3 collection of Slime Blocks may be pushed or pulled by a sticky piston as long as no other movable blocks are adjacent to it.

A piston cannot move itself via a "hook" constructed of slime blocks, but self-propelled contraptions can be created with multiple pistons. For that, see the article Tutorials/Flying machines.

The same happens for the honey block, but it does not stick to slime blocks.

Piston head
The piston head is a technical block used as the second block of an extended piston. A block state defines whether it is a normal or a sticky piston head. It can be placed using the command or with the debug stick, though if not part of a proper piston, it disappears after receiving any block tick, such as when a block is placed next to it unless the player uses the debug stick. It drops nothing.

$$, the normal and sticky piston heads are distinguished by a block state. $$, they used separate block IDs, and it can be obtained as an item via inventory editors.

Natural generation
Sticky piston heads generate in ancient cities.

Moving piston
The moving piston is an unobtainable technical block that contains part of a piston head, and/or part of one or two blocks that the piston is carrying into or out of the grid cell (including blocks carried indirectly via slime blocks). Since moving blocks vary in how much of each grid cell they occupy, they can't be stored as normal blocks and are instead stored as block entities. It is overwritten with air, the piston head or the carried block at the end of the piston stroke; but if it is placed through editing and no piston is connected, it remains indefinitely.

It is invisible and non-solid $$, and cannot be broken without the use of commands or TNT. Although it is non-solid, fluids cannot pass through it. It also prevents players from building at its location. Mobs can see through it, but cannot walk through it. The game treats the block as a stone block when it comes to the player's footstep sounds. It is similar to Invisible Bedrock in properties with the exception that the player can walk through the moving piston but not invisible bedrock.

Block data
The moving piston has a block entity associated with it that holds additional data about the block.




 * See Bedrock Edition level format/Block entity format.
 * See Bedrock Edition level format/Block entity format.

ID




Block states
The  and   blocks use following block states:

Block data
$$, a piston has a block entity associated with it that holds additional data about the block.


 * See Bedrock Edition level format/Block entity format.

History
{{info needed section| {{History|java classic}} {{History||May 21, 2009|link=wordofnotch:110762705|Notch shows interest in adding blocks that can pull and push other blocks when a pulse from a wire is received; he called them "Pulley1", which would pull a block up, and "Pulley2", which would push a block up.}} {{History|java beta}} {{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; Hippoplatimus is in the game's credits under "Additional Programming", like other modders whose work made it into vanilla Minecraft. {{History||June 7, 2011|link={{tweet|jeb|78167135435759617}}|Jeb tweets an image of pistons in development. {{History||1.7|                             Added pistons and sticky pistons, alongside associated head and moving blocks.}} {{History||1.7_01|Sticky pistons no longer stick when they aren't retracting.}} {{History||1.7.3|It is now impossible to place a jack o'lantern onto a sticky piston.{{check version}}}} {{History|java}} {{History||?|The wireframe hitbox of the moving piston block is now halfway aligned.}} {{History||1.3.1|snap=12w22a|Sticky pistons now generate naturally inside jungle temples. In the temples, the pistons are used to form a puzzle mechanism.}} {{History|||snap=12w27a|Pistons have been updated to make them less error-prone, thus they also appear to update slower. This also alters the way pistons work, so the player might have to adapt their repeater delays and similar. For this change, pistons now take 2 redstone ticks (4 game ticks) to extend, but they still retract instantly.}} {{History||1.8|snap=14w17a|         The models for piston and related blocks when facing up and down have been changed.}} {{History|||snap=14w18a|Slime blocks now push and pull blocks adjacent when connected to sticky pistons. {{History|||snap=14w19a|Slime blocks can now push entities sideways and downward when attached to a piston.}} {{History|||snap=14w29a|           There are now "short" piston heads. Their use is unknown.}} {{History|||snap=14w32a|The moving piston block no longer has a hitbox.}} {{History||1.9|snap=15w49a|Unextended pistons, downward-facing pistons, and upward-facing piston heads are now considered to have a solid top surface, like upside-down stairs and top slabs. There also existed a bug where when a piston retracted, it would pull entities through them.}} {{History||1.12|snap=17w16a|Sticky pistons do not pull glazed terracotta, and when pistons move slime blocks, they do not move glazed terracotta attached to the side of the slime block.}} {{History|||snap=pre3|Slime blocks can no longer pull glazed terracotta attached to any side of a piston, whatsoever.}} {{History||1.13|snap=17w47a|Pistons now can push note blocks.}} {{History|||snap=pre6|Sticky pistons now pull glazed terracotta again.}} {{History|||snap=pre8|Sticky pistons no longer pull glazed terracotta.}} {{History||1.14|snap=18w43a|                                         The textures associated with pistons have been changed. {{History|||snap=18w44a|Pistons are no longer transparent.}} {{History|||snap=18w46a|Extended pistons now allow light to pass through certain faces.}} {{History||1.15|snap=?|Added honey blocks, which have multiple different types of interactions with pistons.}} {{History||1.16|snap=20w06a|The hardness of pistons has been increased from 0.5 to 1.5. {{History||1.17|snap=20w45a|Particles now appear if a block is broken by a piston.}} {{History||1.19|snap=22w13a|Sticky pistons and piston heads now generate in ancient cities.}} {{History|||snap=22w17a|                                         Changed piston and sticky piston textures, to match the color of the oak planks on the piston head.}}
 * Another user, DiEvAl, privately submitted code as well, including the idea of block entities to track moving blocks. }}
 * Piston (pre-release).png The piston texture as screen-captured while in development had iron bands running over the head. The bands were removed for the release, leaving only iron brackets around the corners and edges.}}
 * Extending a piston with a slime block on top of it launches the entity (mobs, players, items, launched arrows, etc) into the air.}}
 * While the texture for oak planks was later updated in subsequent snapshots, the piston texture is yet to be changed to reflect this. }}
 * Pickaxes are now the tool for breaking pistons.
 * Pistons no longer pop off redstone components placed on the back when retracting.}}

{{History|pocket alpha}} {{History||v0.15.0|snap=build 1| Added pistons and sticky pistons. {{History|bedrock}} {{History||1.10.0|snap=beta 1.10.0.3| The texture of pistons has been changed.}}
 * Pistons and sticky pistons have a version exclusive animation and the ability to push block entities.}}

{{History|console}} {{History||xbox=TU3|xbone=CU1|ps=1.0|wiiu=Patch 1|switch=1.0.1| Added pistons and sticky pistons.}} {{History||xbox=TU14|ps=1.04|Pistons now take double the amount of time (2 redstone ticks or 4 game ticks) to extend, but they still retract instantly.}} {{History||xbox=none|xbone=none|ps=1.90|wiiu=none|switch=none| The texture of pistons has been changed.}}

{{History|3ds}} {{History||0.1.0| Added pistons and sticky pistons.}} {{History|foot}}

Trivia

 * When toggled between on and off rapidly with a gravity affected block (such as sand) above it, a piston can eventually break the block, which can be picked up as a resource. However, gravel broken this way never drops flint.
 * If a sticky piston powered by a short pulse directly pushes a waterlogged block, the block remains waterlogged at its new position.
 * Mobs can spawn inside the piston head block.
 * Carpet can be placed on the piston extension block, and remains even if it is replaced with a solid block using.
 * $$, the piston head is invisible and non-solid when placed with commands. The moving piston cannot be placed with block placement commands in this edition.
 * The  is transparent and does not emit light.
 * If a light-emitting block is moved, the player can see it turn dark briefly. If an opaque block is moved, the player may see light passing through it.