Thanks to GreenDimond and Linuxdirk, the correct method is:
To remove the old recipe:
Code: Select all
minetest.clear_craft({output = "mod_name:node_name"})
Code: Select all
minetest.register_craft({
output = "mod_name:node_name",
recipe = {
{new recipe},
}
})
Example of the recipe to be redefined:
Code: Select all
minetest.register_craft({
output = "mod_name:node_name",
recipe = {
{"default:dirt", "default:stone",},
}
})
Code: Select all
minetest.override_item("mod_name:node_name", {
recipe = {
{"default:gold", "default:silver",},
}
})
From the lua_api.txt (v0.4.16):
--- quote start
* `minetest.override_item(name, redefinition)`
* Overrides fields of an item registered with register_node/tool/craftitem.
* Note: Item must already be defined, (opt)depend on the mod defining it.
* Example: `minetest.override_item("default:mese", {light_source=LIGHT_MAX})`
--- quote end
Given that the registration method isn't register_node/tool/craftitem, it isn't possible to redefine such a recipe using minetest.override_item; if I have understood it correctly.
Any hints/help please?