Skip to content

Steel Extractor

The Steel Extractor is a Fabric mod written in Kotlin that runs on a Minecraft server and extracts comprehensive game data into JSON files. It is the primary tool used to generate the data files that Steel relies on.

The mod hooks into the server startup lifecycle and automatically runs all extractors once the server is fully loaded. The output is written to the steel_extractor_output/ directory as pretty-printed JSON.


The extractor registers a SERVER_STARTED event. When the server finishes loading, it iterates through all registered extractors, calls their extract() method, and writes the result to a JSON file.

Every extractor implements the Extractor interface:

interface Extractor {
fun fileName(): String
@Throws(Exception::class)
fun extract(server: MinecraftServer): JsonElement
}

The Minecraft version and all related dependency versions are configured in gradle.properties:

minecraft_version=1.21.11
loader_version=0.18.2
fabric_version=0.139.4+1.21.11
fabric_kotlin_version=1.13.7+kotlin.2.2.21

To update to a new Minecraft version:

  1. Change minecraft_version to the target version
  2. Update fabric_version to a compatible Fabric API version for that Minecraft version
  3. Update loader_version and fabric_kotlin_version if needed
  4. If applicable, update the Parchment mapping version in build.gradle

You can find the correct versions on https://fabricmc.net/develop.


The following table lists all extractors and what data they produce:

ExtractorOutput FileDescription
Blocksblocks.jsonAll blocks with behavior properties, block states, default values, collision and outline shapes
BlockEntitiesblock_entities.jsonRegistry keys of all block entity types
Itemsitems.jsonAll items with components, block references, and class names
Packetspackets.jsonAll serverbound and clientbound packets grouped by protocol phase
MenuTypesmenutypes.jsonAll menu/GUI types (e.g. crafting table, furnace)
Entitiesentities.jsonEntities with dimensions, synched data, attributes, and behavior flags
Fluidsfluids.jsonAll fluids with behavior properties and state data
GameRulesExtractorgame_rules.jsonAll game rules with types, defaults, and bounds
Classesclasses.jsonJava class names for all blocks and items
Attributesattributes.jsonEntity attributes with defaults, ranges, and sync info
MobEffectsmob_effects.jsonStatus effects with categories and colors
Potionspotions.jsonPotions with their effects, durations, and amplifiers
SoundTypessound_types.jsonBlock sound types with volume, pitch, and sound event references
SoundEventssound_events.jsonMapping of all sound event paths to registry IDs
LevelEventslevel_events.jsonAll level event constants (particles, sounds)
Tagstags.jsonBlock and item tags (excluding the minecraft namespace)

Here is a minimal example of how to create a new extractor. This extractor outputs all entity attributes with their default values:

package com.steelextractor.extractors
import com.google.gson.JsonArray
import com.google.gson.JsonElement
import com.google.gson.JsonObject
import com.steelextractor.SteelExtractor
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.server.MinecraftServer
class Attributes : SteelExtractor.Extractor {
override fun fileName(): String {
return "attributes.json"
}
override fun extract(server: MinecraftServer): JsonElement {
val attributesArray = JsonArray()
for (attribute in BuiltInRegistries.ATTRIBUTE) {
val key = BuiltInRegistries.ATTRIBUTE.getKey(attribute)
val name = key?.path ?: "unknown"
val attributeJson = JsonObject()
attributeJson.addProperty("id", BuiltInRegistries.ATTRIBUTE.getId(attribute))
attributeJson.addProperty("name", name)
attributeJson.addProperty("default_value", attribute.defaultValue)
attributesArray.add(attributeJson)
}
return attributesArray
}
}

To register your new extractor, add it to the extractors array in SteelExtractor.kt:

val extractors = arrayOf(
Blocks(),
// ... other extractors ...
Attributes(),
MyNewExtractor() // Add your extractor here
)

After starting the server, the output will appear in steel_extractor_output/attributes.json.