Marketplace/Gameplay/SafeZone SZ 2

SafeZone SZ 2

minecraftFreev1.0.0

Description

Create a Minecraft plugin using Spigot/Paper API (Java) called "SafeZone" with a complete and bug-free region protection system.

Minecraft version: 1.21+

---

CORE COMMAND:

/sz

* Only operators can use
* Gives TWO items:

1. "SafeZone Stick" (selection tool)
2. "SafeZone Look Stick" (inspection tool)
* Prevent giving duplicates if player already has them

/sz delete

* Deletes the safe zone the player is currently standing in
* If not inside any zone, show an error message

---

SAFE ZONE CREATION:

SafeZone Stick:

* Left-click block → set Position 1
* Right-click block → set Position 2
* After both positions are set:

* Create a SafeZone (cuboid region)
* Reset selection
* Send confirmation message

---

CRITICAL REQUIREMENT (VERY IMPORTANT - MUST FOLLOW):

* Safe zones MUST use FULL 3D cuboid detection (X, Y, Z)

* DO NOT only check same Y level

* This must fix the bug where only the floor is protected

* Create a SafeZone class with:

* pos1 and pos2 (Location)
* a method:

boolean isInside(Location loc)

* This method MUST:

* Use getBlockX(), getBlockY(), getBlockZ()
* Calculate min/max for X, Y, Z
* Return true if location is inside full cuboid

* This isInside() method MUST be reused everywhere:

* block breaking
* block placing
* PvP
* explosions
* mob spawning
* look stick detection

* DO NOT duplicate region logic in multiple places

---

SAFE ZONE PROTECTION:

Inside a safe zone, players WITHOUT operator permissions cannot:

* Break blocks (BlockBreakEvent)
* Place blocks (BlockPlaceEvent)
* PvP (EntityDamageByEntityEvent)
* Trigger or be affected by explosions (EntityExplodeEvent + BlockExplodeEvent)
* Spawn mobs (CreatureSpawnEvent → cancel)

Operators bypass all restrictions

---

SAFEZONE LOOK STICK:

* Right-click while inside a safe zone:

* Detect zone using SAME isInside() method
* Show:

* Position 1 and Position 2 coordinates
* Size (X, Y, Z dimensions)
* Total volume

* If not inside a zone → show "No safe zone here"

---

BUG PREVENTION REQUIREMENTS:

* Ensure full vertical protection (blocks above and below must be protected)
* Ensure look stick uses EXACT SAME detection logic as protection
* Ensure zones work correctly in 3D space

---

TECHNICAL REQUIREMENTS:

Use:

* PlayerInteractEvent (for sticks)
* BlockBreakEvent
* BlockPlaceEvent
* EntityDamageByEntityEvent
* EntityExplodeEvent
* BlockExplodeEvent
* CreatureSpawnEvent

Store:

* Zones in a List
* Player selections in a Map<UUID, Selection>

Include:

* SafeZone class
* Selection class
* Main class
* Command class
* Listener class
* plugin.yml

---

EXTRA FEATURES:

* Reset selection after creating a zone
* Clear player messages for all actions
* Only works in overworld
* Code must be clean, structured, and beginner-friendly

---

IMPORTANT:

The plugin must NOT have the bug where:

* Only the floor is protected but blocks above are breakable
* Look stick fails to detect zones

Ensure all protection uses the same isInside() method.

Reviews (0)

No reviews yet

Be the first to leave a review!

Gugu Ff

Seller

Gugu Ff

0

downloads

Versionv1.0.0
Platformminecraft
Typepaper
Minecraft VersionMC 1.21
CategoryMinecraft Plugins > Gameplay
Published on03/04/2026
Last update21/04/2026
Free