Updated:

1. Drop an anvil overhead

/setblock ~ ~10 ~ anvil

Works on Java and Bedrock. Sand and gravel fall the same way.

2. Rain anvils on everyone

/execute at @a run setblock ~ ~10 ~ anvil

Run it repeatedly for an anvil dodging game.

3. Drop any block (Java)

/summon falling_block ~ ~10 ~ {BlockState:{Name:"minecraft:diamond_block"}}

falling_block makes even non gravity blocks fall, then land as a placed block.

4. Add damage (Java)

/summon falling_block ~ ~10 ~ {BlockState:{Name:"minecraft:stone"},HurtEntities:1b,FallHurtAmount:2f,FallHurtMax:20}

FallHurtAmount is damage per block fallen and FallHurtMax caps it.

5. Clean up

/fill ~-10 ~-2 ~-10 ~10 ~5 ~10 air replace anvil

See the setblock command for single blocks.

6. Random drop spots (Java)

/summon marker 0 64 0 {Tags:["drop"]}
/spreadplayers 0 0 0 10 false @e[tag=drop]
/execute at @e[tag=drop] run setblock ~ ~15 ~ anvil
/kill @e[tag=drop]

A marker lands at a random spot in the arena and an anvil drops above it. See the spreadplayers command.

7. Make an anvil dodge game

/scoreboard objectives add deaths deathCount
/scoreboard players reset @a deaths
/gamemode adventure @a
# Repeating command block
gamemode spectator @a[scores={deaths=1..},gamemode=adventure]

Players hit by an anvil become spectators after they respawn. Keep anvils falling with steps 2 and 6, and the last player in adventure mode wins. See the death counter. If anvils hit too hard, lower the drop height (~15) in step 6.

Troubleshooting

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.