Ways of breaking melons in minecraft
Melon blocks (quite unlike their stems) are fairly resilient to most 'damaging influences' - won't be broken by water, lava, falling entities, make slime blocks slide against them ineffectually, they can float without support just fine - if they were made unmovable by pistons (like e.g. funraces) your only remaining course of action (other than /setblock <melon position> minecraft:air destroy
) is to use explosions. TNT exploded on surface of obsidian, 7 blocks away from the melon blocks, but 8 from their stems will break the blocks and leave the stems untouched. Alternatively, creepers (range 5.1 blocks) can be used. Ghast fireballs would work, but managing the explosion radius would be difficult - or you might try a Wither based melon farm, if you're aiming for the awe&fear factor.