Skip to content

Configurable Enchantments

JohnSmith474 edited this page Sep 20, 2026 · 1 revision

Enchantment Core intercepts Minecraft's core Enchantment codec to allow static properties to be substituted with dynamic Config Overhauled wrappers.

Supported Injection Targets

JSON Key Target Data Type Wrapper Type
max_level Primitive Integer Primitive Wrapper
weight Primitive Integer Primitive Wrapper
anvil_cost Primitive Integer Primitive Wrapper
min_cost Cost Object Cost Object Wrapper
max_cost Cost Object Cost Object Wrapper
supported_items Item Set Item Set Wrapper
primary_items Item Set Item Set Wrapper
slots Slot List Slot List Wrapper

Wrapper Schemas

Primitive Wrapper

Targets: max_level, weight, anvil_cost

Property Type Required Default Description
config ConfigDescription Yes - Runtime configuration target.
fallback Integer Yes - Static fallback value.

Template:

{
  "config": {
    "mod_id": "target_mod",
    "category": "balance",
    "group": "enchantments",
    "property": "value"
  },
  "fallback": 5
}

Cost Object Wrapper

Targets: min_cost, max_cost

Property Type Required Default Description
base Integer OR Primitive Wrapper Yes - Level 1 baseline cost.
per_level_above_first Integer OR Primitive Wrapper Yes - Incremental cost per level.

Template:

{
  "base": {
    "config": {
      "mod_id": "target_mod",
      "category": "costs",
      "group": "enchantment_name",
      "property": "base_cost"
    },
    "fallback": 1
  },
  "per_level_above_first": {
    "config": {
      "mod_id": "target_mod",
      "category": "costs",
      "group": "enchantment_name",
      "property": "per_level_cost"
    },
    "fallback": 11
  }
}

Item Set Wrapper

Targets: supported_items, primary_items

Property Type Required Default Description
config ConfigDescription Yes - Runtime configuration target.
fallback String OR List<String> Yes - Static fallback item/tag identifiers.

Template:

{
  "config": {
    "mod_id": "target_mod",
    "category": "equipment",
    "group": "enchantment_name",
    "property": "supported"
  },
  "fallback": [
    "#minecraft:swords",
    "minecraft:axe"
  ]
}

Slot List Wrapper

Targets: slots

Property Type Required Default Description
config ConfigDescription Yes - Runtime configuration target.
fallback String OR List<String> Yes - Static fallback equipment slot groups.

Template:

{
  "config": {
    "mod_id": "target_mod",
    "category": "equipment",
    "group": "enchantment_name",
    "property": "active_slots"
  },
  "fallback": [
    "mainhand",
    "offhand"
  ]
}

Orphaned Configurations

Trigger: Target mod_id is unloaded or lacks a registered ConfigManager.

Behavior: System adopts properties into Enchantment Core's configuration registry and alerts permission level 2+ operators in-game.

Adoption Mapping:

  • Mod ID: enchantment_core
  • Category: orphans
  • Group: <original_mod_id>.<original_category>
  • Property: <original_group>.<original_property>

Example Transformation: example_mod:balance.weapons.damage_multiplier -> enchantment_core:orphans.example_mod.balance.weapons.damage_multiplier


Datapack Utility Commands

Enchantment Core provides in-game server commands (requiring permission level 2+) to automatically mass-convert enchantment JSON files, significantly speeding up datapack creation.

Import Command

Automatically injects dynamic configuration wrappers into all enchantments within a specific namespace, mapping their properties to a target ConfigManager.

Syntax: /enchantment_core import <source_namespace> <target_namespace>

  • source_namespace: The registry namespace of the enchantments you want to modify (e.g., minecraft, my_mod).
  • target_namespace: The mod ID of the target configuration registry where the dynamic properties should be bound.
  • Output: Generates fully configured JSON files in your server/client directory at: enchantment_core/import/<source_namespace>/enchantment/

Export Command

Strips all dynamic configuration wrappers from enchantments within a specific namespace, flattening them back into pure, vanilla-compliant static JSON files based on their current runtime/fallback values.

Syntax: /enchantment_core export <source_namespace>

  • source_namespace: The registry namespace of the enchantments you want to strip wrappers from.
  • Output: Generates static vanilla JSON files in your server/client directory at: enchantment_core/export/<source_namespace>/enchantment/

Clone this wiki locally