====== OnPreCrafting hook callback function ======
OnPreCrafting() is called when a player changes contents of their crafting grid, before the built-in recipes are searched for a match by MCServer. Plugins may use this hook to provide a custom recipe

If you intend to tweak built-in recipes, use the [[API:plugin:OnPostCrafting|OnPostCrafting]]() hook, because that will be called once the built-in recipe is matched.

===== Function signature =====
<code lua>
function OnPreCrafting(Player, CraftingGrid, Recipe)
</code>
Parameters:
| Player | [[API:cPlayer|cPlayer]] | The player who has changed the crafting grid contents |
| CraftingGrid | [[API:cCraftingGrid|cCraftingGrid]] | The new crafting grid contents |
| Recipe | [[API:cCraftingRecipe|cCraftingRecipe]] | The recipe that MCServer will use. Modify this object to change the recipe |

===== Return values =====
If the function returns false or no value, other plugins' callbacks are called and then MCServer searches the built-in recipes. The Recipe output parameter is ignored in this case.

If the function returns true, no other callbacks are called for this event and MCServer uses the recipe stored in the Recipe output parameter.

===== Registering the callback =====
To register your plugin to receive a callback through this function, use the hook [[api:plugin:hooks|HOOK_PRE_CRAFTING]]
<code lua>
cPluginManager:Get():AddHook(Plugin, cPluginManager.HOOK_PRE_CRAFTING);
</code>
