How to build an automatic sugar cane farm in Minecraft
the canes run in a straight line, the water is on their left, the pistons on their right.

The Piston pushes blocks when it receives a redstone signal. Doors, farms, flying machines and hidden passages are built with it, and adding a Slimeball turns it into a Sticky Piston that can also pull.
It is made with the Crafting Table from 4 × Cobblestone, Redstone Dust and 3 × Oak Planks (or another variant). It is mined with a pickaxe.
When powered, the Piston extends and pushes up to 12 blocks in front of it; when the signal stops, it retracts. A normal piston leaves the block where it pushed it, while a Sticky Piston brings it back.
Some blocks cannot be moved, such as Obsidian, Bedrock or blocks that store items like a Chest or a Furnace, and others break when pushed, such as torches and flowers. Blocks broken this way drop as items, which is how many farms collect melons and pumpkins.
Slime Blocks and Honey Blocks drag the blocks next to them, which lets one piston move a whole structure. Pistons also push mobs and players.
// Slots with several items cycle through every accepted option.
the canes run in a straight line, the water is on their left, the pistons on their right.
in Java, pistons, dispensers and droppers can also be switched on by power aimed at the block above them, and Bedrock has no such rule.
in Java Edition a piston also turns on when the block above it is powered.
| facing | north · east · south · west · up · down |
|---|---|
| extended | true · false |
At the Crafting Table: 4 × Cobblestone, 1 × Redstone Dust, 3 × Oak Planks (or another variant) and 1 × Iron Ingot give 1 × Piston. Mining the block drops it.
It pushes up to 12 blocks when powered by redstone and is used in doors, farms and flying machines. It is an ingredient in one recipe: Sticky Piston.
The fastest tool is the pickaxe.