Skip to content
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

Fix ItemDamageEvents called for 0 damage #11555

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

notTamion
Copy link
Contributor

@notTamion notTamion requested a review from a team as a code owner November 1, 2024 16:31
@Lulu13022002
Copy link
Contributor

This break negative damage amount that is possible with enchantment component. I'm not sure if the event/api should run in this case too.

@notTamion
Copy link
Contributor Author

For later:

  1. do we want the event to be called in case of negative damage?
  2. should we allow setDamage and other methods which damage the itemstack to deal negative damage? as this might break some plugins that are relying on those methods not being able to deal negative damage

@lynxplay
Copy link
Contributor

Changed this for the following logic:

Neither damage event will be called for non-positive damage.
This 100% preserves old behaviour.
Negative or zero damage is still processed, however no events will be emitted, as this isn't a damage, this would be "repairing" the item.

How and if such a usecase should be represented via the API is up for later discussion, but should not be a blocked for ensuring the existing API maintains backwards compatibility.

@notTamion
Copy link
Contributor Author

Yeah that sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Awaiting review
Development

Successfully merging this pull request may close these issues.

3 participants