Roles

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 just the weightings which can't change as those are stored in the database.

Defining roles

Roles are defined in the town roles.yml file below, which is a copy of the default setup.

roles.yml
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃  HuskTowns town role config  ┃
# ┃    Developed by William278   ┃
# ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
# ┣╸ This file is for configuring town roles and associated privileges.
# ┣╸ Each role is mapped to a weight, identifying its hierarchical position. Each weight is also mapped to the role name.
# ┣╸ Config Help: https://william278.net/docs/husktowns/config-files
# ┗╸ Documentation: https://william278.net/docs/husktowns/town-roles
# Map of role weight IDs to display names
names:
  '3': Mayor
  '2': Trustee
  '1': Resident
# Map of role weight IDs to privileges
roles:
  '3':
  - set_bio
  - evict
  - promote
  - demote
  - withdraw
  - level_up
  - set_rules
  - rename
  - set_color
  - declare_war
  '2':
  - set_farm
  - set_plot
  - manage_plot_members
  - trusted_access
  - unclaim
  - claim
  - set_greeting
  - set_farewell
  - invite
  - set_spawn
  - manage_relations
  - spawn_privacy
  - view_logs
  '1':
  - deposit
  - chat
  - claim_plot
  - spawn

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're all assigned.

✅ Remember that higher roles inherit privileges from lower-weighted roles.

PrivilegeDescription
set_bioUpdate the town bio
evictEvict a town member
promotePromote a town member to a higher role
demoteDemote a member to a lower role
withdrawWithdraw from the coffers to their own bank balance
level_upSpend money from the coffers to level up the town
set_rulesUpdate the town claim/flag rule settings
renameRename the town
set_colorSet the town color
set_farmMake a claimed chunk into a farm
set_plotMake a claimed chunk into a plot
manage_plot_membersAdd members and managers to a plot
manage_relationsManage Relations, if enabled
declare_warDeclare and manage Wars, if enabled
trusted_accessBuild anywhere in the town, including outside of plots
unclaimRemove a claim
claimCreate a claim
set_greetingUpdate the town greeting message
set_farewellUpdate the town farewell message
inviteInvite a player to the town
set_spawnUpdate the town spawn position
spawn_privacyUpdate the privacy of the town spawn
view_logsView the town audit logs
depositDeposit money into the town coffers
chatUse the town chat
spawnTeleport to the town spawn if it is private
claim_plotClaim a vacant town plot with /town plot claim

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.