Towns
A Town is the central entity: a named, owned organisation with members, roles, claims, optional spawn, MOTD, bank balance, and per-server origin.
Lifecycle
Fields
Field | Type | Description |
|---|---|---|
| UUID | Primary key. |
| String | Unique, mutable. |
| UUID | Current owner. |
| NetworkLocation | Optional — world, x, y, z, yaw, pitch, server id. |
| Component | Optional MiniMessage Message of the Day. |
| long | Timestamps. |
|
| Hydrated on load. |
|
| Hydrated on load — see Roles. |
|
| Toggled state — see Settings. |
Selection
A town is the implicit subject of most commands. Players pick one with:
The selection lives on TownPlayerData.selectedTownId and is synced by AstralSync. Selecting fires TownSelectEvent; deselecting fires TownUnselectEvent.
%towns_current% returns the name of the selected town ("none" if none).
Creation rules
config.yml > creation:
Name validation: length window, regex, blacklist.
Quotas:
default-quotaplus per-permission overrides. EachQuotaEntrycarriesowner(max towns owned) andtotal(max towns participated in).
Quota errors map to TOWN_LIMIT_REACHED/TOWN_LIMIT_REACHED_OTHER.
Renaming
Validated by the same rules as create. Sends TOWN_NAME_UPDATED, fires the generic update broadcast.
MOTD
The MOTD is persisted as a JSON Component on the towns row. Length is capped — TOWN_MOTD_TOO_LONG fires if exceeded.
Spawn
/town spawn set records the player's current position as the town spawn. The location must lie within one of the town's own claims (SPAWN_NOT_IN_TOWN_CLAIM otherwise). Once set, /town spawn teleports members there subject to SPAWN_TELEPORT.
ClaimListener also fires CANNOT_OBSTRUCT_TOWN_SPAWN if anyone tries to place blocks where the spawn would obstruct.
Ownership transfer
Recipient must already be a member (
CANNOT_TRANSFER_OWNERSHIP_TO_NON_MEMBER).Recipient must have room in their owner / total quota (
TRANSFER_OWNERSHIP_FAILED_OWNER_QUOTA,TRANSFER_OWNERSHIP_FAILED_MEMBER_QUOTA).The previous owner becomes a normal member (default role).
Only the current owner may call this.
Disband
A two-step confirmation flow:
First call sends
TOWN_DELETE_CONFIRMATION.Second call within the timeout commits the disband.
The cascade removes every related row (claims, roles, members, warps, subzones, bans) and fires TownDisbandedEvent for plugins to clean up.
TownDisbandEvent is cancellable; TownDisbandedEvent is post-fact.
Info
/town info [town] opens a menu with the MOTD, member count, claim count, balance, and creation date. Most fields come from the town_* placeholder namespace — see Placeholders.
Per-player toggles
Stored on TownPlayerData:
Toggle | Action | Placeholder |
|---|---|---|
Chat redirect |
|
|
Member-join notifications |
| — |
Favourite warps |
|
|