How can you detect when a player hits a block in Adventure Mode [version 1.16.5] in Minecraft?

How can you detect when a player hits a block in Adventure Mode [version 1.16.5] in Minecraft? - Man in Black Jacket Sitting on Block

In Minecraft, I am trying to make a map in Adventure Mode where you sell/buy trees. I want to be able to detect whenever a player has punched an oak log in Adventure Mode, and then it would automatically break the log. How would I go about doing this? I don't want to use any data packs/plugins.






Pictures about "How can you detect when a player hits a block in Adventure Mode [version 1.16.5] in Minecraft?"

How can you detect when a player hits a block in Adventure Mode [version 1.16.5] in Minecraft? - Confident adult Hispanic male traveler in sunglasses and casual clothes with backpack opening can of drink while walking along pavement against blurred cars driving along street and empty crosswalk in downtown
How can you detect when a player hits a block in Adventure Mode [version 1.16.5] in Minecraft? - Cheerful young woman in sunglasses standing on rocky ground among multicolored huge ice blocks during trip to north
How can you detect when a player hits a block in Adventure Mode [version 1.16.5] in Minecraft? - Woman admiring view of gigantic ice chunks





How to PLACE and DESTROY blocks in Minecraft ADVENTURE MODE! (Tutorial, 1.16+ (Java))




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Lisa, Andrea Piacquadio, ArtHouse Studio, ArtHouse Studio