Skip to content

Claude/farm zone management system m t hw3#30

Merged
Sharkblack3D merged 5 commits into
mainfrom
claude/farm-zone-management-system-mTHw3
Apr 29, 2026
Merged

Claude/farm zone management system m t hw3#30
Sharkblack3D merged 5 commits into
mainfrom
claude/farm-zone-management-system-mTHw3

Conversation

@Sharkblack3D
Copy link
Copy Markdown
Collaborator

No description provided.

claude added 5 commits April 29, 2026 11:14
HIGH was insufficient if WorldGuard or another plugin also runs at HIGH.
HIGHEST guarantees our handler runs last and the setCancelled(false) sticks.

https://claude.ai/code/session_01QRahgKn43HbgkmDkQZCq9Z
WorldGuard listens at HIGH with ignoreCancelled=true and sends the deny
message only when it processes the event. Two-stage fix:

1. LOWEST: cancel early — WorldGuard skips the already-cancelled event,
   so the "Sorry, but you can't harm that here." message is never sent.
2. HIGHEST: re-allow — after all protection plugins, un-cancel so the
   damage is actually applied to the tracked mob.

https://claude.ai/code/session_01QRahgKn43HbgkmDkQZCq9Z
…s perm

Previous approach (LOWEST cancel only) works when the blocking plugin uses
ignoreCancelled=true. For plugins that use ignoreCancelled=false (or forks
of WorldGuard), the cancel is ignored and the message is sent anyway.

Combined fix:
1. LOWEST: cancel early (handles ignoreCancelled=true case)
2. LOWEST: grant worldguard.region.bypass.<world> temporarily (handles
   ignoreCancelled=false — the plugin reads the bypass perm and skips)
3. HIGHEST: un-cancel to apply damage + remove temp perm attachment

https://claude.ai/code/session_01QRahgKn43HbgkmDkQZCq9Z
Two-stage event approach without PermissionAttachment manipulation:
cancel at LOWEST (so WorldGuard skips via ignoreCancelled=true),
re-allow at HIGHEST so damage is applied.

https://claude.ai/code/session_01QRahgKn43HbgkmDkQZCq9Z
Switch MobDamageListener from cancel/uncancel dance (which still let WG send
the deny message inline) to a scoped permission bypass: grant
worldguard.region.bypass.<world> at LOWEST, remove at MONITOR. The bypass
exists only for one synchronous damage event, so the player has no special
permissions outside the check.

Targets are filtered to Mob instances, skipping Citizens NPCs (NPC metadata),
players (PvP stays under WG), and non-mob entities (armor stands, etc.).

https://claude.ai/code/session_01QRahgKn43HbgkmDkQZCq9Z
@Sharkblack3D Sharkblack3D merged commit e8ec108 into main Apr 29, 2026
2 checks passed
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