HomeJavaModsTownyPacifist - Addon
TownyPacifist - Addon
ModsJava

TownyPacifist - Addon

by RNAxol · on Modrinth

Prevents combat involving peaceful Towny towns — bidirectional protection with arena, SiegeWar & TownyCaptureSites support.

⬇ Download on Modrinth
TownyPacifist - Addon — screenshot 1TownyPacifist - Addon — screenshot 2TownyPacifist - Addon — screenshot 3

☮ TownyPacifist

Modrinth GitHub Release License

A lightweight Towny addon that enforces peace for peaceful towns — everywhere, not just within their borders.


📖 About

Many servers struggle with a common problem: players from peaceful towns getting killed by aggressive towns, or peaceful town members attacking others without consequence.

TownyPacifist solves this by hooking directly into Towny's own peaceful flag (/t toggle peaceful). No custom data, no extra commands — if a town is marked as peaceful in Towny, this plugin enforces that everywhere on the map.


✨ Features


🔗 Dependencies

Plugin Required
Towny ✅ Required
EventWar ➕ Optional (integrates automatically)
SiegeWar ➕ Optional (integrates automatically)
TownyCaptureSites ➕ Optional (integrates automatically)

⚙️ How It Works

TownyPacifist listens to TownyPlayerDamagePlayerEvent and checks both players' towns using Towny's API:

Player A hits Player B
  └─ Is either player from a neutral (peaceful) town?
       ├─ No  → do nothing, let Towny handle it normally
       ├─ Yes → are they inside an arena plot?
       │         ├─ Yes + arenas allowed → permit combat (no spam, notified on entry)
       │         └─ No  → cancel damage + send message
       └─ Both peaceful → cancel damage + specific message

The "peaceful" status is set by the town mayor using Towny's own command:

/t toggle peaceful

No TownyPacifist commands needed.


📁 Config

# Enable or disable all protection globally
enabled: true

# Allow peaceful town members to PvP inside Towny arena plots
allow-pacifist-in-arenas: true

# Allow peaceful town members to fight inside TownyCaptureSites plots (requires TownyCaptureSites)
allow-pacifist-in-capture-sites: true

🌍 Adding a Language

TownyPacifist uses Towny's built-in translation system. Messages are delivered in each player's own language automatically.

  1. Go to plugins/TownyPacifist/lang/
  2. Copy en-US.yml and rename it (e.g. es-ES.yml)
  3. Translate the messages
  4. Towny picks it up automatically — no config change needed

🔨 Building from Source

Requirements:

./gradlew build
# Output: build/libs/TownyPacifist-1.0.jar

🗺️ Planned Integrations


📜 License

Apache 2.0 — see LICENSE


👤 Author

Made by RN_Axol

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more