tom5454 / Create-Ore-Excavation

Extract resources using machines powered by Rotational Force
https://www.curseforge.com/minecraft/mc-mods/create-ore-excavation
MIT License
16 stars 20 forks source link

Using KubeJS to modify vein spawn rates #98

Closed The-Shortman closed 3 months ago

The-Shortman commented 3 months ago

I am attempting to completely remove certain ore veins with KubeJS on version 1.20.1, however I can't find a way to access the IDs of the ore veins to remove them with ServerEvents.recipes.remove(), and there appears to be no config for modifying spawn rates. If you could provide documentation on the README file for removing veins with Kube then I'd greatly appreciate it.

The-Shortman commented 3 months ago

I've experimented a bit and I've found the solution for anyone running into this problem in the future:

You can use the /coe locate <ore vein> command to list all available ore vein IDs.

Then you can do the following to remove the ore vein from the game with KubeJS. Modifying can be done just be re-adding it and changing the generation values:


ServerEvents.recipes(e => {
    [
        // Example of removing an ore vein and its associated recipe
        {id: 'createoreexcavation:ore_vein_type/coal'}, // Replace 'ore_vein_type/coal' with the ore vein you want to remove
        {mod: 'createoreexcavation', output: 'minecraft:coal'}, // Replace 'minecraft:coal' with the corresponding product of the vein

        // Example of removing a fluid vein and its associated recipe
        {id: 'createoreexcavation:ore_vein_type/water'}, // Replace 'ore_vein_type/water' with the fluid vein you want to remove
        {mod: 'createoreexcavation', output: Fluid.of('minecraft:water')}, // Fluid.of(<fluid>) is required for identifying fluids
    ].forEach((recipe => {
        e.remove(recipe)
    }))
})