Claude/farm zone management system m t hw3#30
Merged
Conversation
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
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.
No description provided.