The only way I'm aware of is the fill
command (needs cheats enabled in singleplayer mode).
/fill X1 Y1 Z1 X2 Y2 Z2 NEW_BLOCK replace EXISTING_BLOCK
The command can fill a cuboid defined by the coordinates of two opposite corners with basically any type of block.
X1 Y1 Z1
: the coordinates of the starting block.
X2 Y2 Z2
: the coordinates of the end block (use same coordinates as starting block if you want just a single block replaced).
NEW_BLOCK
: the type of block you want to be placed.
EXISTING_BLOCK
. the type of the block currently existing at the given coordinates.
Example:
/fill 23 63 42 23 63 42 dirt replace sand
The above command would replace a sand block at the XYZ coordinates 23, 63, 42 with a dirt block.
Since tall grass spans two blocks, not just one, there is another thing to observe, though. You must place the upper and lower half from top to bottom, otherwise placing the upper half would destroy both halves. This works:
/fill 23 64 42 23 64 42 tall_grass[half=upper] replace air
/fill 23 63 42 23 63 42 tall_grass[half=lower] replace air
This will destroy the tall grass when replacing the second block:
/fill 23 63 42 23 63 42 tall_grass[half=lower] replace air
/fill 23 64 42 23 64 42 tall_grass[half=upper] replace air