Fix: InvincibleVisitors mob-targeting protection incorrectly blocks XP orbs from tracking visitors#2948
Merged
tastybento merged 2 commits intodevelopfrom Apr 18, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/BentoBoxWorld/BentoBox/sessions/19b02680-6fb9-456c-9cae-a1c06b2d716b Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue allowing visitors to pick up XP on islands
Fix: InvincibleVisitors mob-targeting protection incorrectly blocks XP orbs from tracking visitors
Apr 18, 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.



EXPERIENCE_PICKUPflag set to Visitor rank had no effect — visitors still couldn't pick up XP on other islands when Invincible Visitors was enabled withENTITY_ATTACK.Root Cause
InvincibleVisitorsListener.onVisitorTargeting(HIGHESTpriority) cancelsEntityTargetLivingEntityEventfor any entity targeting a visitor not on their own island. Experience orbs use this same event to home in on players, so they were caught by the mob-targeting suppression — orbs never flew toward visitors, making pickup effectively impossible.Fix
InvincibleVisitorsListener: Skip cancellation whene.getEntity() instanceof ExperienceOrb. XP orbs can't harm players; theEXPERIENCE_PICKUPflag onPaperExperiencePickupListener/ExperiencePickupListeneralready governs whether pickup is actually allowed.InvincibleVisitorsListenerTest: Added tests covering mob targeting cancellation, XP orb targeting (must not cancel), noENTITY_ATTACKin IV settings, and island-owner (non-visitor) path.