Skip to content

add durability check in item requirement - #297

Open
muhdfdeen wants to merge 1 commit into
HelpChat:mainfrom
muhdfdeen:durability
Open

add durability check in item requirement#297
muhdfdeen wants to merge 1 commit 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.

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