Offline Players
Owner commands should work even if the player is offline.
For example:
/claim remove Steve 1h
should work even if Steve is not online.
Likewise:
/claim transfer Steve Alex
should work when either or both players are offline.
Do not require the player to be currently online.
also we can give claim by using op
/claim give steve 10000
📄
pasted-code-1790765988977.txt
txt
731 lines
▶
# Survival SMP Claim Plugin
Create a complete **Minecraft Paper 1.21.11 / Java 21 claim plugin** designed for a Survival SMP.
The plugin should provide the normal claim features commonly found in Survival SMP claim plugins, while adding a special **temporary claim removal system**.
Do NOT permanently delete a claim when it is temporarily removed.
---
# 1. Claim System
Players should be able to create protected claims using a simple Survival-SMP-friendly system.
Players should be able to:
* Create claims
* Resize claims
* Delete claims
* View their claims
* Protect their builds
* Manage trusted players
* Remove trusted players
* Allow trusted players to build/interact
* Prevent untrusted players from modifying the claim
* Protect containers
* Protect doors, trapdoors, buttons, levers, etc.
* Protect animals and villagers
* Prevent unauthorized block breaking
* Prevent unauthorized block placing
* Prevent unauthorized container access
* Prevent unauthorized interaction
Claims must survive server restarts.
---
# 2. Claim Creation
Use an easy system suitable for an SMP.
Example:
```text
/claim create
```
or allow a claim tool such as:
```text
Golden Shovel
```
The player selects two corners and creates a protected claim.
The plugin should visually show the claim boundaries when appropriate.
Example:
```text
/claim create
/claim expand
/claim resize
```
The exact claiming method can be implemented cleanly as long as it is easy for normal SMP players.
---
# 3. Claim Commands
Use:
```text
/claim
```
with subcommands such as:
```text
/claim create
/claim delete
/claim trust
/claim untrust
/claim trustlist
/claim info
/claim list
/claim help
```
Add tab completion for all commands.
---
# 4. Claim Trust System
Players should be able to trust other players inside their claim.
Example:
```text
/claim trust Steve
```
Steve can then build/interact inside the claim.
Remove trust:
```text
/claim untrust Steve
```
Show trusted players:
```text
/claim trustlist
```
The claim owner should always have full control.
---
# 5. Claim Protection
Protect the claim against unauthorized players.
Protection should include:
* Block breaking
* Block placing
* Chest access
* Barrel access
* Shulker boxes
* Furnaces
* Crafting/interactions
* Doors
* Trapdoors
* Fence gates
* Buttons
* Levers
* Villagers
* Animals
* Item frames
* Armor stands
* TNT/explosions where appropriate
* Other container/interactions
Do not unnecessarily interfere with normal Minecraft mechanics outside claims.
---
# 6. PvP
Make PvP configurable per claim.
Example:
```yaml
claims:
default-pvp: false
```
Allow the claim owner to toggle it if desired:
```text
/claim pvp
```
The owner can enable/disable PvP inside their claim.
---
# 7. Claim Information
Add:
```text
/claim info
```
When used inside a claim, display:
```text
Claim Information
Owner: Steve
Claim ID: 128
Size: 50x50
Area: 2500 blocks
PvP: Disabled
Status: Active
Trusted Players: 3
```
---
# 8. Claim List
Add:
```text
/claim list
```
Show the player's claims.
Example:
```text
Your Claims
#128
World: world
Location: 125, 70, -340
Size: 50x50
Status: Active
#129
World: world
Location: 500, 64, 200
Size: 30x40
Status: Active
```
---
# 9. Temporary Claim Removal — SPECIAL FEATURE
This is the main custom feature.
Admins can temporarily disable a player's claim using:
```text
/claim remove
Build the Paper plugin, persistent claim model, and configuration.
Add shovel-based claim creation/resizing, commands, and claim protection.
Implement restart-safe temporary removal, offline owner operations, transfers, and claim-block grants.
Created the SurvivalClaims Paper 1.21 plugin with persistent claims, shovel-based creation and resizing, protection, trust controls, PvP settings, and claim-block limits.
Offline admin operations are supported: /claim remove Steve 1h, /claim transfer Steve Alex, and /claim give Steve 10000. Temporary removals are timestamped and survive restarts.
16. Claim Explosion Toggle
Add a player command:
/claim explosion
This command controls whether explosions are allowed inside the player's claim.
Behavior:
* First /claim explosion → Enable explosions in the player's claim. * Second /claim explosion → Disable explosions again. * The setting toggles each time the command is used. * Show the current state to the player.
Example messages:
&cExplosions are now ENABLED in your claim.
&aExplosions are now DISABLED in your claim.
When explosions are enabled:
* TNT can damage blocks inside the claim. * Creepers can damage blocks inside the claim. * TNT minecarts can damage blocks inside the claim. * Other configured explosion types can damage blocks inside the claim.
When explosions are disabled:
* All configured explosions are prevented from damaging blocks inside the claim. * Explosion protection returns to the normal protected-claim behavior.
The explosion setting must be saved per claim and survive server restarts.
Configuration:
explosions:
default-enabled: false
allowed-types:
tnt: true
creeper: true
tnt-minecart: true
bed: true
respawn-anchor: true
other: true
Command permission:
claim.explosion
17. Overworld Only
Claims must work ONLY in the Overworld.
Allowed:
minecraft:overworld
Claims must NOT be allowed in:
minecraft:the_nether
minecraft:the_end
If a player tries to create a claim in the Nether or End:
&cClaims can only be created in the Overworld.
If a player somehow enters the Nether or End while using claim-selection mode:
* Cancel claim selection. * Remove claim visualization. * Do not allow claim creation or resizing. * Do not perform claim protection calculations there.
Existing Overworld claims must remain saved when players travel between dimensions.
Example:
Overworld → Claims work normally
Nether → No claims
End → No claims
Do not allow /claim create, /claim resize, /claim explosion, or other claim-management actions to modify a claim while the player is in the Nether or End.
18. Dimension Safety
The plugin must check the player's world before every claim operation rather than assuming the player is in the Overworld.
This prevents exploits where a player:
- Starts claim selection in the Overworld.
- Travels to the Nether/End.
- Attempts to finish or resize the claim there.
Any pending claim operation should be cancelled when changing dimensions.
📄
pasted-code-1790912883992.txt
txt
407 lines
▶
Create a complete **Paper 1.21.11 / Java 21 claim plugin** with a professional claim system similar to the boundary visualization used by large Minecraft SMP servers.
## CLAIM SELECTION TOOL
Use a **GOLDEN_SHOVEL** as the claim selection tool.
When the player right-clicks with the Golden Shovel:
### FIRST CORNER
On the first right-click:
* Save the clicked block as Corner 1.
* Temporarily display a **DIAMOND_BLOCK** at that exact corner.
* Do not actually replace the world block.
* The Diamond Block should be a temporary/client-side visualization.
* Display a message such as:
```text
&bFirst corner selected!
&7Right-click another location to select the second corner.
```
Example:
```text
Corner 1
◆ Diamond Block
```
### SECOND CORNER
When the player right-clicks another location:
* Save it as Corner 2.
* Calculate the rectangular claim between Corner 1 and Corner 2.
* Temporarily replace the first Diamond Block visualization with a **GOLD_BLOCK** visualization.
* Display the second corner as a **GOLD_BLOCK**.
* Show the entire claim boundary.
Example:
```text
Diamond Block
↓
First corner selected
↓
Second corner selected
↓
Gold Block + boundary visualization
```
The two selected positions determine:
```text
minX
maxX
minZ
maxZ
```
The claim should be rectangular.
---
# LARGE-SERVER CLAIM BOUNDARY VISUALIZATION
The boundary system must behave like the classic claim systems used on large Minecraft servers.
Do **NOT** simply place Glowstone on every block around a huge claim.
Instead, intelligently display the boundary according to the size of the claim.
## SMALL CLAIM
For a small claim:
* Show GOLD_BLOCK at the corners.
* Surround/outline the claim boundary with temporary **GLOWSTONE DUST-style particles/visuals**.
* Make the entire boundary easy to see.
Example:
```text
G = Gold Block
· = Glowstone-style boundary
G · · · · · G
· ·
· ·
· ·
G · · · · · G
```
The visualization must be temporary.
---
# LARGE CLAIM OPTIMIZATION
For a very large claim, DO NOT create thousands of individual boundary blocks.
Instead:
* Show GOLD_BLOCK markers at important intervals along the boundary.
* Show a Gold Block at a configurable distance along each side.
* Use Glowstone Dust/particles between the markers.
* Automatically increase the spacing as the claim becomes larger.
* Keep the visualization readable without causing lag.
Example of a large claim:
```text
G──────────────G──────────────G──────────────G
│ │
│ │
│ │
G G
│ │
│ │
│ │
G──────────────G──────────────G──────────────G
```
The Gold Blocks should appear **along the sides**, not only at the four corners.
For example:
```yaml
visualization:
marker-distance: 20
```
For a 500-block-wide claim:
```text
Corner
G
│
G ← 20 blocks
│
G ← 20 blocks
│
G ← 20 blocks
│
G
```
This makes the boundary clearly visible even for extremely large claims.
---
# DYNAMIC MARKER DISTANCE
Automatically calculate the number of Gold Block markers based on claim size.
Example:
```text
Small claim:
Corners + close boundary visualization
Medium claim:
Gold markers every ~10-20 blocks
Large claim:
Gold markers every ~20-50 blocks
Huge claim:
Gold markers spaced further apart
```
Make this configurable:
```yaml
visualization:
enabled: true
corner-marker: GOLD_BLOCK
first-corner-marker: DIAMOND_BLOCK
boundary-particle: GLOWSTONE_DUST
marker-distance: 20
max-markers-per-side: 25
dynamic-spacing: true
```
Never create an excessive number of visual objects.
---
# GLOWSTONE DUST BOUNDARY
The boundary between Gold Block markers should appear as a **Glowstone Dust-style visual effect**.
Prefer particles over permanently placing Glowstone blocks.
For example:
```text
G · · · · · · · · G · · · · · · · · G
```
Where:
```text
G = temporary Gold Block
· = Glowstone Dust particle/visual
```
The particles should:
* Follow the four claim sides.
* Be visible only to the player viewing their claim.
* Disappear when claim selection ends.
* Disappear when the player walks sufficiently far away.
* Not modify the actual world.
* Not generate excessive particles.
---
# CLAIM SELECTION FLOW
The complete flow should be:
```text
Player gets Golden Shovel
↓
Right-click first location
↓
Diamond Block appears
↓
Player moves to second location
↓
Right-click second location
↓
Claim area calculated
↓
Gold Blocks appear
↓
Glowstone Dust boundary appears
↓
Player can confirm/create claim
```
If the second position overlaps another claim:
```text
&cThis claim overlaps another claim!
&7Choose a different area.
```
Do not create the claim.
---
# CLAIM RESIZING
After a claim already exists, the Golden Shovel can also be used to resize it.
When the player selects an existing claim:
* Show the current boundary.
* Show Gold Blocks along the boundary.
* Allow the player to interact with the appropriate boundary marker.
* Moving/selecting a new position should preview the new size.
* Right-click to confirm the resize.
Every resize must check:
* Minimum size.
* Maximum size.
* Overlap.
* World border.
* Other claims.
---
# OVERWORLD ONLY
Claims only work in:
```text
minecraft:overworld
```
Claims must not work in:
```text
minecraft:the_nether
minecraft:the_end
```
If the player changes dimension during selection:
* Cancel the selection.
* Remove all visual markers.
* Do not create a claim.
---
# EXPLOSION TOGGLE
Add:
```text
/claim explosion
```
First use:
```text
&cExplosions are now ENABLED in your claim.
```
Second use:
```text
&aExplosions are now DISABLED in your claim.
```
The setting must be saved per claim.
When enabled, configured explosions can destroy blocks inside the claim.
When disabled, claim blocks are protected from explosions.
---
# TEMPORARY CLAIM REMOVAL
Add:
```text
/claim remove
```
Support configurable temporary claim disabling.
Example:
```yaml
removal:
enabled: true
default-disable-time: 2h
warning-time: 1h
```
The timer must survive server restarts.
---
# COMBAT CLAIM HANDLING
If a claim is being disabled while a player is combat tagged:
* Do not allow the claim to act as a combat-safe zone.
* Create the configured temporary boundary/wall.
* Automatically eject the player from the disabled claim.
* Find a safe location outside the claim.
* Never eject them into another claim, lava, blocks, or the void.
---
# CLAIM PROTECTION
Support:
```yaml
protection:
block-break: true
block-place: true
interact: true
container-access: true
piston: true
explosions: true
fire-spread: true
mob-griefing: true
```
Allow claim owners and trusted players to bypass the appropriate protections.
---
# IMPORTANT VISUALIZATION REQUIREMENTS
The visualization must feel like a **real large-server claim plugin**, not a simple four-corner selection system.
Requirements:
1. First Golden Shovel right-click → **Diamond Block** at Corner 1.
2. Second Golden Shovel right-click → **Gold Blocks** for the completed selection.
3. Boundary → **Glowstone Dust-style particle line**.
4. Small claims → detailed boundary visualization.
5. Large claims → Gold Blocks automatically distributed **along all four sides**.
6. Do not place thousands of blocks for huge claims.
7. Use temporary/client-side visualization where possible.
8. Visualization must not modify real world blocks.
9. Dynamic marker spacing must prevent lag.
10. All visualization disappears when selection ends.
11. Changing dimension cancels visualization.
12. Claims only exist in the Overworld.
The final plugin should provide the polished visual experience of a **large public Minecraft SMP claim system**, while remaining optimized for Paper 1.21.11 and Java 21.
Add the per-claim explosion toggle, persistence, and configured explosion handling.
Restrict claim creation and management to the Overworld, cancelling selection on dimension changes.
Verify command permissions and protection flows remain consistent.
Added
/claim explosionwith theclaim.explosionpermission. It toggles and saves the setting per claim; configured explosion types can damage blocks only when that claim allows explosions.Restricted claim lookups, creation, resizing, and management changes to worlds keyed
minecraft:overworld.Added dimension-change cancellation for pending selections, preventing them from being completed in the Nether or End.
Claim Explosion Toggle Add /claim explosion.
Requires claim.explosion.
Toggles explosions per claim and saves the setting permanently.
Configurable explosion types can damage blocks only when explosions are enabled for that claim.
Default: explosions disabled for new claims.
Overworld-Only Claims Claim lookup, creation, resizing, expansion, shrinking, and all claim-management operations must work only in minecraft:overworld.
Claims cannot be created or modified in the Nether or End.
Claim protection/lookup should also use the Overworld claim database only.
Dimension-Change Selection Cancellation If a player has an active claim selection and changes dimension, automatically cancel the pending selection.
Clear both selected corners/points.
Prevent the player from completing a claim after entering the Nether or End.
Verify the explosion toggle, persistence, config, and permission; fix any gaps.
Check all claim lookup and management paths for Overworld-only enforcement.
Confirm dimension changes clear every pending selection point.
Explosion toggle:
/claim explosionchecksclaim.explosion; changed its default permission grant to operators. The per-claim setting persists, and configured explosion types are allowed to damage blocks only when enabled for that claim.Overworld-only: Added Overworld checks to claim info, list, trust-list, and admin status commands. Claim loading now ignores records from other dimensions, and deletion rejects non-Overworld claims.
Dimension changes: Confirmed the registered listener clears an active selection on world change; interaction and selection completion also check the player’s world to prevent completing a selection outside the Overworld.
all done
The claim explosion toggle, Overworld-only claim handling, and selection cancellation on dimension change are complete.
It bounders was not showing up and remove claim id only owner id to remove claim
Trace and fix why claim borders are not showing.
Update claim removal to target the owner ID instead of a claim ID.
Claim borders now appear as a brief particle outline after a claim is created or resized.
/claim removenow takes an owner UUID and duration (/claim remove <owner-uuid> <time>), applying to that owner’s claims instead of accepting a claim ID. Tab completion suggests owner UUIDs.
and if you use stick it show claim boundre
Using a stick inside a claim—or clicking a claim’s block—now briefly shows its boundary.
📄
pasted-code-1790918188443.txt
txt
186 lines
▶
Create a complete Paper 1.21.11 / Java 21 claim plugin with a professional claim system similar to the boundary visualization used by large Minecraft SMP servers.
CLAIM SELECTION TOOL
Use a GOLDEN_SHOVEL as the claim selection tool.
When the player right-clicks with the Golden Shovel:
FIRST CORNER
On the first right-click:
Save the clicked block as Corner 1.
Temporarily display a DIAMOND_BLOCK at that exact corner.
Do not actually replace the world block.
The Diamond Block should be a temporary/client-side visualization.
Display a message such as:
&bFirst corner selected!
&7Right-click another location to select the second corner.
Example:
Corner 1
◆ Diamond Block
SECOND CORNER
When the player right-clicks another location:
Save it as Corner 2.
Calculate the rectangular claim between Corner 1 and Corner 2.
Temporarily replace the first Diamond Block visualization with a GOLD_BLOCK visualization.
Display the second corner as a GOLD_BLOCK.
Show the entire claim boundary.
Example:
Diamond Block
↓
First corner selected
↓
Second corner selected
↓
Gold Block + boundary visualization
The two selected positions determine:
minX
maxX
minZ
maxZ
The claim should be rectangular.
LARGE-SERVER CLAIM BOUNDARY VISUALIZATION
The boundary system must behave like the classic claim systems used on large Minecraft servers.
Do NOT simply place Glowstone on every block around a huge claim.
Instead, intelligently display the boundary according to the size of the claim.
SMALL CLAIM
For a small claim:
Show GOLD_BLOCK at the corners.
Surround/outline the claim boundary with temporary GLOWSTONE DUST-style particles/visuals.
Make the entire boundary easy to see.
Example:
G = Gold Block
· = Glowstone-style boundary
G · · · · · G
· ·
· ·
· ·
G · · · · · G
The visualization must be temporary.
LARGE CLAIM OPTIMIZATION
For a very large claim, DO NOT create thousands of individual boundary blocks.
Instead:
Show GOLD_BLOCK markers at important intervals along the boundary.
Show a Gold Block at a configurable distance along each side.
Use Glowstone Dust/particles between the markers.
Automatically increase the spacing as the claim becomes larger.
Keep the visualization readable without causing lag.
Example of a large claim:
G──────────────G──────────────G──────────────G
│ │
│ │
│ │
G G
│ │
│ │
│ │
G──────────────G──────────────G──────────────G
The Gold Blocks should appear along the sides, not only at the four corners.
For example:
visualization:
marker-distance: 20
For a 500-block-wide claim:
Corner
G
│
G ← 20 blocks
│
G ← 20 blocks
│
G ← 20 blocks
│
G
This makes the boundary clearly visible even for extremely large claims.
DYNAMIC MARKER DISTANCE
Automatically calculate the number of Gold Block markers based on claim size.
Example:
Small claim:
Corners + close boundary visualization
Medium claim:
Gold markers every ~10-20 blocks
Large claim:
Gold markers every ~20-50 blocks
Huge claim:
Gold markers spaced further apart
Make this configurable:
visualization:
enabled: true
corner-marker: GOLD_BLOCK
first-corner-marker: DIAMOND_BLOCK
boundary-particle: GLOWSTONE_DUST
marker-distance: 20
max-markers-per-side: 25
dynamic-spacing: true
Never create an excessive number of visual objects.
GLOWSTONE DUST BOUNDARY
The boundary between Gold Block markers should appear as a Glowstone Dust-style visual effect.
Prefer particles over permanently placing Glowstone blocks.
For example:
G · · · · · · · · G · · · · · · · · G
Where:
G = temporary Gold Block
· = Glowstone Dust particle/visual
The particles should:
Follow the four claim sides.
Be visible only to the player viewing their claim.
Disappear when claim selection ends.
Disappear when the player walks sufficiently far away.
Not modify the actual world.
Not generate excessive particles.
Review current selection, claim, and listener flows to fit the requested visualization into the existing plugin.
Implement Golden Shovel corner selection and temporary, player-only boundary markers/particles with dynamic spacing and cleanup.
Add the matching configuration defaults.
Implemented the claim-selection visualization: /claim create and /claim resize use right-clicks with a Golden Shovel. The first corner shows a temporary Diamond Block; selecting the second shows a client-side Gold Block boundary with particles.
Visualization is player-only, restores fake blocks when they leave view, and is cleaned up when it expires, the player quits, or changes worlds. Configure marker spacing, particle density, range, and duration under visualization in config.yml.
📄
pasted-code-1790918412501.txt
txt
295 lines
▶
Create a complete **Paper 1.21.11 / Java 21 claim plugin** with a professional large-server-style claim system.
[Keep all existing claim selection, Golden Shovel, Diamond Block, Gold Block, Glowstone Dust boundary, resizing, Overworld-only, explosion toggle, protection, and combat requirements from the previous prompt.]
# TEMPORARY CLAIM REMOVAL / DISABLE
Add the command:
```text
/claim remove
```
This command temporarily **disables the player's claim** for the specified amount of time.
The duration must support:
### Seconds
```text
/claim remove Steve 10s
```
Disables Steve's claim for **10 seconds**.
### Minutes
```text
/claim remove Steve 10m
```
Disables Steve's claim for **10 minutes**.
### Hours
```text
/claim remove Steve 10h
```
Disables Steve's claim for **10 hours**.
### Days
```text
/claim remove Steve 1d
```
Disables Steve's claim for **1 day**.
Also support combinations:
```text
/claim remove Steve 1h30m
/claim remove Steve 2h30m
/claim remove Steve 1d12h
```
Supported time units:
```text
s = seconds
m = minutes
h = hours
d = days
```
## Examples
```text
/claim remove Player 10s
```
→ Claim disabled for 10 seconds.
```text
/claim remove Player 10m
```
→ Claim disabled for 10 minutes.
```text
/claim remove Player 10h
```
→ Claim disabled for 10 hours.
```text
/claim remove Player 1d
```
→ Claim disabled for 1 day.
## DISABLE BEHAVIOR
When `/claim remove ` is executed:
1. Find the player's claim.
2. Save the current claim state.
3. Mark the claim as temporarily disabled.
4. Save the exact expiration timestamp.
5. Display the remaining disable time.
6. Prevent the owner from using the claim as a protected area while disabled.
7. Automatically restore the claim when the timer expires.
Example message:
```text
&cClaim Disabled
&7Player: &fSteve
&7Duration: &f10 minutes
```
When the timer expires:
```text
&aClaim Restored
&7Your claim is active again.
```
## PERSISTENCE
The timer MUST survive:
* Server restart.
* Server crash.
* Player logout.
* Player reconnect.
* Player being offline when the timer expires.
Store the expiration timestamp in SQLite.
Example:
```yaml
removal:
enabled: true
allowed-units:
seconds: true
minutes: true
hours: true
days: true
default-duration: 2h
minimum-duration: 1s
maximum-duration: 30d
```
## CHECK REMAINING TIME
Add:
```text
/claim remove info
```
Example:
```text
/claim remove info Steve
```
Output:
```text
&cClaim Status
&7Owner: &fSteve
&7Status: &cDisabled
&7Remaining: &f9 minutes 42 seconds
```
If the claim is not disabled:
```text
&aSteve's claim is currently active.
```
## CANCEL DISABLE
Add:
```text
/claim remove cancel
```
This immediately restores the claim.
Example:
```text
/claim remove cancel Steve
```
Output:
```text
&aSteve's claim has been restored.
```
## ADMIN PERMISSION
Require:
```text
claim.remove
```
For administrative claim removal.
Add:
```text
claim.remove.cancel
claim.remove.info
```
## INVALID TIME
If the player enters:
```text
/claim remove Steve abc
```
show:
```text
&cInvalid duration.
&7Examples: &f10s, 10m, 10h, 1d
```
If they enter an unsupported duration:
```text
/claim remove Steve 10w
```
show:
```text
&cInvalid time unit.
&7Use: &fs, m, h, d
```
## TAB COMPLETION
Provide tab completion for:
```text
/claim remove
/claim remove info
/claim remove cancel
```
For duration, suggest:
```text
10s
30s
1m
10m
30m
1h
2h
10h
1d
7d
```
## IMPORTANT
The duration parser must use real elapsed time/timestamps rather than counting server ticks. This ensures that a claim disabled for `10h` remains disabled for exactly 10 hours even if the server restarts or temporarily stops.
The complete plugin must continue to include all previously specified features:
* Golden Shovel selection.
* First corner = temporary Diamond Block.
* Second corner = Gold Block.
* Glowstone Dust-style boundary.
* Gold markers along large claim sides.
* Dynamic boundary spacing.
* Claim resizing.
* No claim overlap.
* Overworld only.
* `/claim explosion` toggle.
* Explosion protection.
* Claim protection.
* Temporary claim disabling.
* Combat detection.
* Temporary combat wall.
* Automatic safe player ejection.
* SQLite persistence.
* Paper 1.21.11.
* Java 21.
Add persistent, timestamp-based claim disabling and restoration in the existing SQLite storage flow.
Implement
/claim remove,info, andcancelwith duration parsing, permissions, and tab completion.Add removal settings/messages and preserve existing claim behavior.
Implemented /claim remove <player> [duration], /claim remove info <player>, and /claim remove cancel <player>. Durations support combined units, configurable allowed units and limits, and expiration timestamps are saved in SQLite. Claims, trust, and claim-block balances are also stored in SQLite, with migration from the existing claims.yml. Expired claims reactivate automatically; info, cancel, permissions, tab completion, and Overworld-only checks are included.
The prompt also names combat detection, a temporary combat wall, and safe ejection, but doesn’t specify their behavior, and the project had no existing implementation. I left those features out rather than inventing triggers or effects.
📄
pasted-code-1790918686780.txt
txt
87 lines
▶
For `/claim remove `, provide extensive TAB-completion suggestions:
```text
1s
5s
10s
15s
30s
45s
1m
2m
5m
10m
15m
20m
30m
45m
1h
2h
3h
4h
6h
8h
10h
12h
18h
1d
2d
3d
5d
7d
10d
14d
21d
30d
```
Also support combined durations:
```text
1h30m
2h30m
5h30m
12h30m
1d12h
2d12h
7d12h
1d6h30m
```
The duration parser should accept any valid combination of:
```text
s = seconds
m = minutes
h = hours
d = days
```
Examples:
```text
/claim remove Steve 10s
/claim remove Steve 30m
/claim remove Steve 6h
/claim remove Steve 1d
/claim remove Steve 2d12h
/claim remove Steve 1h30m
```
TAB completion should show the most commonly used durations first, followed by larger durations.
The system should also allow administrators to type **any valid duration manually**, even if it is not shown in TAB completion.
For example:
```text
/claim remove Steve 37m
/claim remove Steve 9h
/claim remove Steve 15d
```
should all work correctly.
Expanded /claim remove <player> <duration> tab completion with the requested short, common, long, and combined durations, preserving their configured order. Manual durations such as 37m, 9h, and 15d remain accepted by the existing parser.
📄
pasted-code-1790920113130.txt
txt
139 lines
▶
## Claim Border & Resize System — Fix Required
Fix the current claim border and resizing system. The existing border visualization and resize system are not working reliably.
### 1. Remove Particles Completely
* Remove **all particle effects** from claim selection and claim borders.
* Do not use particles for corners, edges, resizing, or selection previews.
### 2. New Border Visualization
Use blocks instead of particles:
* **Gold Block** → claim corners.
* **Glowstone Dust Item Display / Glowstone Dust-style marker** → claim border/outline.
* The border must clearly show the entire claim boundary.
* Do not place permanent blocks into the world.
* The visualization must be temporary and only visible to the player who is currently managing/selecting the claim.
* Other players should not see the temporary selection visualization.
### 3. Gold Shovel Selection
Use a **Golden Shovel** as the claim selection tool.
#### Creating a claim
1. Player right-clicks a block with a Golden Shovel.
2. This sets **Corner 1**.
3. Show Corner 1 using a **Gold Block visualization**.
4. Player moves to another location and right-clicks with the Golden Shovel.
5. This sets **Corner 2**.
6. Show the complete rectangular claim boundary using the Gold Block corners and Glowstone Dust-style border visualization.
7. Create the claim using the selected coordinates.
### 4. Claim Resize System
Fix `/claim resize` so it works reliably.
When a player owns a claim:
1. Right-click a **corner of their existing claim** with a Golden Shovel.
2. That corner becomes the active resize corner.
3. The selected corner should be clearly displayed with a Gold Block.
4. Player moves to the desired new location.
5. Right-click the new location with the Golden Shovel.
6. The claim should immediately resize from the selected original corner to the new location.
7. Update all four claim boundaries.
8. Refresh the temporary border visualization immediately.
### 5. Important Resize Rules
* Right-clicking an existing claim corner with a Golden Shovel must start a resize operation.
* Right-clicking the second location must finish the resize.
* Do **not** require a separate resize command unless configured.
* The resized claim must use the exact two selected corners.
* Prevent the resized claim from overlapping another claim.
* Respect the minimum and maximum claim size configured in `config.yml`.
* Do not allow resizing outside the allowed world.
* If the resize is invalid, cancel it and keep the original claim unchanged.
* Never partially modify a claim during a failed resize.
### 6. Border Accuracy
The displayed border must exactly match the actual claim boundaries.
For example:
```text
G = Gold Block corner
D = Glowstone Dust border marker
G D D D D D G
D D
D D
D D
G D D D D D G
```
The visualization must not be offset by one block and must correctly represent the claim's actual protected area.
### 7. Selection Cleanup
When the player:
* finishes creating a claim,
* finishes resizing,
* cancels selection,
* disconnects,
* changes world/dimension,
* dies,
* closes the claim-management process,
remove the temporary visualization immediately.
### 8. No Permanent Border Blocks
The Gold Blocks and Glowstone Dust visualization must **never become permanent world blocks**.
Use temporary client-side/block-change visualization where possible so the actual world is never modified.
### 9. Permissions & Ownership
* Only the claim owner or players with the appropriate claim-management permission can resize a claim.
* Players must not be able to resize another player's claim.
* Admin permissions may bypass ownership restrictions.
* All existing claim permissions should continue working.
### 10. Configuration
Add configurable options:
```yaml
selection:
tool: GOLDEN_SHOVEL
visualization:
enabled: true
particles: false
corner-block: GOLD_BLOCK
border-material: GLOWSTONE_DUST
resize:
enabled: true
require-owner: true
prevent-overlap: true
min-size: 5
max-size: 10000
```
### 11. Main Requirement
The most important behavior is:
**Golden Shovel + Right Click Corner 1 → select corner → Right Click Corner 2 → create/resize the claim.**
The resize system must be reliable and must not depend on particles.
Use **Gold Blocks for corners** and **Glowstone Dust-style temporary markers for the border**, with accurate coordinates and immediate visualization updates.
Replace particle borders with temporary, owner-only Glowstone Dust item displays and Gold Block corner previews; clear them on selection end or lifecycle changes.
Make Golden Shovel clicks start creation automatically or resize from an owned claim corner, with atomic bounds, ownership, world, size, and overlap checks.
Add the requested selection/resize settings and a
/claim cancelcleanup command.
Replaced particle borders with client-only Gold Block corners and Glowstone Dust item-display markers along every claim edge. Other players are hidden from the temporary displays, which are cleaned up with the selection.
Golden Shovel clicks now start a claim selection automatically or begin resizing when the player clicks an owned claim corner. Resize validation checks ownership, world, configured size limits, and overlap before changing any claim bounds.
Added the requested
selectionandresizeconfiguration options, plus/claim canceland cleanup on death, disconnect, and world change.
https://www.spigotmc.org/resources/claim-blocks-land-protection.90936/ i need all feature of this plugin add /claim remove player timer only
Check the linked plugin’s feature list.
Compare it with this project and pin down the requested scope before making changes.
The linked plugin provides purchasable claim-block tiers, claim authorization, protection settings, admin give/reload commands, and Vault economy support.
This project already has claim protection, trust/untrust commands, PvP and explosion toggles, admin block credits, and /claim remove <player> [duration]. That removal command already supports timed disabling; the missing linked-plugin features are tier purchases, Vault integration, right-click management, and reload.
Do you want me to add all the missing features while keeping timed removal, or are you asking for only the timed /claim remove command?
yes
Add configurable claim-block tiers and purchases through Vault while preserving timed
/claim remove.Add the linked plugin’s management interactions and any missing protection controls.
Fill any remaining admin/reload features after checking what the project already provides.
Added configurable tier purchases with optional Vault economy charging;
/claim remove <player> <duration>remains intact.Added sneaking right-click claim management and configurable protections, including self-authorization, owner controls, and claim interaction rules.
Next I’m adding the linked plugin’s admin reload and tier-grant commands, then aligning their permissions with the project’s existing admin nodes.
Added Vault-backed tier purchases with the linked plugin’s default tier prices,
/claim buy help, and the/claimblockscommand alias.Added admin
/claimblocks reloadand tier grants. Existing numeric/claim give <player> <amount>remains; use/claim give <player> tier:<tier>for a tier, or/claimblocks give <player> <tier>.Added sneaking right-click claim management: players can authorize or unauthorize themselves; owners/admins can toggle PvP and explosions, clear authorizations, or delete the claim. Added configurable block break/place, burn/fade, interaction, explosion, and entity-damage protection settings.
Kept timed
/claim remove <player> <duration>intact.
Management is adapted to this project’s Golden Shovel claims: sneak-right-click inside a claim to open its menu. It does not replace the existing claim system with separate placeable ClaimBlock items.
also add like /claim remove player duration after
/claim remove <player> <duration> already disables the player’s claims immediately and restores them when the duration expires.
Do you mean you want it to wait before disabling the claim, or permanently delete the claim after a delay?
wait before disabling the claim,
Added /claim remove <player> <duration> after <delay>. For example, /claim remove Steve 2h after 30m disables Steve’s claims in 30 minutes for 2 hours. Scheduled removals persist through restarts; use /claim remove info Steve to check one or /claim remove cancel Steve to cancel it.
package com.kodari.claims;
import com.kodari.claims.command.ClaimCommand;
import com.kodari.claims.listener.ClaimListener;
import com.kodari.claims.storage.ClaimManager;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.Objects;
public final class ClaimsPlugin extends JavaPlugin {
private ClaimManager claimManager;
private Economy economy;
@Override
public void onEnable() {
saveDefaultConfig();
claimManager = new ClaimManager(this);
claimManager.load();
claimManager.restoreExpiredClaims();
if (Bukkit.getPluginManager().getPlugin("Vault") != null) {
var registration = getServer().getServicesManager().getRegistration(Economy.class);
if (registration != null) {
economy = registration.getProvider();
}
}
if (getConfig().getBoolean("claim-block-purchases.enabled", true) && economy == null) {
getLogger().warning("Claim block purchases are enabled, but no Vault economy provider was found.");
}
ClaimListener claimListener = new ClaimListener(this, claimManager);
Bukkit.getPluginManager().registerEvents(claimListener, this);
ClaimCommand claimCommand = new ClaimCommand(this, claimManager, claimListener, economy);
PluginCommand command = Objects.requireNonNull(getCommand("claim"), "claim command missing from plugin.yml");
command.setExecutor(claimCommand);
command.setTabCompleter(claimCommand);
Bukkit.getScheduler().runTaskTimer(this, claimManager::restoreExpiredClaims, 20L, 20L);
}
@Override
public void onDisable() {
if (claimManager != null) {
claimManager.close();
}
}
public ClaimManager getClaimManager() {
return claimManager;
}
public Economy getEconomy() {
if (economy == null && Bukkit.getPluginManager().getPlugin("Vault") != null) {
var registration = getServer().getServicesManager().getRegistration(Economy.class);
if (registration != null) {
economy = registration.getProvider();
}
}
return economy;
}
public boolean isAdmin(CommandSender sender) {
return sender.hasPermission("claim.admin")
|| sender.hasPermission("claimblocks.admin")
|| sender.hasPermission("claimblocks.*");
}
}