Conversation
Notices
-
Embed this notice
Duskhorn (duskhorn@packetloss.social)'s status on Saturday, 19-Nov-2022 20:08:18 JST Duskhorn
Adventures into #minetest modding and omg it's pretty cool and straightforward.
I have an idea for a little toy mod but sadly what's blocking me it's one and one thing
How do I add custom type of recipes?
Let's say I wanted to make a 4×4 workbench. How do I manage that?
Looking at examples and existing code in the Technic mod (very good mod) didn't help that much, sadly
#mod #modding #minetest #help- arcanicanis likes this.
-
Embed this notice
arcanicanis (arcanicanis@were.social)'s status on Sunday, 20-Nov-2022 14:48:46 JST arcanicanis
I think the base game goes up to 3x3, whereas normally you'd register a craft recipe using minetest.register_craft:
https://rubenwardy.com/minetest_modding_book/en/items/nodes_items_crafting.html#crafting
For 4x4, you'll have to instead make a workbench with it's own separate craft system. Register a craft recipe to make the custom workbench (would have to be within 3x3), and then for that custom node, have it spawn a form on right-click, and probably use your own logic to scan and see if what's on the table matches a recipe, and so on. I'm sure it's something that'll probably be at minimum like 150 lines or so, just for a separate custom recipe system.
There's the source code for the MineClone 'crafting bench' for a starting point:
https://git.minetest.land/MineClone5/MineClone5/src/branch/master/mods/ITEMS/mcl_crafting_table/init.lua
As an aside, there is also a Minetest announcements account on fedi:
https://fosstodon.org/users/Minetest