mod development - add new ore

Post Reply
suiluj
New member
Posts: 2
Joined: Fri Mar 24, 2023 08:41

mod development - add new ore

by suiluj » Post

Dear MintestForum

I am new so maybe I am overlooking a solution in the forum as I am not searching with the right terms.

I would like to write a new mod which includes different types of coal ores which can then be used to craft different items of different quality. The second part (the crafting and the differences in quality works quite well already)

However, my Lua code to add these new ore types is not working as no new ores are being created in the world (although I could create them by myself in Creative mode), what do I need to change or add to the code?

mintest 5.6.1.
mod-name advanced_coal

Code: Select all

minetest.register_node("advanced_coal:anthracite", {
    description = "Anthracite Coal Ore",
    tiles = {"default_stone.png^default_mineral_anthracite.png"},
    is_ground_content = true,
    groups = {cracky = 3},
    drop = "advanced_coal:anthracite_lump 1",
})

minetest.register_ore({
        ore_type       = "scatter",
        ore            = "advanced_coal:anthracite",
        wherein        = "default:stone",
        clust_scarcity = 8 * 8 * 8,
        clust_num_ores = 8,
        clust_size     = 3,
        y_min          = -31000,
        y_max          = -124,
    })

    

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: mod development - add new ore

by Skamiz Kazzarch » Post

As far as I see there is nothing wrong with the code.
At a guess: Have you set your mod to depend on 'default'?
If not. It is possible that your mod runs before 'default'. And for some reason 'default' clears all registered biomes/ores/decorations. Thus it would invalidate your registration.
If you add a dependency on 'default', even just an optional one, your own mod is guaranteed to run after it, which would fix the issue. If it is indeed caused by this.

PS.: This question belongs into the 'Modding Discussion' section. 'WIP Mods' is for when you already releasing something, even if it's not finished yet.

suiluj
New member
Posts: 2
Joined: Fri Mar 24, 2023 08:41

Re: mod development - add new ore

by suiluj » Post

Thanks
it works now.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests