scoreboard objectives add FDrandom dummy FDrandom
scoreboard players random @s FDrandom 1 5
execute if entity @s[hasitem={item=minecraft:clay}] run replaceitem entity @s slot.weapon.mainhand 0 minecraft:clay_ball 4
execute if entity @s[hasitem={item=minecraft:gravel},scores={FDrandom=1}] run replaceitem entity @s slot.weapon.offhand 0 minecraft:flint
execute if entity @s[hasitem={item=minecraft:gravel},scores={FDrandom=1}] run replaceitem entity @s slot.weapon.mainhand 0 minecraft:gravel
execute if entity @s[hasitem={item=minecraft:gravel},scores={FDrandom=!1}] run replaceitem entity @s slot.weapon.mainhand 0 minecraft:gravel
execute positioned as @s run playsound use.stone @a[r=6]