Marketplace/Gameplay/SafeZone SZ

SafeZone SZ

minecraftFreev1.0.0

Description

Create a Minecraft plugin using Spigot/Paper API (Java) called "SafeZone" with the following features:

* Minecraft version: 1.21+
* Clean, beginner-friendly, well-structured code

Commands:

1. /sz

* Only operators can use this
* Gives TWO items:

* "SafeZone Stick" (selection tool)
* "SafeZone Look Stick" (inspection tool)

2. /sz delete

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

---

SafeZone Stick:

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

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

---

IMPORTANT (Fix bug):

* Safe zones MUST use full 3D cuboid detection:

* Check X, Y, Z ranges (not just same level)
* This ensures blocks above and below are protected

---

Safe Zone Protection:

Inside a safe zone, players WITHOUT operator permissions cannot:

* Break blocks (BlockBreakEvent)
* Place blocks (BlockPlaceEvent)
* PvP (EntityDamageByEntityEvent)
* Cause 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:

* Show:

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

---

Technical Requirements:

* Use:

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

* Store zones in a List

* Use a SafeZone class:

* Stores pos1, pos2
* Has a method: isInside(Location loc)

* Ensure selection resets after creating a zone

---

Extra Features:

* Prevent duplicate tools spam (check inventory before giving)
* Clear error messages
* Works only in overworld

---

Structure:

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

---

Make the code simple, clean, and well-commented so a beginner can understand it.

Reviews (0)

No reviews yet

Be the first to leave a review!

Zaid Ahmad

Seller

Zaid Ahmad

0

downloads

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