I think this would be a really good implementation for skript, specially for code optimization. I had to make a 300 line code to obtain an accurate result according to minecraft's mechanics

Example:
This code loops all blocks in radius 2 around player, and destroys them (break loop-block) but then I had to make the fortune and silk touch enchantment mechanics on skript for every single ore (using a lot of checks and "chance of X%")

With this implementation I could do it in 6 lines

This seems very useful and is easy to add. I will note that 300 lines is wholly unnecessary for this, you could just have a handful of lines to determine the dropped item type based on the ore that was dug and then have all of this logic for Fortune once.
Also, not quite relevant to the suggestion but your math for these drops is wrong, for Fortune III this will result in a 51.2% chance to drop just 1 item because it's 80% * 80% * 80%. You should do the chance of 40% to drop one first, then two else chance of 20% to drop 2 then 3, then the final else should drop 4.
Alright, thank you for the feedback and for correcting me, I didn't know "else chance" was a thing
Just to let you know (because I wrote that effect) that this is an issue with Spigot.
The method to break a block using a player's tool does not account for the enchantment, and this is something that should actually be handled by Spigot rather than Skript (in my opinion)
This is easily possible using NMS and not possible with Spigot like Shane said. It doesn't make any sense to list every conditions, nor Skript's job.
skript-mirror code (use 2.0.0-snapshot: https://circleci.com/gh/btk5h/skript-mirror/3#artifacts/containers/0)
yes it supports everything (?) because it literally forces the player to break the block, great!
effect:
patterns:
make %player% break %blocks% [(1娄without [break] sound[s])]
force %player% to break %blocks% [(1娄without [break] sound[s])]
trigger:
loop exprs-2:
if parse mark is not 1:
# BlockSoundGroup requires Paper 1.14
# Sound categories and advanced play sound effect requires Skript 2.4x
play sound "%loop-value.getSoundGroup().getBreakSound()%" in blocks category with volume 0.3 at loop-value
set {_interactManager} to expr-1.getHandle().playerInteractManager
{_interactManager}.breakBlock(loop-value.getPosition())
@Blueyescat Thanks for the response, that would be great if I understood mirror xD
You don't need to understand because i gave the full code, you will put it in a script then you can use make player break loop-block
Note: don't use "target block" for everything please, event-block -- clicked block
@Blueyescat yeah I just figured it out, thank you so much. Also, I would like to learn skript mirror, do you know where could I do it?
deleted comment
Well that is correct, need to some checks. Would be good with metadatas. Please come to Skript Hub Discord for further discussion.
So this should be closed
Just an update on this, Im not sure when, but apparently Spigot fixed this.
I was just fiddling around on a test server and noticed it works.
ex: Looking at a diamond ore block, holding a diamond pickaxe I ran:
!break target block using player's tool
it dropped 1 diamond
then I gave myself a diamond pick of fortune 100, and did the same command, this time it dropped 80+ diamonds.
Im looking thru Spigot commits trying to figure out when it was fixed, I cant find it, but it seems to be fixed (in 1.14.4 obviously)
Most helpful comment
Just an update on this, Im not sure when, but apparently Spigot fixed this.
I was just fiddling around on a test server and noticed it works.
ex: Looking at a diamond ore block, holding a diamond pickaxe I ran:
!break target block using player's toolit dropped 1 diamond
then I gave myself a diamond pick of fortune 100, and did the same command, this time it dropped 80+ diamonds.
Im looking thru Spigot commits trying to figure out when it was fixed, I cant find it, but it seems to be fixed (in 1.14.4 obviously)