Blacklist System
CocoAntiVPN features a persistent IP blacklist system that automatically blocks detected VPN/proxy users and provides custom ping responses.
How It Works
When a VPN is detected:
- Detection - API confirms IP is using VPN/proxy or is from blocked country
- Kick - Player is immediately kicked with configured message
- Blacklist - IP is added to persistent SQLite database
- Custom Ping - Blacklisted IPs receive fake server status
Automatic Blacklisting
Once an IP is detected as VPN/proxy, it's automatically blacklisted:
- Stored in SQLite database (
data.db) - Persists across server restarts
- Immediate rejection on future connections
- No API call needed for known bad IPs
Custom Ping Response
Blacklisted IPs see a custom server status when pinging:
blacklist-ping:
# Server version shown in client
version-name: "IP Blacklisted"
# Protocol version (-1 = incompatible)
protocol-version: -1
# MOTD message
motd: "&cCould not connect to the server."
# Max players shown
max-players: 0
# Online players shown
online-players: 0
# Player sample (hover text)
player-sample: ""
What Blacklisted Users See
With default settings:
- Version: "IP Blacklisted" (or shows as incompatible)
- MOTD: "Could not connect to the server."
- Players: 0/0
This discourages reconnection attempts by making the server appear down or incompatible.
Configuration Examples
Stealth Mode
Make server appear completely offline:
blacklist-ping:
version-name: ""
protocol-version: -1
motd: ""
max-players: -1
online-players: 0
player-sample: ""
Warning Message
Show clear warning to VPN users:
blacklist-ping:
version-name: "VPN Blocked"
protocol-version: -1
motd: "&cYour IP is blacklisted.\n&7Disable VPN to connect."
max-players: 0
online-players: 0
player-sample: "&cAccess Denied"
Fake Maintenance
Disguise as maintenance:
blacklist-ping:
version-name: "Maintenance"
protocol-version: -1
motd: "&6Server is under maintenance.\n&7Please try again later."
max-players: 0
online-players: 0
player-sample: ""
Unban Command
To remove an IP from the blacklist:
/antivpn unban <ip>
Permission: antivpn.command.unban
Examples:
/antivpn unban 192.168.1.100
> [CocoVPN] IP address 192.168.1.100 successfully removed from blacklist!
/antivpn unban 10.0.0.1
> [CocoVPN] IP address 10.0.0.1 is not on the blacklist!
Database Storage
Blacklisted IPs are stored in SQLite:
Table Structure:
CREATE TABLE blacklist (
ip TEXT PRIMARY KEY,
blocked_at INTEGER
);
Fields:
ip- The blacklisted IP addressblocked_at- Unix timestamp when blocked
Location:
- Bukkit:
plugins/CocoAntiVPN/data.db - BungeeCord:
plugins/CocoAntiVPN/data.db - Velocity:
plugins/cocoantivpn/data.db
Use Cases
Bot Attack Mitigation
During bot attacks:
- VPN bots are detected and blacklisted
- Subsequent connections from same IP are instantly rejected
- No API calls needed for known attackers
- Custom ping discourages automated reconnects
False Positive Recovery
If a legitimate player is incorrectly blacklisted:
- Player contacts support
- Admin runs
/antivpn unban <ip> - Player can immediately reconnect
- Consider adding to bypass list if recurring
ISP Proxy Issues
Some ISPs route through proxy-like infrastructure:
- Identify affected players
- Unban their IP:
/antivpn unban <ip> - Add to bypass:
/antivpn bypass add <player>
Best Practices
Regular Monitoring
Monitor blacklist activity via:
- Staff notifications (
antivpn.notifypermission) - Discord webhooks
- Database queries
Cleanup Old Entries
For large databases, consider periodic cleanup:
-- Remove entries older than 30 days
DELETE FROM blacklist
WHERE blocked_at < (strftime('%s', 'now') - 2592000);
Backup Database
Regularly backup data.db to prevent data loss:
cp plugins/CocoAntiVPN/data.db backups/antivpn-backup.db
Troubleshooting
Ping Response Not Working
- Ensure Netty injector is active (check startup logs)
- Some proxy setups may interfere
- Paper/Spigot handle ping differently
IP Not Being Blacklisted
- Check if VPN check is timing out
- Verify API key is valid
- Check database write permissions
Cannot Unban IP
- Verify IP format is correct
- Check permission:
antivpn.command.unban - IP may not be in blacklist