Row 1
1. [impulse] /scoreboard objectives add luckyBlock minecraft.mined:minecraft.gold_block
Row 2
2. [repeat] /execute as @a at @s if score @s luckyBlock matches 1.. store result score @s luckyBlock run random value 2..6
3. [chain] /execute as @a at @s if score @s luckyBlock matches 2 run execute at @e[type=item,nbt={Item:{id:"minecraft:gold_block"}},sort=nearest,limit=1] run setblock ~ ~ ~ minecraft:diamond_block
4. [chain] /execute as @a at @s if score @s luckyBlock matches 3 run execute at @e[type=item,nbt={Item:{id:"minecraft:gold_block"}},sort=nearest,limit=1] run setblock ~ ~25 ~ minecraft:anvil
5. [chain] /execute as @a at @s if score @s luckyBlock matches 4 run execute at @e[type=item,nbt={Item:{id:"minecraft:gold_block"}},sort=nearest,limit=1] run summon item ~ ~ ~ {Item:{id:"minecraft:netherite_ingot"}}
6. [chain] /execute as @a at @s if score @s luckyBlock matches 5 run execute at @e[type=item,nbt={Item:{id:"minecraft:gold_block"}},sort=nearest,limit=1] run summon minecraft:zombie
7. [chain] /execute as @a at @s if score @s luckyBlock matches 6 run execute at @e[type=item,nbt={Item:{id:"minecraft:gold_block"}},sort=nearest,limit=1] run setblock ~ ~ ~ lava
8. [chain] /execute as @a at @s if score @s luckyBlock matches 1.. run kill @e[type=item,nbt={Item:{id:"minecraft:gold_block"}},sort=nearest,limit=1]
9. [chain] /execute as @a at @s if score @s luckyBlock matches 1.. run scoreboard players reset @s luckyBlock