I've created multiple posts in script-resources, however felt it would make sense to create a post with a link to both in one place, plus I believe this will help casual developers who otherwise might not look in the scripting channel, as they may not use scripting. This is complete code with full durability, block breaking and custom interactions (eg stripping logs or turning dirt into paths with a shovel) - and all you need to do is replace the item ids with your own! Stable, works in 1.20.70+ (server api 1.9.0)
Works in Stable (1.20.70+)