Skip to content

Added support for the new CustomModelDataComponent #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

BlitzOffline
Copy link
Member

@BlitzOffline BlitzOffline commented May 2, 2025

Adds a new per item option model_data_component. It makes use of the new CustomModelDataComponent API introduced by Spigot in 1.21.4 as a response to the custom model data changes made by Mojang.

Example of usage:

items:
  test:
    material: dirt
    slot: 0
    model_data_component:
      strings: ["string1", "string2"]
      floats: [1, 2, 3]
      flags: ["true", "false", "true"]
      colors: ["255, 255, 255", "0, 0, 0"]

It will work with the has item requirement. Since it is now a component, it will be an unstrict check. If all the specified values exist in the checked item, it will be considered valid even if it contains more elements than the ones specified.

Closes #165

Tested by:

  • zenkokasai in discord
    • Tested the floats option with placeholders.

Note: The old model_data option will continue to work.

@BlitzOffline BlitzOffline marked this pull request as ready for review May 3, 2025 14:43
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.

[Suggestion] Support item_model and 1.21.4 custom_model_data component changes
1 participant