Town Roles

ℹ️ This feature is available in HuskTowns v1.8+ only.

You can customize the roles members of a town may hold as well as the privileges within the town each role has. Towns require at least two roles with different weights; a “mayor” role and a default citizen role, otherwise you will encounter errors.

Important

  • If you change the number of roles, you will need to reset your data - as the role weightings stored in the database will become incompatible.
  • You can change the privileges at any time in the config, though
  • You can also change the role name as you see fit. It’s the weightings which cannot change as those are stored in the database.

Defining roles

Roles are defined in the config as follows, which is a copy of the default setup.

town_roles:
  MAYOR:
    weight: 3
    display_name: 'Mayor'
    town_privileges:
      - plot_unclaim_other
      - bio
      - evict
      - promote
      - demote
      - flag
      - rename
  TRUSTED:
    weight: 2
    display_name: 'Trustee'
    town_privileges:
      - farm
      - plot
      - plot_assign
      - trusted_access
      - unclaim
      - claim
      - greeting
      - farewell
      - invite
      - setspawn
      - publicspawn
  CITIZEN:
    weight: 1
    display_name: 'Citizen'
    town_privileges:
      - deposit
      - chat
      - spawn

Role requirements

Each role must have:

  • An identifier (CITIZEN)
  • A weight (1)
  • A display name (‘Citizen’)
  • A list (can be empty) of role privileges (detailed below) that this role has.

Role metadata

  • The role weight identifies the rank of the role in the town.
  • Roles with higher weightings are more important - the role with the highest weighting is the mayor and the role with the lowest weighting is the default role for newly joined citizens.
  • Roles inherit privileges from all roles with a lower weighting, so there’s no need to duplicate them.
  • Role weightings must be unique.

Role privileges

Role privileges are how you specify what rights each role has in your town. The below table is a list of all these privileges and what rights they give each role. If you don’t assign a privilege to a role, nobody will be able to perform that action, so make sure they are all assigned.

Privilege Description
bio Ability to change the town bio
evict Ability to kick town members (cannot evict members with an equal or higher rank thank you)
promote Ability to promote town members (cannot promote players to your rank or to a rank higher than you)
demote Ability to demote town members (cannot demote players with an equal or higher rank than you)
flag Ability to modify town flags
rename Ability to rename the town
farm Ability to convert claimed chunks into farms and vice versa
plot Ability to convert claimed chunks into plots and vice versa (the plot_unclaim_other is required to convert claimed plots back, though)
plot_assign Ability to assign town members to a plot
plot_unclaim_other Ability to unclaim a plot assigned to someone
trusted_access Ability to build outside your assigned plot chunk(s), including in regular claimed chunks.
claim Ability to claim chunks for your town
unclaim Ability to unclaim chunks from your town
greeting Ability to change the town greeting message
farewell Ability to change the town farewell message
invite Ability to invite new members to your town
spawn Ability to teleport to your town’s spawn
setspawn Ability to update the town spawn
publicspawn Ability to toggle the privacy of your town’s spawn
deposit Ability to deposit money into your town coffers
chat Ability to use the town chat

Some actions are automatically given to only the mayor - such as the ability to disband and transfer ownership of a town. Only one player can be the mayor. If you’d like a “co-mayor” setup, it’s recommended that you define two roles - one “true” “mayor” with the highest weighting, and a “co-mayor” weighting just below that, and assign that role all the privileges. Higher roles inherit privileges from lower-weighted role, remember.