Melon

Melons are blocks that grow from fully grown melon seeds.

Obtaining
Melons can be mined with any tool, but axes (and swords) are the quickest. Melons can only be collected as a block using a tool with silk touch; otherwise they will drop 3–7 melon slices.

When a melon block is pushed by a piston, it will break into 3–7 melon slices.

Natural generation
Melons naturally generate in jungle biomes.

Melons can be found growing in Woodland mansions.

Farming
Melon seeds can be planted, placing a small stem that will grow over time. Once the stem reaches maturity, it will attempt to generate a melon block in one of the four immediately adjacent blocks; however, this attempt may fail if the chosen adjacent block is not empty or the block beneath is not dirt, grass, or farmland. Once a stem has connected to a melon, that stem will not produce any further melons until the existing melon is harvested. If there are two melon plants a block away from each other and a melon is placed/generated between them, the two melon plants will connect to the melon as if they generated a melon at the same time. Furthermore, the two melon plants will not generate any more melons until the melon between them is harvested, the same will go for pumpkins.

Trading
Farmers will buy 7–12 melons for an emerald.

Trivia

 * Any stem adjacent to a melon block will appear to be connected to it, even if the melon was not grown from that stem.
 * Due to this, if a melon block generates between two stems, it will connect to both of them. Pumpkins also do this, although they will not connect to plants of different species.