I've never made a datapack and I don't even know how to proceed with my strange idea

Hi, I'd like some help making a datapack that prevents you from placing blocks, but requires a tool to place them. For example, the player can't place an oak log directly, but if they click using the specific tool and there's a log in the hotbar, the log will be placed using that tool. Note: I've never made a datapack before and I don't even know if what I want is possible. Sorry, the English is a translation.

Continue to help post