Fix my_island_* placeholders resolving to team island when player is visiting as member#519
Draft
Fix my_island_* placeholders resolving to team island when player is visiting as member#519
Conversation
…members When a player is a team member on another island (with disallow-team-member-islands: false), all my_island_* placeholders were falling back to the team island's data instead of the player's owned island. This was caused by getUsersIsland() returning the non-owned island when the fallback path found 0 or 2+ owned islands via getIslands(). Fix: Replace the getIslands()+filter pattern with getOwnedIslands() which explicitly returns only islands owned by the user, never team islands. Add tests for getLifetime(), getLifetimeByLocation(), and the team member scenario. Agent-Logs-Url: https://github.com/BentoBoxWorld/AOneBlock/sessions/9af3761e-c776-489c-95f0-54e58e03b85e Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix %aoneblock_my_island_lifetime_count% to return player's own island count
Fix my_island_* placeholders resolving to team island when player is visiting as member
May 5, 2026
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.
With
disallow-team-member-islands: false, allmy_island_*placeholders (phase, count, lifetime, etc.) incorrectly returned data for whichever island the player was standing on, rather than the island they own.Root cause:
getUsersIsland()calledgetIslands(world, user)(returns all associated islands, including team ones) and only swappediwhen exactly 1 owned island was found. With 0 owned islands, the fallback silently returned the non-ownedi— the team island.Fix —
AOneBlockPlaceholders.javagetIslands() + stream().filter(owner == uuid)fallback withgetOwnedIslands(world, user), a dedicated BentoBox API that returns only islands the user owns:Tests —
PlaceholdersManagerTest.javatestGetLifetimeandtestGetLifetimeByLocationtestGetLifetimeTeamMember: player whose primary island (viagetIsland) is a team island they're visiting still gets their own island's lifetime count viagetOwnedIslands