Repository navigation
Conversation
Inline ItemPotion.h-equivalent resolution in CraftThrownPotion.getEffects. Co-authored-by: xii69 <xii69@yahoo.com>
cursor
Bot
force-pushed
the
fix/thrown-potion-custom-effects
branch
from
October 14, 2026 21:18
cd773ca to
eae91bb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
When a splash potion actually hits, the server already honors
CustomPotionEffectsNBT (ItemPotion#h). ButCraftThrownPotion.getEffects()only used damage-value brew effects, so plugins reading the Bukkit API saw the wrong effects for custom potions.What this changes
Resolve effects the same way splash does: if
CustomPotionEffectsis present, use that (it replaces damage-value effects, including empty custom lists); otherwise fall back to damage-value. Helper:ThrownPotionEffects.Why this is needed
API and gameplay were inconsistent. Plugins (and anything checking effects before splash) could make wrong decisions in PvP or custom potion setups.
Testing
ThrownPotionEffectsTest7/7; server tests green; package OK.