Town Settings
TownSettings is an EnumSet on every town. Settings are toggles, not scalars — each one is either on or off, and each one is read by SettingsListener to filter the corresponding Bukkit event.
Subzones can either inherit the parent town's settings or override them per-setting; see Subzones.
Catalogue
Setting | Gates |
|---|---|
| Passive mob spawning (cows, sheep, …). |
| Hostile mob spawning. |
| Player-vs-player damage. |
| Mobs damaging players. |
| Mob drops on death. |
| Fall damage to players. |
| Block damage from explosions (TNT, creepers, end crystals). |
| Fire spread and block burning. |
| Natural leaf decay. |
| Out-of-water coral fade. |
| Crop growth. |
| Sapling → tree. |
| Vine and similar growth. |
| Snow forming during snowfall. |
| Snow / ice fading. |
| Grass / mycelium spread. |
| Falling blocks (sand, gravel). |
| Budding amethyst progression. |
| Players trampling farmland. |
| Other entities trampling farmland. |
| Liquid water flow into the claim. |
| Liquid lava flow into the claim. |
| Frost Walker enchantment effect. |
| Welcome / goodbye messages to non-members. |
settings.yml > settings.<NAME> defines the icon used in the settings menu. settings.yml > default-settings lists the settings enabled on every newly created town.
Toggling
Path | Permission |
|---|---|
Menu via |
|
Bulk save via |
|
A toggle fires a TownSettingChangedEvent (non-cancellable) and writes a UPDATE_SETTINGS log entry with the typed SettingsLogPayload.
Dirty tracking
Town.toggleSetting(setting) flips the bit in the EnumSet and pushes the change into a dirtySettings map. flushDirtySettings() returns and clears that map; the action layer uses it to batch a single DB write for menu sessions that toggle many entries at once.
Wilderness defaults
Settings applied to unclaimed land come from config.yml > wilderness.settings. They share the same enum so you can mix and match — e.g. SPAWN_ANIMALS and SPAWN_MONSTERS on outside, off inside.
Programmatic access
Returns true when:
The location is inside a town claim and the town has the setting on, or
The location is inside a subzone that inherits and the parent town has it on, or
The location is inside a subzone with its own copy enabling the setting, or
The location is wilderness and the setting is in
wilderness.settings.