Skip to content

Instantly share code, notes, and snippets.

@PilzAdam
Last active December 26, 2015 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PilzAdam/7179556 to your computer and use it in GitHub Desktop.
Save PilzAdam/7179556 to your computer and use it in GitHub Desktop.
minetest.register_on_craft(func(itemstack, player, old_craft_grid, craft_inv))
^ Called when player crafts something
^ itemstack is the output
^ old_craft_grid contains the recipe (Note: the one in the inventory is cleared)
^ craft_inv is the inventory with the crafting grid
^ Return either an ItemStack, to replace the output, or nil, to not modify it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment