HomeJavaModsOre Generation Configuration
Ore Generation Configuration
ModsJava

Ore Generation Configuration

by StarGazerDreamBlazer · on CurseForge

⬇ Download on CurseForge

The author built this one for Minecraft 1.21.1 on NeoForge. On other versions it may install and then do nothing.

Ore Generation Configuration

Ore Generation Configuration is a server-side-behavior NeoForge mod for Minecraft 1.21.1 that controls ore block generation in newly generated chunks.

It can deny or reduce vanilla and modded ores. It does not add blocks, items, entities, recipes, or regenerating ore veins.

The mod contains no client gameplay, assets, networking, blocks, items, or entities. It can run on a dedicated server, and it can also run in singleplayer because singleplayer uses an integrated server. Multiplayer clients should not need to install it to join a server that has it, because the server sends the resulting normal chunk data.

Technical Approach

The mod uses NeoForge ChunkEvent.Load and only queues chunks where isNewChunk() is true. On later server ticks it scans those newly generated chunks once, finds configured ore block ids, and replaces matching blocks according to ores.json.

This was chosen over biome modifiers, placed-feature mutation, or mixins because it gives reliable block-level frontier gating across vanilla and modded ores without fragile worldgen hooks.

Limitations:

Config Files

The mod creates:

If a config file fails to parse, the mod logs the problem to latest.log and tells players on login or /ogc reload that the configuration has warnings or errors.

global.json

Example:

{
  "enabled": true,
  "debug_logging": false,
  "dry_run": false,
  "fail_on_unknown_blocks": false,
  "fail_on_unknown_biomes": false,
  "default_keep_chance": 1.0,
  "print_startup_summary": true
}

Fields:

areas.json

Areas are named spatial filters using In Control!-style area semantics.

Supported area types:

Example:

[
  {
    "dimension": "minecraft:overworld",
    "name": "frontier_0",
    "type": "box",
    "x": 0,
    "y": 128,
    "z": 0,
    "dimx": 128,
    "dimy": 256,
    "dimz": 128
  }
]

Area fields:

Examples:

The default areas.json creates frontier boxes centered at 0, 128, 0 with these X/Z half-widths:

Area Half-width
frontier_0 128
frontier_1 224
frontier_2 448
frontier_3 768
frontier_4 1152
frontier_5 1600
frontier_6 2304
frontier_7 3072
frontier_8 4096

ores.json

Each rule targets ore blocks and decides whether matching generated blocks stay or are replaced.

Example:

{
  "id": "deny_iron_before_frontier_2",
  "blocks": [
    "minecraft:iron_ore",
    "minecraft:deepslate_iron_ore"
  ],
  "dimension_whitelist": [
    "minecraft:overworld"
  ],
  "area_whitelist": [
    "frontier_1"
  ],
  "keep_chance": 0.0,
  "replacement": "auto",
  "priority": 20
}

Rule fields:

Filter behavior:

Dimension and biome entries:

Conflict behavior:

Example: a global 50% ore reduction can use priority 100 and keep_chance: 0.5. A frontier-specific rule for the same ore blocks can also use priority 100 with keep_chance: 0.0 and area_whitelist: ["frontier_0"]. Inside frontier_0, the 0% rule wins for its listed blocks. Outside frontier_0, it does not match, so the global 50% rule applies.

Replacement examples:

"replacement": "auto"

auto tries nearby base stone first, then falls back to stone, deepslate, netherrack, or end stone based on context.

"replacement": "nothing"

nothing replaces the ore with air.

"replacement": "minecraft:stone"

A single block id replaces every denied ore with that block.

{
  "replacement": [
    "minecraft:coal_ore",
    "minecraft:deepslate_coal_ore"
  ],
  "weight": [
    1,
    1
  ]
}

A replacement list chooses one replacement block with weighted random selection. If weight is omitted, every replacement has weight 1.

Commands

Reload configuration without restarting:

/ogc reload
/ore_generation_configuration reload

Reloading affects newly generated chunks after the reload. It does not revisit chunks already generated before the reload.

Testing

Suggested test flow:

  1. Start a new world or travel into terrain that has never generated.
  2. Set dry_run to true and debug_logging to true.
  3. Run /ogc reload.
  4. Generate new chunks and check latest.log for dry-run match counts.
  5. Set dry_run to false, reload, and generate fresh chunks.
  6. Inspect ores in denied frontiers.

License

MIT

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more