Skip to content

Don't remove the whole stack after drinking - #218

Open
Nadwey wants to merge 3 commits into
masterfrom
fix/stackable-potions
Open

Don't remove the whole stack after drinking#218
Nadwey wants to merge 3 commits into
masterfrom
fix/stackable-potions

Conversation

@Nadwey

@Nadwey Nadwey commented Jun 4, 2026

Copy link
Copy Markdown
Member

Seems to be working fine after a short test session with clumsy.

Minecraft0122 added a commit to Minecraft0122/BreweryX that referenced this pull request Jul 27, 2026

@Minecraft0122 Minecraft0122 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stacked-potion logic works on current Spigot, but this direct call is not compatible with BreweryX's advertised 1.8.9+ range:

player.getInventory().setItem(event.getHand(), remaining);

PlayerItemConsumeEvent#getHand() was added with the hand-aware constructor in 1.19.2. On older servers the listener will hit a NoSuchMethodError when a custom potion stack is consumed. PlayerInventory#setItem(EquipmentSlot, ...) is also a newer API than the oldest supported versions.

Please resolve the consume hand through a compatibility layer (reflective getHand where present, held-stack fallback otherwise), then use the version-appropriate setItemInMainHand / setItemInOffHand / legacy setItemInHand. I applied and compiled that approach in Minecraft0122/BreweryX@7afa8cf while integrating this PR into the fork.

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