Is your feature request related to a problem? Please describe.
There currently isn't an obvious way to detect nor prevent players clicking on an item in the recipe book, which moves items from the crafting slots to the main inventory in the process.
Describe the solution you'd like
A new cancellable event (RecipeBookClickEvent?) that is fired as a result of receiving PacketPlayInAutoRecipe or in the AutoRecipe classes, that can:
Describe alternatives you've considered
An alternative is a permission to disable this - Spigot had minecraft.autocraft briefly, but this was removed.
Another alternative would be to fire events when the individual items are moved around the inventory, though I'm not sure if there are any existing events that would be suitable for this?
Additional context
The lack of any events for this occurred to me while investigating EssentialsX/Essentials#1289, which is a duplication exploit caused by how EssentialsX's /recipe command works. The command places the items of the recipe into a crafting table inventory, and the plugin then blocks any inventory clicks until the player closes the inventory to stop players obtaining the items. However, clicking on a recipe book recipe moves all the items to the inventory without firing any events, allowing the player to keep the items that would normally disappear when closing the /recipe inventory.
@md678685 The permission was a temporary patch for a dupe that why it was removed in the 1.13.1 update commit which fixed this dupe.
@0-x-2-2 It was removed in 1.12.1. In addition, this didn't fix the separate dupe caused by plugins that try to block inventory events (like Essentials with /recipe).