Skip to content

Mods for NeoForge and Fabric

Porting from NeoForge and Forge

Obsidian's mod system is close to NeoForge's (see the mod system), and a mod's data in vanilla's formats works on Obsidian as it is. Obsidian.Porting converts what NeoForge reads differently, so a mod's data and metadata move over in one step:

dotnet run --project Obsidian.Porting -- <mod folder or jar> <output folder>

The tool reads mods for NeoForge 26.3 (Minecraft 26.3, which Obsidian targets) as well as older Forge and NeoForge formats.

The input is the mod's jar, or a folder laid out like it (say, src/main/resources). The output folder, which must be new or empty, gets the files an Obsidian plugin ships besides its assembly (see plugin-archives.md), and porting-report.txt, which the tool also prints. The tool exits with an error when it could write nothing:

Mod's file Output
META-INF/neoforge.mods.toml (or mods.toml) obsidian.mod.json
data/<ns>/neoforge/biome_modifier/*.json data/<ns>/biome_modifier/*.json, Obsidian's biome modifiers
data/<ns>/forge/biome_modifier/*.json Same conversion for Forge and early NeoForge mods
Other data/ and assets/ files Copied unchanged
Data only NeoForge reads, Java code, everything else Left out and reported

Metadata

obsidian.mod.json follows neoforge.mods.toml's field names, so the first [[mods]] entry maps directly: modId, version, displayName, authors (split at commas), description and displayURL (as projectUrl). A version of ${file.jarVersion} takes the jar's Implementation-Version; another placeholder is reported and written as 1.0.0. Its [[dependencies.<modId>]] keep their modId, type (or the older mandatory), versionRange, ordering and side, except those on neoforge, forge and minecraft, which Obsidian is. assembly, which NeoForge doesn't have, is the mod id in Pascal case: make it the C# plugin's assembly. Other fields, like license, logoFile or [[mixins]], are reported.

Biome modifiers

Every NeoForge biome modifier type converts to an Obsidian modifier (see Biome modifiers):

NeoForge Obsidian
neoforge:add_features (features, step) add.features of the step
neoforge:remove_features (features, optional steps) remove.features, of the steps or of every step
neoforge:add_spawns (spawners) add.spawners
neoforge:remove_spawns (entity_types) remove.spawners
neoforge:add_carvers, remove_carvers (carvers) add.carvers, remove.carvers; a carving step is ignored, as 1.21.11 has none
neoforge:add_spawn_costs (entity_types, spawn_cost) add.spawn_costs, by entity type
neoforge:remove_spawn_costs (entity_types) remove.spawn_costs
neoforge:none Left out: it does nothing

Forge-era types use the same converter and fields:

Forge Equivalent NeoForge type
forge:add_features (features, step) neoforge:add_features
forge:remove_features (features, optional steps) neoforge:remove_features
forge:add_spawns (spawners, with minCount/maxCount) neoforge:add_spawns
forge:remove_spawns (entity_types) neoforge:remove_spawns
forge:none neoforge:none
forge:any, forge:and, forge:or, forge:not Corresponding neoforge: holder sets, with the limits below

Both formats' variants are read: remove_features.steps as one step, a list or nothing (every step); spawners as one object or a list, with 26.3's count or the older minCount/maxCount. Unknown modifier and holder set types are reported.

biomes becomes Obsidian's biomes and exclude. Identifiers, tags and lists stay as they are, or becomes a list, and an and of one set with nots becomes that set with the rest in exclude. The tool doesn't know what tags hold, so some sets can't be expressed and are reported and left out:

  • every biome (neoforge:any, or a not on its own);
  • an intersection of two listed sets;
  • an or of nots that depends on what tags hold, like or[not #a, not #b] or or[not #a, minecraft:plains].

Features, carvers and entity types must be listed sets. Spawn costs can't be given to an entity type tag, since Obsidian keys them by type.

A few results differ from NeoForge, and the report notes them:

  • NeoForge's add_spawn_costs and remove_spawn_costs apply in every biome, whatever their biomes say. Converted costs keep to the modifier's biomes; list every biome they should change in to match.
  • Added features and carvers that join a tag with other entries may be added twice where NeoForge adds them once.
  • Modifiers with neoforge:conditions, forge:conditions or legacy conditions are left out, since Obsidian doesn't read load conditions.

Consecutive modifiers in one namespace with the same biomes are merged into one file, named after the first. What they generate stays the same.

What's left out

  • The mod's Java code. Obsidian's API is C#, and its systems are Obsidian's own rather than NeoForge's classes, so blocks, items, entities, menus, events, commands and network payloads are written again as an Obsidian plugin (see Blocks and items and Entities). The report counts the .class files.
  • NeoForge's own data: data maps (data_maps/), global loot modifiers (loot_modifiers/), structure modifiers (neoforge/structure_modifier/) and anything else under data/<ns>/neoforge/ or data/neoforge/, including their Forge counterparts under data/<ns>/forge/ or data/forge/.
  • Data files with neoforge:conditions, forge:conditions or legacy conditions.
  • Everything outside data/ and assets/: pack.mcmeta, mixin configs, access transformers, logos.

Tags need nothing: Obsidian reads NeoForge's remove lists and the shared c: tags. Copied files Obsidian doesn't read yet, like recipes or loot tables, are harmless.

On this page