Subzones
A subzone is a cuboid region nested inside a town's claims. It has its own roles, its own members, and either inherits the parent town's TownSettings or overrides them per setting. Subzones are perfect for shop districts, member-only basements, or PvP arenas inside an otherwise peaceful town.
Model
Field | Type | Description |
|---|---|---|
| UUID | Primary key. |
| UUID | Parent town. |
| String | Unique within the town. |
| String | Optional. |
| int | Cuboid corners. |
| identifiers | Origin. |
| boolean | When |
|
| Loaded from |
|
| Roles whose |
|
| Player → subzone-scoped role mapping. |
Lifecycle
Cancellation paths:
Cause | Message |
|---|---|
Selection timed out |
|
Player cancelled the dialog |
|
Player started a second creation flow |
|
Validation:
Cause | Message |
|---|---|
Name pattern fails |
|
Name already used in this town |
|
Any corner is outside the town's claims |
|
Cuboid overlaps another subzone |
|
Per-town cap reached |
|
Editing
Operation | Action / command |
|---|---|
Edit metadata (name, description, inherit flag) |
|
Re-select corners |
|
Toggle a single setting |
|
Save many settings at once |
|
Delete |
|
Each edit writes a SUBZONE_UPDATE audit log entry; deletes write SUBZONE_DELETE.
Roles
Subzones can have their own role registry. Roles scoped to a subzone set the scope field on TownRole to the subzone's UUID. Town-wide roles leave scope = null.
Action | Purpose |
|---|---|
| Add a role with |
| Cycle a subzone member to the next role by weight. |
| Remove the member from the subzone (they remain a town member). |
The default subzone role is the first one created — additional roles inherit no permissions by default.
SUBZONE_NO_DEFAULT_ROLE fires if you try to assign a member before one role is marked default.
Members
A subzone member is a (player_uuid, subzone_uuid, role_uuid) triple. Players can be subzone members without being town members in practice (although the UI nudges town membership first).
Common flows:
"Grant access" — add the player with the default subzone role (
SUBZONE_ACCESS_GRANTED)."Revoke access" —
kick-subzone-member(SUBZONE_ACCESS_REVOKED)."Promote" / "Demote" — cycle role action (
SUBZONE_MEMBER_PROMOTED,SUBZONE_MEMBER_DEMOTED).
Permission resolution
When a player acts inside a subzone:
town.adminshort-circuits everything.If the player is a subzone member, use the subzone role's permissions.
Otherwise, use the town role's permissions.
For settings, inheritSettings decides whose copy is consulted (see Settings).
Visualisation
SubzoneListener exposes a per-player particle view for the currently selected town's subzones — toggled from the same /town particles switch as claim borders. SubzoneParticleViewTask renders the cuboid edges.