Skip to content

add durability as an alias for data - #297

Open
muhdfdeen wants to merge 2 commits into
HelpChat:mainfrom
muhdfdeen:durability
Open

add durability as an alias for data#297
muhdfdeen wants to merge 2 commits into
HelpChat:mainfrom
muhdfdeen:durability

Conversation

@muhdfdeen

Copy link
Copy Markdown

Adds a durability option to has item requirement type to check an item's durability.

Example:

click_requirement:
  requirements:
    has_elytra:
      type: has item
      material: ELYTRA
      durability: 432

@BlitzOffline

Copy link
Copy Markdown
Member

Hello,

It is already possible to check an item's durability using the data option. If you wish, you can add durability as an alternative, but just at the config level.

                    wrapper.hasData(c.contains(rPath + ".data") && c.isInt(rPath + ".data"));
                    wrapper.setData((short) c.getInt(rPath + ".data", 0));
                    wrapper.hasData(c.contains(rPath + ".durability") && c.isInt(rPath + ".durability"));
                    wrapper.setData((short) c.getInt(rPath + ".durability", 0));

Remove all the other code checking durability.

@BlitzOffline BlitzOffline left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've mentioned above what needs to change. Marking this as request changes for notification.

@muhdfdeen

Copy link
Copy Markdown
Author

I've updated durability to be an alias for data and reverted the other files as requested. Sorry for the delay!

@muhdfdeen muhdfdeen changed the title add durability check in item requirement add durability as an alias for data Aug 18, 2026
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.

2 participants