- Overview
- Features
- Installation
- Commands
- Permissions
- Configuration
- Database
- Discord Integration
- API
- Events
- FAQ
BanHammer is a powerful moderation plugin for Minecraft Paper servers that provides a special "Ban Hammer" item. With this, administrators can ban or kick players in a dramatic and entertaining way - including lightning, particles, and sound effects!
Version 3.1.0 brings massive enhancements:
- β Folia Support - Dual-compatible with Paper and Folia from a single JAR
- β Ban Presets System - Quick switching between predefined ban types
- β Kick/Jail Presets System - Left-click preset cycling for kicks and jails
- β Complete database system (SQLite & MySQL)
- β Ban history with detailed tracking
- β Automatic unbanning for temporary bans
- β Discord integration with webhooks
- β REST API for web interfaces
- β IP banning support
- β Extended punishment types (Mute, Jail, Warnings)
- β Ban appeals system
- β Statistics and leaderboards
- β Multi-language support
- β Custom events for developers
- β Import/Export functions
- β Modrinth update checker
Ban Presets System (NEW!):
- π― Shift + Right-Click: Switch between predefined ban presets
- π Actionbar Feedback: Shows active preset when switching
- π Sound Feedback: Individual sound per preset
- β‘ Quick Switching: 250ms cooldown (configurable)
- π Unlimited Presets: Define your own ban categories
- π¨ Fully Configurable: Duration, reason, IP-ban, sound per preset
Kick/Jail Presets System (NEW!):
- π― Shift + Left-Click: Switch between predefined kick/jail presets
- π Left-Click on Player: Execute kick or jail with active preset
- π Actionbar Feedback: Shows active kick/jail preset
- π Sound Feedback: Individual sound per preset
- π Mix Kicks & Jails: Combine instant kicks with timed jails in one preset list
- π¨ Fully Configurable: Duration (null=kick, set=jail), reason, sound per preset
Dual-Action Hammer:
- Right-Click on Player: Ban with currently selected ban preset
- Shift + Right-Click: Switch ban preset mode (works anywhere)
- Left-Click on Player: Kick or jail with active kick/jail preset
- Shift + Left-Click: Switch kick/jail preset mode (works anywhere)
- Left-Click in Air: Ray-trace targeting (up to 5 blocks)
Visual Effects:
- β‘ Lightning effect at target location
- π Thunder & explosion sounds
- β¨ Particles (critical & smoke)
- π¨ Optional knockback
Security:
- β±οΈ Cooldown system against spam
- π‘οΈ Bypass permission for protected players
- π« Self-protection (no self-bans)
- π Block-breaking prevention with hammer
SQLite & MySQL Support:
database:
enabled: true
type: SQLITE # or MYSQLTracking Features:
- Complete ban history for every player
- Staff statistics (who issued how many bans)
- Server names for multi-server networks
- IP address tracking (optional)
- Automatic cleanup of expired bans
Query Options:
- History by player
- Active punishments
- Filter punishments by type
- Statistics by staff member
tempBans:
enabled: true
checkInterval: 60 # seconds
notifyOnExpire: true- Automatic unbanning when temporary bans expire
- Configurable check intervals
- Event triggers for external integrations
- Discord notifications
Define preconfigured ban types and switch between them quickly:
presets:
temp_1h:
displayName: "1 Hour Ban"
reason: "Temporary ban - 1 hour"
duration: "1h"
ipBan: false
sound: "BLOCK_NOTE_BLOCK_PLING"
temp_1d:
displayName: "1 Day Ban"
reason: "Temporary ban - 1 day"
duration: "1d"
ipBan: false
sound: "BLOCK_NOTE_BLOCK_PLING"
permanent:
displayName: "Permanent Ban"
reason: "Permanently banned"
duration: "permanent"
ipBan: false
sound: "BLOCK_NOTE_BLOCK_BASS"
permanent_ip:
displayName: "Permanent IP-Ban"
reason: "Permanently IP-banned"
duration: "permanent"
ipBan: true
sound: "BLOCK_ANVIL_LAND"
# Cooldown for preset switching (milliseconds)
presetSwitchCooldown: 250Usage:
- Shift + Right-Click (anywhere) β Switches to next preset
- Actionbar shows:
Preset: <Name> (<Duration>) - Sound is played
- Right-Click on Player β Ban with active preset
Features:
- Unlimited presets definable
- Each preset with own duration, reason, IP-ban flag and sound
- Cycle system: Automatically switches to next preset
- Per-player tracking: Each player has their own active preset
- Configurable switch cooldown against spam
Define preconfigured kick/jail types and switch between them quickly:
kickJailPresets:
quick_kick:
displayName: "Quick Kick"
reason: "Kicked from server"
# No duration = kick
sound: "BLOCK_NOTE_BLOCK_PLING"
warning_kick:
displayName: "Warning Kick"
reason: "Warning - kicked from server"
sound: "BLOCK_NOTE_BLOCK_PLING"
jail_10m:
displayName: "10 Min Jail"
reason: "Jailed for 10 minutes"
duration: "10m"
sound: "BLOCK_NOTE_BLOCK_BASS"
jail_30m:
displayName: "30 Min Jail"
reason: "Jailed for 30 minutes"
duration: "30m"
sound: "BLOCK_NOTE_BLOCK_BASS"
jail_1h:
displayName: "1 Hour Jail"
reason: "Jailed for 1 hour"
duration: "1h"
sound: "BLOCK_ANVIL_LAND"Usage:
- Shift + Left-Click (anywhere) β Switches to next kick/jail preset
- Actionbar shows:
Kick/Jail Preset: <Name> (<Duration>) - Sound is played
- Left-Click on Player β Execute kick or jail with active preset
Features:
- Mix kicks and jails in one preset list (duration=null for kicks, set for jails)
- Unlimited presets definable
- Each preset with own duration, reason, and sound
- Cycle system: Automatically switches to next preset
- Per-player tracking: Each player has their own active preset
- Same cooldown as ban preset switching
discord:
enabled: true
webhookUrl: "https://discord.com/api/webhooks/..."
notifications:
bans: true
kicks: true
unbans: trueFeatures:
- Color-coded embeds for different actions
- Automatic notifications for bans/kicks/unbans
- Staff names and server information
- Duration display for temporary bans
updateChecker:
enabled: true
checkOnStartup: true
notifyAdmins: true
checkInterval: 6 # hours
modrinthProjectId: "bs-banhammer"Features:
- Automatic update checking on startup
- Periodic checks (configurable interval)
- Admin notifications on login (with permission)
- Semantic version comparison
- Download links and changelog URLs
api:
enabled: true
port: 8080
token: "your-secret-token"
rateLimit:
enabled: true
requestsPerMinute: 60Available Endpoints:
GET /api/v1/punishments/{id} - Get single punishment
GET /api/v1/punishments/player/{uuid} - Player history
GET /api/v1/punishments/active - All active bans
GET /api/v1/statistics/staff - Staff statistics
GET /api/v1/appeals/pending - Pending appeals
POST /api/v1/appeals/{id}/review - Review appeal
Mute System:
punishmentTypes:
mute:
enabled: true
defaultDuration: "1h"
preventChat: true
preventCommands: trueJail System:
punishmentTypes:
jail:
enabled: true
preventTeleport: true
preventDamage: trueEssentials Jail Integration (NEW!):
- Soft Dependency: Optional Essentials integration
- Preference System: Uses Essentials jail if available, falls back to built-in
- Reflection-Based: No hard dependency required
- Automatic Detection: Checks for Essentials on startup
- Built-in Fallback: Own jail system if Essentials not installed
When Essentials is detected:
- Uses Essentials
/jailsystem automatically - Integrates with existing Essentials jails
- Teleports players to configured Essentials jail location
- Falls back to built-in jail if Essentials fails
Configure jail location:
# With Essentials: Configure in Essentials/jails.yml
# Built-in: Use /setjail command in-gameWarnings System:
punishmentTypes:
warnings:
enabled: true
autoBanThreshold: 3
autoBanDuration: "7d"appeals:
enabled: true
allowIngame: true
cooldown: 24 # hours
maxAppealsPerPunishment: 3Players can submit appeals with /appeal <text>, staff can review them with /bh appeals.
statistics:
enabled: true
leaderboards:
enabled: true
showTop: 10- Tracking of all punishments per staff member
- Leaderboard system
- GUI view available
- Exportable via API
language: "en" # or "de"Available Languages:
- π©πͺ German (de) - VollstΓ€ndig ΓΌbersetzt
- π¬π§ English (en) - Fully translated
Each language has its own message file (messages_de.yml, messages_en.yml) with all plugin messages, commands, and notifications.
Custom Events:
// Fired BEFORE a player is punished (cancellable)
PlayerPunishEvent event = new PlayerPunishEvent(staff, victim, type, reason, duration);
// Fired AFTER a player was punished
PlayerPunishedEvent event = new PlayerPunishedEvent(staff, victimName, record);
// Fired when punishment is removed
PlayerUnpunishedEvent event = new PlayerUnpunishedEvent(staff, record, reason, automatic);PunishmentManager API:
PunishmentManager pm = plugin.getPunishmentManager();
// Ban a player
pm.banPlayer(staff, victim, reason, duration, ipBan)
.thenAccept(id -> {
// Ban successful, id is the database record ID
});
// Get player history
pm.getHistory(playerUuid, 50)
.thenAccept(history -> {
// Process history
});-
Requirements:
- Paper or Folia Server 1.21.x or higher
- Java 21 or higher
- Optional: MySQL Server (for MySQL mode)
-
Install Plugin:
# Copy plugin JAR to plugins/ folder cp banhammer-3.1.0.jar server/plugins/ # Start server ./start.sh
-
Adjust Configuration:
# Edit config.yml nano plugins/BanHammer/config.yml # For advanced features see config-enhanced.yml
-
Configure Resource Pack (Optional):
# Edit plugins/BanHammer/config.yml resourcePack: plugin: enabled: true url: "" hash: ""
Note: The hash is the SHA-1 hash of the resource pack file. Generate it with:
sha1sum resource-pack.zip
| Command | Description | Permission |
|---|---|---|
/banhammer |
Main command, shows help | banhammer.command |
/bh give <player> |
Give BanHammer to player | banhammer.give |
/bh reload |
Reload config (reinitializes Discord & Database) | banhammer.reload |
/bh pack |
Send resource pack manually | banhammer.command |
/bh history <player> [page] |
Show punishment history | banhammer.history |
/bh unban <player> [reason] |
Unban a player | banhammer.unban |
/bh stats [player] |
Show statistics | banhammer.stats |
/bh appeals |
Show pending appeals | banhammer.appeals |
/bh approve <id> [response] |
Approve appeal | banhammer.appeals.review |
/bh deny <id> [response] |
Deny appeal | banhammer.appeals.review |
/appeal <text> |
Submit appeal | banhammer.appeal |
/mute <player> <duration> [reason] |
Mute a player | banhammer.mute |
/unmute <player> [reason] |
Unmute a player | banhammer.mute |
/jail <player> <duration> [reason] |
Jail a player | banhammer.jail |
/unjail <player> [reason] |
Release from jail | banhammer.jail |
/setjail |
Set jail location | banhammer.jail |
/warn <player> [reason] |
Warn a player | banhammer.warn |
Alias: /bh is shorthand for /banhammer
| Permission | Description | Default |
|---|---|---|
banhammer.command |
Basic command access | op |
banhammer.use |
Can use the BanHammer | op |
banhammer.give |
Can give hammer to others | op |
banhammer.reload |
Can reload config | op |
banhammer.bypass |
Immune to BanHammer | op |
banhammer.history |
Can view history | op |
banhammer.history.others |
Can view others' history | op |
banhammer.unban |
Can unban players | op |
banhammer.stats |
Can view statistics | op |
banhammer.appeals |
Can view appeals | op |
banhammer.appeals.review |
Can review appeals | op |
banhammer.appeal |
Can submit appeals | true |
banhammer.ipban |
Can issue IP bans | op |
banhammer.mute |
Can mute players | op |
banhammer.jail |
Can jail players | op |
banhammer.warn |
Can warn players | op |
banhammer.updatenotify |
Receive update notifications | op |
# Item settings
item:
material: CARROT_ON_A_STICK
name: "<gold>Ban Hammer</gold>"
customModelData: 812345
# Ban settings
ban:
enabled: true
reason: "You were struck by the BanHammer."
duration: "permanent" # or: 7d, 1h30m, PT24H
broadcast: true
# Cooldown in seconds
cooldownSeconds: 3
# Effects
effects:
lightning: true
sound: true
particles: trueSee config-enhanced.yml for ALL available options with detailed documentation.
Most Important Options:
# Enable database
database:
enabled: true
type: SQLITE
# Discord notifications
discord:
enabled: true
webhookUrl: "..."
# Auto-unban
tempBans:
enabled: true
checkInterval: 60
# REST API
api:
enabled: true
port: 8080
token: "secret"
# Appeals system
appeals:
enabled: true
cooldown: 24
# Update checker
updateChecker:
enabled: true
checkInterval: 6Automatically enabled, no additional configuration needed:
database:
enabled: true
type: SQLITE
sqlite:
file: "banhammer.db"For large networks with multiple servers:
database:
enabled: true
type: MYSQL
mysql:
host: "localhost"
port: 3306
database: "banhammer"
username: "root"
password: "password"MySQL Advantages:
- Shared database for all servers
- Better performance with many entries
- External access possibilities
punishments Table:
- id (INT, PK, AUTO_INCREMENT)
- victim_uuid (VARCHAR)
- victim_name (VARCHAR)
- victim_ip (VARCHAR, optional)
- staff_uuid (VARCHAR)
- staff_name (VARCHAR)
- type (VARCHAR) - BAN, KICK, MUTE, etc.
- reason (TEXT)
- issued_at (BIGINT)
- expires_at (BIGINT, nullable)
- active (BOOLEAN)
- unban_staff_uuid (VARCHAR, nullable)
- unban_reason (TEXT, nullable)
- unbanned_at (BIGINT, nullable)
- server_name (VARCHAR)appeals Table:
- id (INT, PK, AUTO_INCREMENT)
- punishment_id (INT, FK)
- player_uuid (VARCHAR)
- player_name (VARCHAR)
- appeal_text (TEXT)
- submitted_at (BIGINT)
- status (VARCHAR) - PENDING, APPROVED, DENIED
- reviewed_by (VARCHAR, nullable)
- reviewer_name (VARCHAR, nullable)
- review_response (TEXT, nullable)
- reviewed_at (BIGINT, nullable)-
Create Discord Webhook:
- Go to Server Settings β Integrations β Webhooks
- Create new webhook
- Copy webhook URL
-
Enter in Config:
discord: enabled: true webhookUrl: "https://discord.com/api/webhooks/..."
-
Configure Notifications:
notifications: bans: true kicks: true mutes: true warnings: true unbans: true appeals: true
- π΄ Bans: Red (#FF0000)
- π Kicks: Orange (#FFA500)
- π’ Unbans: Green (#00FF00)
- π‘ Mutes: Yellow (#FFFF00)
All API requests require an Authorization header:
curl -H "Authorization: Bearer your-secret-token" \
http://localhost:8080/api/v1/punishments/activeGet Player History:
curl -H "Authorization: Bearer TOKEN" \
http://localhost:8080/api/v1/punishments/player/UUIDActive Bans:
curl -H "Authorization: Bearer TOKEN" \
http://localhost:8080/api/v1/punishments/activeStaff Statistics:
curl -H "Authorization: Bearer TOKEN" \
http://localhost:8080/api/v1/statistics/staffDefault: 60 requests per minute
api:
rateLimit:
enabled: true
requestsPerMinute: 60When exceeded: HTTP 429 (Too Many Requests)
PlayerPunishEvent (Cancellable):
@EventHandler
public void onPunish(PlayerPunishEvent event) {
Player staff = event.getStaff();
Player victim = event.getVictim();
PunishmentType type = event.getType();
// Modify reason
event.setReason("Modified reason");
// Modify duration
event.setDuration(Duration.ofDays(7));
// Cancel event
if (someCondition) {
event.setCancelled(true);
}
}PlayerPunishedEvent:
@EventHandler
public void onPunished(PlayerPunishedEvent event) {
PunishmentRecord record = event.getRecord();
String victim = event.getVictimName();
// After successful punishment
// Perform own actions
}PlayerUnpunishedEvent:
@EventHandler
public void onUnpunished(PlayerUnpunishedEvent event) {
PunishmentRecord record = event.getRecord();
boolean automatic = event.isAutomatic();
// Was automatically unbanned?
if (automatic) {
// Temporary ban expired
}
}How do I enable the database?
Set in config.yml:
database:
enabled: true
type: SQLITE # or MYSQLHow do I create temporary bans?
Set a duration in config.yml:
ban:
duration: "7d" # 7 days
# Or: "1h30m", "PT24H", etc.Does it work with Folia?
Yes! Since version 3.1.0, BanHammer fully supports Folia. The plugin automatically detects whether it's running on Paper or Folia at startup and uses the correct scheduler APIs. No configuration needed β just use the same JAR on both platforms.
Does it work with Velocity/BungeeCord?
Yes! With MySQL database all servers can use the same database:
database:
type: MYSQL
mysql:
host: "shared-mysql-server"How do I import bans from other plugins?
Enable import in config:
importExport:
enableImport: true
importFrom: "LiteBans" # or AdvancedBan, BanManagerThen: /bh import
Can I use the plugin without a database?
Yes! Simply set database.enabled: false. The plugin will then only use Minecraft's built-in ban system. Features like history, statistics, and appeals won't be available.
How do I customize the effects?
All effects are configurable in config.yml:
effects:
lightning: true # Lightning effect
sound: true # Thunder/explosion sounds
particles: true # Particle effects
knockback:
enabled: false # Knockback
horizontal: 0.8
vertical: 0.35How does the preset system work?
The preset system allows quick switching between ban types:
- Define presets in
config.yml:
presets:
warning:
displayName: "Warning Ban"
duration: "1h"
reason: "First warning"
ipBan: false
sound: "BLOCK_NOTE_BLOCK_PLING"-
Use in-game:
- Shift + Right-Click with hammer β Switches preset
- Actionbar shows current preset
- Right-Click on Player β Ban with active preset
-
Advantages:
- No commands needed
- Quick switching between ban types
- Visual feedback (actionbar + sound)
- Each staff has their own active preset
How does the kick/jail preset system work?
The kick/jail preset system works similar to ban presets:
- Define presets in
config.yml:
kickJailPresets:
quick_kick:
displayName: "Quick Kick"
reason: "Kicked"
# No duration = kick
jail_30m:
displayName: "30 Min Jail"
reason: "Jailed"
duration: "30m" # Has duration = jail-
Use in-game:
- Shift + Left-Click with hammer β Switches kick/jail preset
- Actionbar shows current preset
- Left-Click on Player β Execute kick or jail with active preset
-
Advantages:
- Mix kicks and jails in one list
- Duration null = kick, duration set = jail
- Same quick switching as ban presets
- Separate tracking from ban presets
MIT License - see LICENSE file
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Discord: Join our Discord
- Issues: GitHub Issues
- Source Code: GitHub Repository
Developed with β€οΈ for the Minecraft community
- Original concept & base implementation
- Enhanced features & database system
- Discord & API integration
- Event system for developers
Dependencies: