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

Call PlayerItemDamageEvent for tridents #11899

Merged
merged 1 commit into from
Jan 12, 2025

Conversation

notTamion
Copy link
Contributor

fixes #11655
pre hardfork #11716

@notTamion notTamion requested a review from a team as a code owner January 4, 2025 10:51
@lynxplay
Copy link
Contributor

lynxplay commented Jan 4, 2025

I am unsure if breaking actually works here given that LivingEntity#onEquippedItemBroken isn't called if the item breaks.
Might be better to just not allow breaking. Needs investigation.

@kennytv kennytv added the type: bug Something doesn't work as it was intended to. label Jan 5, 2025
@notTamion
Copy link
Contributor Author

so all it seems to do is send the breaking packet to the client and removing modifiers from the itemstack (which i am not sure is necessary? considering its breaking anyways). using setDamage(reallyhighnumber) when throwing the trident without riptide it just gets stuck in the ground and can't be picked up anymore which i guess is to be expected, when using with riptide it just breaks but still gives you the boost. not sure whether disallowing breaking the trident, changing the onBreak Consumer or just leaving it as is is the best option
not allowing it to break would be kind of an inconsistency tho (copy pasted from discord incase you missed it)

@lynxplay lynxplay force-pushed the call-pide-trident-hf branch from f18ab9b to 954f66a Compare January 12, 2025 23:21
@lynxplay
Copy link
Contributor

For now, the event won't allow for breaking the itemstack, mostly because doing so is down the line upkeep to ensure no caller expects the item to remain.

If people end up requesting this specific feature, we can revisit this and potentially enable this, but util we have requests it isn't worth the upkeep.

@Machine-Maker Machine-Maker merged commit ab1b312 into PaperMC:main Jan 12, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something doesn't work as it was intended to.
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

Riptiding does not call PlayerItemDamageEvent
4 participants