The piston in Minecraft is created on a crafting table and consists of three wood blocks, four cobblestone, one iron ingot and one redstone dust. A variant of the piston is the sticky piston, which is created by combining a piston with a slimeball.
The wood, cobblestone, iron ingot and redstone are dragged and dropped in the slots of a crafting table with any type of wood along the top; cobblestone, iron ingot and cobblestone in the middle; and cobblestone, redstone and cobblestone at the bottom.
The sticky piston can be crafted on the crafting table or in the player’s inventory crafting section as it only requires two slots. The piston is placed in the lower slot and the slimeball directly above it. When a piston is placed, it always faces the player with the wooden surface.
Pistons are powered by means of a redstone signal, but a line of redstone does not connect to the piston itself. It has to be extended by either powering an adjacent block, placing an adjacent redstone torch or a redstone repeater pointing into the piston.
Pistons are primarily used for pushing blocks. The sticky piston can also pull a block back when retracting. A piston can push a maximum of twelve blocks; if more blocks are in front of the piston, it can't extend. Pistons are also not able to push blocks into the void or above the build limit of the map, and there are a number of blocks that cannot be pushed by design.
Pistons can also be used to create a drawbridge to cross lava by pushing blocks aside to reveal a path. They can also be used for self-repairing structures, which use a piston cobblestone generator to endlessly create new blocks that are pushed into place by pistons.