Towny Advanced Documentation

repository·master·Indexed 18 days ago

https://github.com/townyadvanced/towny

A comprehensive town and nation management system for Minecraft servers. This documentation covers installation, build instructions via Maven and Ant, version compatibility for Paper, Folia, and Purpur, and a detailed guide to the Towny API and command system, including administrative, town, and player-level commands.

Tokens
18.7K
Snippets
66
Records
98
Agent score
20%

What's inside Towny Advanced

  1. How Towny language localization works

    master

    Towny uses a dual-layer approach to determine which language to display:

    1. Player-driven: By default, Towny detects the locale set in a player's Minecraft client settings. If the player's language is supported on the Towny Crowdin page, Towny will automatically display messages in that language.
    2. Admin-driven (Fallback/Console): The server administrator can set a global default language in config.yml using the language: setting. This language is used for console messages and serves as the fallback for players whose language is not natively supported by a translation file.
  2. Import Towny for API use

    master

    Developers can integrate the Towny API into their own Minecraft plugins using Maven. To get started, add Towny as a dependency in your pom.xml via JitPack. Detailed instructions for IDE setup and a comprehensive guide to the available API can be found in the official Towny Wiki.

    <!-- Dependency via JitPack -->
    <dependency>
        <groupId>com.github.TownyAdvanced</groupId>
        <artifactId>Towny</artifactId>
        <version>LATEST_VERSION</version>
        <scope>provided</scope>
    </dependency>
  3. Access Towny support and documentation

    master

    Documentation

    • Towny Wiki: The primary source for installation guides, FAQs, and core mechanics (How Towny Works).
    • Changelog: Essential for pre-release users to understand changes since the last release.

    Support

    • Discord: Join the Discord server for support, add-on plugin discussions, and plugin development.
    • GitHub Issues: Use the Issue Tracker for bug reports and feature requests.
    • Sponsorship: Note that hands-on support from the lead developer (LlmDl) on Discord is generally reserved for sponsors.
  4. Build Towny from source

    master

    You can build Towny from a specific branch using either Apache Maven or Apache Ant.

    Run the following command in the Towny directory to generate the plugin in the target directory:

    mvn clean package

    Using Ant (Deprecated)

    For older branches, use the following command. Note that this command will create a lib folder outside the Towny directory containing the generated Towny.jar:

    ant clean jar
    mvn clean package
  5. Override specific language translations

    master

    If you want to provide a custom translation for a specific language or translate Towny locally, follow these steps:

    1. Locate the desired language file in the towny\settings\lang\reference\ folder.
    2. Move (do not just copy) the file into the towny\settings\lang\override\ folder.
    3. Edit the file in the override folder.

    CRITICAL WARNING: Never edit files directly in the towny\settings\lang\reference\ folder. Towny will overwrite these files during the loading process, and all your changes will be lost.

    1. Move file from: towny\settings\lang\reference\
    2. To: towny\settings\lang\override\
  6. Kick towns from a nation

    master

    A nation leader can remove towns from their nation using the /nation kick [TOWN_NAMES] command.

    Constraints:

    • The capital town of a nation cannot be kicked.
    • If the command is cancelled by a NationPreTownKickEvent, the town remains in the nation.
    • Once kicked, the town is no longer part of the nation and becomes an independent town (or follows the rules for towns without nations).
    /nation kick [TOWN_NAME]
  7. Manage Towny permissions with /ta townyperms

    master

    Administrators can manage permission groups and ranks directly via the command line. This allows for dynamic updates to the permission system without manual file editing.

    Manage Permission Groups

    Use group to view or modify permission nodes for a specific group.

    • List nodes for a group: /ta townyperms group <GROUPNAME>
    • Add a node: /ta townyperms group <GROUPNAME> addperm <NODE>
    • Remove a node: /ta townyperms group <GROUPNAME> removeperm <NODE>

    Manage Ranks

    You can create, remove, or rename ranks for both towns and nations.

    • Town Ranks:
      • Add: /ta townyperms townrank addrank <RANKNAME>
      • Remove: /ta townyperms townrank removerank <RANKNAME>
      • Rename: /ta townyperms townrank renamerank <OLD_RANK> <NEW_RANK>
    • Nation Ranks:
      • Add: /ta townyperms nationrank addrank <RANKNAME>
      • Remove: /ta townyperms nationrank removerank <RANKNAME>
      • Rename: /ta townyperms nationrank renamerank <OLD_RANK> <NEW_RANK>

    List Groups

    • /ta townyperms listgroups (Displays an alphabetized list of all available groups)
    # Example: Adding a permission node to a group
    /ta townyperms group resident addperm towns.resident.canbuild
    
    # Example: Renaming a town rank
    /ta townyperms townrank renamerank assistant helper
  8. Manage nation allies

    master

    Nations can establish alliances using the /n ally command suite. Alliances are handled via an invite/request system.

    Available Ally Commands:

    • add [NATION_NAME]: Sends an alliance request to the specified nation. If the target nation is player-led, its King will receive an invite.
    • remove [NATION_NAME]: Removes an existing alliance with the specified nation.
    • sent: Lists all alliance requests sent by your nation.
    • received: Lists all alliance requests received by your nation.
    • accept [NATION_NAME]: Accepts a pending alliance request from the specified nation.
    • deny [NATION_NAME]: Denies a pending alliance request from the specified nation.

    Constraints:

    • Nations cannot ally themselves.
    • Nations cannot ally an existing enemy.
    • Alliances are subject to the maximum ally limit configured in Towny settings.
    /n ally add [NATION_NAME]
    /n ally remove [NATION_NAME]
    /n ally sent
    /n ally received
    /n ally accept [NATION_NAME]
    /n ally deny [NATION_NAME]