Skip to content

Honor CustomPotionEffects in CraftThrownPotion.getEffects() - #193

Open
xii69 wants to merge 1 commit into
Wind-Development:masterfrom
xii69:fix/thrown-potion-custom-effects
Open

xii69 wants to merge 1 commit into
Wind-Development:masterfrom
xii69:fix/thrown-potion-custom-effects

Conversation

@xii69

@xii69 xii69 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

What was wrong

When a splash potion actually hits, the server already honors CustomPotionEffects NBT (ItemPotion#h). But CraftThrownPotion.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 CustomPotionEffects is 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

ThrownPotionEffectsTest 7/7; server tests green; package OK.

Inline ItemPotion.h-equivalent resolution in CraftThrownPotion.getEffects.

Co-authored-by: xii69 <xii69@yahoo.com>
@cursor
cursor Bot force-pushed the fix/thrown-potion-custom-effects branch from cd773ca to eae91bb Compare October 14, 2026 21:18
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