Skip to content

Fix obsidian scoop lava/obsidian dupe by re-validating before giving lava - #3098

Merged
tastybento merged 1 commit into
developfrom
fix/obsidian-scoop-revalidate
Oct 3, 2026
Merged

tastybento merged 1 commit into
developfrom
fix/obsidian-scoop-revalidate

Conversation

@tastybento

@tastybento tastybento commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Problem

An admin reported a lava dupe on BSkyBlock (3.22.3). ObsidianScoopingListener checks the obsidian and the bucket on the right-click, then hands out the lava one tick later in givePlayerLava. That delayed step re-checked nothing:

  • If the obsidian was mined within that tick, the player kept the obsidian drop and got the lava bucket.
  • It decremented the ItemStack captured from the event. If the bucket had been moved out of the hand in the meantime, lava could be given without using up a bucket.

The listener is unchanged between 3.22.3 and develop.

Fix

givePlayerLava now re-checks before doing anything, and does nothing if any check fails:

  • the player is still online;
  • the block is still obsidian;
  • the hand that clicked still holds an empty bucket. The bucket is read fresh from that hand slot instead of using the stale event item.

The "scooping" message and the lava sound moved into givePlayerLava, so they only play when lava is actually given. The 1-minute cooldown is still applied at click time, so a cancelled attempt still costs the cooldown.

Testing

  • New unit tests for the success path, obsidian gone, bucket no longer in hand, and player offline. All worldsettings listener tests pass; I didn't run the full suite.
  • Deployed to a local 26.3 test server.

🤖 Generated with Claude Code

The lava bucket is handed out one tick after the interact event, but
that deferred step re-checked nothing. Mining the obsidian inside that
tick gave the player both the obsidian and the lava, and moving the
bucket out of the hand let the lava be given without using a bucket.

givePlayerLava now confirms the player is online, the block is still
obsidian and the hand still holds an empty bucket, reading the bucket
fresh from the hand slot. The scooping message and sound move into it
so they only play when lava is actually given.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tastybento
tastybento merged commit 0e8d517 into develop Oct 3, 2026
1 check passed
@tastybento
tastybento deleted the fix/obsidian-scoop-revalidate branch October 3, 2026 15:18
@sonarqubecloud

sonarqubecloud Bot commented Oct 3, 2026

Copy link
Copy Markdown

@tastybento tastybento mentioned this pull request Oct 3, 2026
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.

1 participant