Skip to content

Add item_model data component support for tokens#123

Open
PurpleGale wants to merge 1 commit intohyperdefined:masterfrom
PurpleGale:item-model-support
Open

Add item_model data component support for tokens#123
PurpleGale wants to merge 1 commit intohyperdefined:masterfrom
PurpleGale:item-model-support

Conversation

@PurpleGale
Copy link
Copy Markdown

This PR adds support for the new Minecraft item_model data component (introduced in 1.21.4) to the token system, while fully preserving the existing custom_model_data functionality.

Changes

  • TokenData.java — Reads the new item-model config block and applies it via DataComponentTypes.ITEM_MODEL using a validated NamespacedKey.
  • config.yml — Adds item-model.enabled and item-model.value under every token entry.
  • ToolStats.java — Bumps CONFIG_VERSION from 17 to 18.
  • ConfigUpdater.java — Wires up the 17 → 18 migration path.
  • Version18.java (new) — Config updater that injects item-model defaults into existing user configs during automatic migration.

Backward Compatibility

  • Existing custom-model-data behavior is completely untouched.
  • Both custom-model-data and item-model can be used independently or together.
  • Old configs are automatically migrated to version 18 on first load.

Usage Example

tokens:
  data:
    player-kills:
      item-model:
        enabled: true
        value: "nexo:my_custom_token"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant