Nexal Towers
A survival-friendly tower defense system with 10 tower types. Offensive towers attack enemies, support towers heal and feed you and your team, and utility towers farm, collect items and XP, and warn you about intruders. Each tower has its own upgrades bought with Vault money, uses themed ammo that server owners can switch off per tower, and drops as an item with its ammo, upgrades and stored items when it is broken.
Features
- 10 Tower Types - Arrow, Tesla, Laser, Slow, Regen, Food, Alert, Crop, Collector and XP
- Per-Tower Upgrades - Two or three upgrades per tower, bought with Vault money at prices set in config or in game
- Toggleable Ammo - Arrows, redstone, glowstone dust, soul sand, golden apples, bread and bone meal; switch ammo off per tower
- Owner-Only Towers - Only the owner opens a tower's menu or breaks it (
nexaltowers.bypass.breakfor staff) - State Preservation - Breaking a tower drops it as an item that keeps its ammo, upgrades and stored items
- Explosion Protection - TNT, creepers and other explosions leave towers standing; pistons, fire, water and endermen cannot move or remove them either
- Collector That Keeps Items Intact - Collected items keep their names, enchantments and contents; shop display items are left alone
- Alert Tower - Warns the owner (and optionally their team) in game when an enemy comes near, and posts to a Discord webhook
- Team Integration - Factions, Towny and BetterTeams: towers never attack allies, support towers only help them
- Safe Targeting - Creative, spectator and vanished players are never targeted
- Craftable Towers - Shaped recipes for every tower, toggled and edited in game with a 3x3 editor
- Admin Hub - Settings, ranges, upgrade prices, giving towers, recipes and data export in one GUI
- Tower Limit - Cap the towers per player
- Holograms - Live stats above each tower, text set in messages.yml
- Dual JSON/SQL Storage -
data.jsonor MySQL/MariaDB, with export and import to move between them - Chunk-Based Activation - Only towers in loaded chunks run; towers in worlds that load later are kept and placed when the world loads
Technologies
- Paper API 1.20.1+ (Spigot compatible) - Minecraft server API
- Utilizer - Configuration, messages, GUIs, tasks, holograms
- ACF - Command framework
- nexal-core - JSON and SQL persistence (MariaDB/MySQL), help menu
- Vault - Economy for upgrades (optional)
- Factions, Towny, BetterTeams - Team detection (optional)
Tower Types
Offensive Towers
| Tower | Block | Range | Ammo | Upgrades (default price) |
|---|---|---|---|---|
| Arrow | Dispenser | 20 | Arrows | Fire Rate ($1,000), Flaming Arrows ($2,000), Homing Arrows ($3,000) |
| Tesla | Lightning Rod | 20 | Redstone | Chain Lightning ($1,500), Damage Boost ($2,500) |
| Laser | Redstone Lamp | 25 | Glowstone Dust | Target Count ($2,000), Piercing ($3,000) |
| Slow | Soul Sand | 15 | Soul Sand | Effect Duration ($1,000), Weakness ($2,000) |
Support Towers
| Tower | Block | Range | Ammo | Upgrades (default price) |
|---|---|---|---|---|
| Regen | Beacon | 15 | Golden Apples | Heal Boost ($1,500), Cleanse ($2,500) |
| Food | Hay Block | 15 | Bread | Feed Boost ($1,000), Saturation Boost ($2,000) |
Utility Towers
| Tower | Block | Range | Ammo | Upgrades (default price) |
|---|---|---|---|---|
| Alert | Bell | 25 | None | Health Scanner ($1,500), Gear Scanner ($2,500), Visual Tracker ($3,500) |
| Crop | Composter | 10 | Bone Meal (off by default) | Harvest Speed ($1,000), Auto Bone Meal ($2,000) |
| Collector | Hopper | 10 | None | Pickup Speed ($1,500), Auto Sort ($3,000) |
| XP | Enchanting Table | 15 | None | XP Multiplier ($2,000), Mending Aura ($4,000) |
Arrow and Slow towers can target players, hostile mobs or both (set in their menu). Tesla and Laser towers target players only.
Ranges and prices are the defaults; both can be changed in game or in config.yml.
Commands
Player Commands
| Command | Description | Permission |
|---|---|---|
/towers | Show the help menu | None |
/towers help [page] | Show the help menu | None |
/towers list | List all tower types | nexaltowers.list |
/towers info | Info about the tower you are looking at | nexaltowers.info |
Admin Commands
| Command | Description | Permission |
|---|---|---|
/towers admin | Open the admin hub (console: list the admin commands) | nexaltowers.admin |
/towers admin help [page] | List the admin commands in chat | nexaltowers.admin |
/towers admin give | Open the tower give menu | nexaltowers.admin |
/towers admin give \<player> \<type> | Give a tower to a player | nexaltowers.admin |
/towers admin recipes | Manage crafting recipes | nexaltowers.admin |
/towers admin export | Export every tower to export/towers_placed.json | nexaltowers.admin |
/towers admin import | Import towers from export/towers_placed.json | nexaltowers.admin |
/towers admin reload | Reload config, messages and recipes | nexaltowers.admin |
Permissions
| Permission | Description | Default |
|---|---|---|
nexaltowers.list | List all tower types | true |
nexaltowers.info | View tower information | true |
nexaltowers.admin | Admin hub and all /towers admin commands | op |
nexaltowers.bypass.break | Break towers owned by other players | op |
nexaltowers.bypass.limit | Place more towers than towers.max_per_player | op |
nexaltowers.* | All permissions | op |
Configuration
config.yml
storage:
type: json # json or sql
sql:
host: localhost
port: 3306
database: minecraft
username: root
password: ""
towers:
max_per_player: 0 # 0 = unlimited
auto_save_interval: 5 # minutes between saves of ammo use and statistics
damage_owner: false # offensive towers also attack their owner
work_while_owner_offline: true # towers keep working while the owner is offline
ammo: # requires_ammo: false lets a tower work without ammo
arrow:
requires_ammo: true
tesla:
requires_ammo: true
laser:
requires_ammo: true
slow:
requires_ammo: true
regen:
requires_ammo: true
food:
requires_ammo: true
crop:
requires_ammo: false
ranges: # blocks each tower reaches
arrow: 20
tesla: 20
laser: 25
slow: 15
regen: 15
food: 15
alert: 25
crop: 10
collector: 10
xp: 15
upgrades: # upgrade prices, paid with Vault money
arrow:
fire_rate: 1000
flaming_arrows: 2000
homing_arrows: 3000
# ... one section per tower, see the bundled config.yml
economy:
price-format: "$%amount%"
number-format: "#,##0.00"
hide-zero-decimals: true # $1,000 rather than $1,000.00
Purchases, deposits, withdrawals, placing and breaking are saved at once; ammo use and
statistics every auto_save_interval minutes and on shutdown.
Settings GUI
/towers admin → Configuration sets ammo per tower, the tower limit, owner damage, offline
owners, the auto-save interval, every tower range (Ranges) and every upgrade price (Upgrade
Prices), without editing YAML.
messages.yml
Every message, the hologram text above each tower (holograms.\<type>) and the list output are
customizable with MiniMessage gradients, & codes and &#RRGGBB hex, plus sounds and titles.
Messages added in an update are used from the plugin's own copy until you add them to your file,
so an older messages.yml keeps working.
recipes.yml
A shaped recipe per tower plus a master switch. Changes to the file apply without a restart.
Database Schema
With storage.type: sql the plugin creates one table. With JSON storage the same records live
under towers_placed in data.json.
towers_placed
| Column | Type | Key | Description |
|---|---|---|---|
id | VARCHAR(36) | PK | Tower UUID |
world | VARCHAR(64) | World name | |
x, y, z | DOUBLE | Block position | |
yaw, pitch | FLOAT | Stored rotation | |
owner | VARCHAR(36) | Owner UUID | |
tower_type | VARCHAR(32) | Tower type ID (arrow, collector, ...) | |
placed_time | BIGINT | When it was first placed (epoch ms) | |
state | MEDIUMTEXT | Ammo, upgrades, statistics and stored items as JSON |
Key Legend: PK = Primary Key
Towers from versions up to 1.0.2 (towers.json) are moved into the configured storage on the
first start, and the old file is renamed to towers.json.migrated.
Installation
- Download the plugin JAR
- Place it in the
pluginsfolder (Vault and an economy plugin are needed for upgrades) - Start or restart the server
- Adjust
config.ymlor use/towers admin→ Configuration - Apply file changes with
/towers admin reload
To move from JSON to SQL: /towers admin export, set storage.type: sql and the connection,
restart, then /towers admin import.
How It Works
Obtaining and Placing Towers
- Craft them (every tower has a recipe), or get them from
/towers admin give - Place the tower block; it starts working at once
- A protection plugin that blocks the placement also blocks the tower
Using a Tower
- Right-click your tower to open its menu: deposit and withdraw ammo, switch it on or off, set its targets, and open its upgrades
- Only plain items count as ammo; renamed or custom items of the same material are never taken
- Withdrawing gives only what fits in your inventory; the rest stays in the tower
Breaking a Tower
- Only the owner (or a player with
nexaltowers.bypass.break) can break it - It drops as an item that keeps its ammo, upgrades and stored items; placing it restores them
- An open menu on a broken tower closes, so nothing can be taken out twice
- Explosions leave towers standing
- Pistons, fire, flowing water or lava and endermen cannot move or remove a tower block
- If a tower's block disappears some other way (WorldEdit, another plugin), the tower drops as its item within a second