There is a way, but it isn't as simple as I would prefer it to be. You have to go into the Lua files for whatever mod adds the ores (in minetest_game, this means the mod "default"), and look for calls to minetest.register_ore(). Ignore stuff like clay because that probably isn't what you are wanting to modify, since it technically isn't an "ore", it just uses the ore generation system for its generation. Eventually you will find some calls that look like this:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 8 * 8 * 8,
clust_num_ores = 8,
clust_size = 3,
y_min = -31000,
y_max = 64,
})
There are 3 things you can change in order to increase the abundance.
"clust_scarcity" is the chance that the ore cluster will generate inside a chunk; it is a number value usually represented by multiplying 3 numbers that are the same, to get one really big number that is basically the "cube" of one of the numbers. In the case with the first coal ore, the numbers are all "8", so the chance is 512 (higher number = less ore per chunk). You can change this to something like 7*7*7 (343), or just fill in some number like 300 or 256 (I'm not sure if non-square numbers break something, so you'll have to be careful and test this in a test world before committing the changes to a server or something).
"clust_size" is the size of one side of the cluster; to determine how many ore nodes will fit into the maximum volume of a cluster, this number is cubed - so a clust_size of 3 can fit up to 27 nodes of the ore, and not any more. You usually want the clust_size to be high enough there is still plenty of room for stone inside the cluster, making it look more like a deposit instead of just a cube - but it isn't really necessary to make room for some stone, unless you just want to. It's kinda an aesthetics thing (if the clust_size were reduced to 2, the default number of ore nodes would make it a cube of 8 coal ore nodes).
"clust_num_ores" is the number of ore-nodes per cluster; if this meets or exceeds the cube of clust_size, all of the ore will be in a cube-shaped deposit, which usually isn't preferable, and any more than the cube of clust_size overflows the volume of clust_size, so only what fits into clust_size is really generated. So when clust_size is 3 as in the first coal ore, clust_num_ores should be less than 27 (it is 8). I think that 8 is pretty low for a 3^3 region of space, so you could increase it to 16 or 18 for there to be more ore per cluster.
The reason it isn't preferable to change it this way, is that you have to modify all of those values for all of the ore definitions manually, and there is a lot of scrolling involved in getting to wherever the next minetest.register_ore() call is located. I'm working on a mod which wraps around the minetest.register_*() calls for stuff like items, nodes, tools, ores and crafting recipes, which reduces the complexity such that you would only have to change the values in a single line of a much shorter function call, that is much shorter than the whole minetest.register_*() call. However, this mod is not yet ready to be released, and it will probably be even longer before it gets integrated into most popular mods, or minetest_game, if ever.
There are 15 minetest.register_ore() calls (of interest; who really wants to add more clay, and fool with all of those noise parameters until you can get it to generate as desired?) in the "default" mod's mapgen.lua file. That's 150 lines of code (135 excluding the closing bracket/parenthesis), instead of just 15 as it could be with that mod I'm working on (who wouldn't want that?). If you have mods which add more ores, such as moreores or technic, this would easily be a lot more, and you would probably want to modify those as well.