Skip to content

Conversation

@goul4rt
Copy link

@goul4rt goul4rt commented Jan 15, 2026

This PR implements height-based protection for claimed chunks, allowing server administrators to configure a minimum Y coordinate below which blocks are not protected. This feature enables more flexible claim protection, particularly useful for allowing public access to underground areas while maintaining protection for surface structures.

Core Features

  • Height-based protection: Blocks below a configurable minimum Y coordinate are not protected by claims
  • Admin command: Added /scp admin-set-min-height <height> command to configure the minimum protection height
  • Default value: Minimum protection height defaults to 0 (entire chunk protected by default)

Implementation Details

New Components

  • InteractionResult class: New result type that distinguishes between permission-based blocks and height-based blocks, providing better error messaging
  • Configuration option: Added MinProtectionHeight to SimpleClaimsConfig with getter/setter methods

Updated Systems

All event systems have been updated to respect the minimum protection height:

  • BreakBlockEventSystem - Block breaking protection
  • PlaceBlockEventSystem - Block placement protection
  • InteractEventSystem - Block interaction protection
  • PickupInteractEventSystem - Item pickup protection
  • CustomDamageEventSystem - PVP damage protection

Admin Command

/scp admin-set-min-height <height>

Sets the minimum Y coordinate where blocks will be protected. Blocks below this height are not protected by claims.

Examples:

  • /scp admin-set-min-height -20 - Only protect blocks at Y >= -20
  • /scp admin-set-min-height 0 - Protect entire chunk (default)
  • /scp admin-set-min-height 64 - Only protect blocks above sea level

Behavior

  • When a player tries to interact with a block at Y >= MinProtectionHeight in a claimed chunk, normal claim protection applies
  • When a player tries to interact with a block at Y < MinProtectionHeight, the interaction is allowed regardless of claim status
  • Players receive clear error messages indicating when a block is protected due to height restrictions

…uration of a minimum protection height. Added admin command `/scp admin-set-min-height <height>` to set this height. Updated language support for error messages and added Portuguese (Brazil) translations. Updated version to 1.0.11.
… height-based protection control, the new admin command for setting minimum height, and the inclusion of Portuguese (Brazil) language support.
@goul4rt goul4rt force-pushed the feature/admin-set-min-height branch from 655dcd9 to 02bb2b6 Compare January 15, 2026 17:00
@averyhudsonmobile
Copy link

Can we please validate this and get it added to main? It looks like it was meant to be merged, but the current version doesn't have it, nor is it mentioned anywhere in Patch notes.

Thanks

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