Custom Enchantment rewarding more exp the more of a certain thing is done

I'll go right to an example: Player has mined 200 coal ore, now every coal ore grants 1 exp more. Player has mined 500 coal ore, now every coal ore grants 2 exp more. And so on (thresholds will be adjusted) For every ore and every mob.

For mobs it should possible with advancements - I think. Count how many kills each player has on a mob with a scoreboard and let the advancement run a function.

But how do I do it for blocks? I could use inventory changed I guess, but that would delay the granted exp - I would like it to be spawned at the ore after mining it.

And a short explanation on how to set up scoreboards for this would be very nice and appreciated. 😅

If there is any other way that's maybe even easier I'd like to know it as well.

Continue to help post