Skip to main content

Nexal Heads

A player head drop plugin: when a player is killed in PvP, their head can drop as a trophy that names the victim, the killer and the time of the kill. Drop chances are configurable per permission tier and grow with Looting, drops can be switched off per world or globally, and every drop and collection is tracked for statistics and a leaderboard. With Vault, a head can be right-clicked to claim a share of the victim's balance.

Features​

  1. Configurable Drop Chance - Set the base percentage chance (0-100%) for heads to drop when players are killed by other players
  2. Permission-Based Chance Tiers - VIP/MVP/Elite (or any tier you define) get their own drop chance; a player holding several tiers gets the highest
  3. Looting Enchantment Bonus - Looting on the killer's weapon adds a configurable bonus per level
  4. World Blacklist - Configure specific worlds where heads will never drop
  5. Trophy Head Lore - Heads display killer name, victim name, date and time with customizable formatting
  6. Kill Broadcast Messages - Server-wide announcements when heads drop
  7. Sound Effects - Sounds when heads drop, are collected and are claimed
  8. Statistics Tracking - How many times each player's head has dropped and how many heads they have collected. A head counts once, for the first player other than its victim who picks it up
  9. Leaderboard System - Top head collectors with /heads top
  10. Head Economy - With Vault, heads show a share of the victim's current balance and can be right-clicked to claim it. The value refreshes while the head is in an inventory, and disappears from the lore when the economy is turned off
  11. Admin Commands - Give heads manually, toggle drops globally, export, import and reload
  12. Admin GUI - /heads admin opens a menu with Configuration, a head drops toggle, Export, Import and Reload. Configuration edits every gameplay setting in config.yml (drop chance, looting bonus, chance tiers, blacklisted worlds, economy, claim percentage, head value refresh interval) and saves each change as you click
  13. PlaceholderAPI Integration - Placeholders for stats, drop chance and the top collector, including for offline players
  14. Dual Storage - JSON (data.json) or MySQL/MariaDB, with export and import to move between them. Statistics are kept in memory and saved off the main thread
  15. Persistent Data Container - Uses PDC to store killer, victim and timestamp metadata on heads

Technologies​

  • Paper API 1.20.1+ - Minecraft server API (Spigot compatible)
  • Utilizer - Configuration, messages, items, tasks and color formatting
  • ACF (Aikar Command Framework) - Annotation-based command system
  • nexal-core - JSON and SQL (MySQL/MariaDB) persistence, help menu
  • PlaceholderAPI - Placeholder integration (optional)
  • Vault - Economy for claiming heads (optional)

Commands​

Player Commands​

CommandDescriptionPermission
/headsShow help menuNone
/heads help [page]Show help menuNone
/heads stats [player]View head statistics of yourself or another player, online or offlinenexalheads.stats
/heads topView leaderboard of most heads collectednexalheads.top

Aliases: /head, /nexalheads.

Admin Commands​

Admin commands are hidden from players without the nexalheads.admin permission. Use /heads admin help to see available admin commands.

CommandDescriptionPermission
/heads adminOpen the admin menu (console: admin help)nexalheads.admin
/heads admin help [page]Show admin commandsnexalheads.admin
/heads admin give \<player> \<skull_owner>Give a player head to someone; if their inventory is full it drops at their feetnexalheads.admin
/heads admin toggleToggle head drops globally on/off (saved to config.yml)nexalheads.admin
/heads admin exportExport statistics to export/heads_stats.jsonnexalheads.admin
/heads admin importImport statistics from export/heads_stats.jsonnexalheads.admin
/heads admin reloadReload config.yml and messages.ymlnexalheads.admin

Admin GUI​

ScreenContents
Admin menu (/heads admin)Configuration, Head Drops toggle, Export Data, Import Data (shift+left click), Reload, Close
ConfigurationHead Drops, Drop Chance, Looting Bonus, Chance Tiers, Blacklisted Worlds, Economy, Claim Percentage, Lore Update Interval, Back, Close
Chance TiersThe chance of each tier under permission-chances (tiers are added or removed in config.yml); a tier whose value is not a number is marked as ignored and cannot be edited here
Blacklisted WorldsEvery loaded or blacklisted world; click to blacklist it or allow drops again

Numbers: left click +1, right click -1, shift for +10/-10. Percentages stay between 0 and 100; the refresh interval between 1 and 1200 ticks.

Permissions​

PermissionDescriptionDefault
nexalheads.statsView head statisticstrue
nexalheads.topView leaderboardtrue
nexalheads.adminAdmin menu and every /heads admin command (give, toggle, export, import, reload)op
nexalheads.chance.vipVIP drop chance (25% default)false
nexalheads.chance.mvpMVP drop chance (40% default)false
nexalheads.chance.eliteElite drop chance (60% default)false
nexalheads.chance.\<tier>Drop chance of any other tier under permission-chancesfalse

The chance permissions are false for operators too: grant them through your permissions plugin.

Placeholders​

Requires PlaceholderAPI.

PlaceholderDescription
%nexalheads_dropped%Times the player's head has dropped (works for offline players)
%nexalheads_collected%Number of heads the player has collected (works for offline players)
%nexalheads_top_collector%Name of the player with the most heads collected, or None
%nexalheads_chance%Player's current drop chance percentage (online players only)

Configuration​

config.yml​

# Drop chance percentage (0-100)
drop-chance: 10

# Looting enchantment bonus per level (added to base chance)
looting-bonus-per-level: 5

# Whether head drops are currently enabled
enabled: true

# World blacklist - worlds where heads won't drop
blacklisted-worlds:
- "spawn"
- "hub"

# Permission-based chance modifiers
# "nexalheads.chance.\<key>" gives this chance instead of the base chance.
# A player holding several tiers gets the highest one. Values must be plain numbers.
permission-chances:
vip: 25
mvp: 40
elite: 60

# Head item customization
head:
# Placeholders: %victim%, %killer%, %date%, %time%
display-name: "<gradient:#FF69B4:#FF85C8>\<bold>%victim%'s Head\</bold>\</gradient>"
lore:
- ""
- "<gradient:#AAAAAA:#BBBBBB>● Victim »\</gradient> \<white>%victim%\</white>"
- "<gradient:#AAAAAA:#BBBBBB>● Killer »\</gradient> \<white>%killer%\</white>"
- "<gradient:#AAAAAA:#BBBBBB>● Date »\</gradient> <gradient:#FF9DCE:#FFB8DC>%date%\</gradient>"
- "<gradient:#AAAAAA:#BBBBBB>● Time »\</gradient> <gradient:#FF9DCE:#FFB8DC>%time%\</gradient>"
- ""
# Extra lines shown only while the economy is enabled. Placeholder: %balance%
economy-lore:
- "<gradient:#2ECC71:#52D68A>● Value »\</gradient> \<white>$%balance%\</white>"
- ""
- "<gradient:#FFC107:#FFCD38>Right-click to claim!\</gradient>"

# Storage type: "json" or "sql"
storage:
type: json
sql:
host: localhost
port: 3306
database: minecraft
username: root
password: ""

# Economy settings (requires Vault)
economy:
enabled: false
# Percentage of the victim's balance a head is worth (0-100)
balance-percentage: 10
# How often head lore updates with the current balance (in ticks, 20 = 1 second)
update-interval: 20

messages.yml​

All messages are fully customizable using MiniMessage format with gradient support, and can carry a sound. Messages added in an update that your messages.yml does not have yet use the bundled text; the file itself is not changed. The plugin uses a pink color scheme:

  • PRIMARY: <gradient:#FF69B4:#FF85C8> (pink)
  • SECONDARY: <gradient:#FF9DCE:#FFB8DC> (light pink)

Messages include:

  • Head drop broadcasts and head collection notifications
  • Statistics displays and leaderboard formatting
  • Head claim messages for the claimer and the victim, and claim errors
  • Admin action confirmations
  • Error messages

You can customize all colors by using find-and-replace in your text editor.

Data Storage​

Statistics are kept in memory. Changes are saved off the main thread every 5 seconds, and once more when the server stops.

JSON​

With storage.type: json, everything lives in a single data.json:

&#123;
"nexalheads_stats": &#123;
"uuid-1": &#123;
"id": "uuid-1",
"player_name": "Player1",
"heads_dropped": 5,
"heads_collected": 12,
"last_updated": 1704312000000
&#125;
&#125;
&#125;

Database Schema​

With storage.type: sql, the plugin creates the following table:

nexalheads_stats​

ColumnTypeKeyDescription
idVARCHAR(36)PKPlayer UUID
player_nameVARCHAR(16)Player's last known name
heads_droppedINTNumber of times this player's head has dropped
heads_collectedINTNumber of heads this player has collected
last_updatedBIGINTLast update timestamp (milliseconds)

Key Legend: PK = Primary Key

Migrating between JSON and SQL​

  1. /heads admin export writes every player's statistics to plugins/NexalHeads/export/heads_stats.json
  2. Set storage.type in config.yml and restart the server
  3. /heads admin import loads the file into the new storage, overwriting players already stored

Head Metadata​

Each dropped head carries PersistentDataContainer (PDC) metadata:

  • killer - UUID of the player who got the kill
  • victim - UUID of the player whose head dropped
  • timestamp - Time when the head was created (milliseconds)
  • collected - Set on the first pickup that counted, so picking the head up again does not count twice
  • economy_lore - Set while the head shows its claimable value

This metadata is used to tell plugin heads apart from regular player heads. Heads given with /heads admin give have none of it: they are decorative and cannot be claimed.

Drop Chance Calculation​

The plugin calculates drop chance as follows:

  1. Check Permission Chances - If the killer holds any nexalheads.chance.\<tier> permissions, use the highest of those tiers' chances
  2. Use Base Chance - Without a tier permission, use the drop-chance config value
  3. Add Looting Bonus - If the killer's weapon has Looting, add looting-bonus-per-level * level

Example:

  • Base chance: 10%
  • Killer has the VIP (25%) and Elite (60%) permissions: Elite wins
  • Killer has a Looting III sword (+15% bonus)
  • Total chance: 75%

Installation​

  1. Download the plugin JAR
  2. Place it in your server's /plugins folder
  3. Restart the server
  4. (Optional) Edit config.yml and messages.yml to customize settings
  5. (Optional) Install PlaceholderAPI for placeholder support and Vault for the head economy
  6. Use /heads admin reload to apply config changes without restarting

Usage Examples​

For Players​

/heads stats           # View your own statistics
/heads stats Notch # View Notch's statistics, even while Notch is offline
/heads top # See who has collected the most heads

For Admins​

/heads admin                   # Open the admin menu
/heads admin give Steve Notch # Give Steve a head of Notch
/heads admin toggle # Disable/enable head drops
/heads admin reload # Reload config after changes