Skip to content

How to Test Minecraft Anti-Bot Protection

Configure and test Minecraft anti-bot protection, from iptables and nftables rate limits to EpicGuard and UltimateAntiBot, using bots to check every layer.

Pistonmaster7 min read

Defending Your Minecraft Server Against Bots

Bot attacks range from simple connection floods to campaigns that rotate through thousands of proxies. This guide covers the defense layers and how to test each one with bots.

The short version:

  1. Add a per-IP connection rate limit in your firewall.
  2. Install an anti-bot plugin and turn on its server list and reconnect checks.
  3. Copy the server to a test machine and join with real clients to set a false-positive baseline.
  4. Send bots in growing waves and record which layer blocks them and what happens to TPS.
  5. Loosen any check that also blocks real players, then test again.

This guide is for admins who test their own servers. Do not send bots to a server that you do not own or do not have written permission to test. Unauthorized attacks are illegal.

Common Attack Types

  • Connection flooding: Hundreds or thousands of simultaneous connection attempts overwhelm the server's handler before authentication even begins.
  • Join/leave spam: Bots join, immediately disconnect, and reconnect, consuming resources during authentication and world loading.
  • Proxy-rotated attacks: Traffic routed through thousands of proxies makes IP-based blocking useless.
  • Protocol-level attacks: Malformed or excessive packets exploit server vulnerabilities or burn CPU cycles.

Defense in Layers

No single layer stops every attack. With several layers, traffic that gets past one layer still meets the next.

LayerWhereToolsCatches
Network/FirewallBefore Minecraftiptables, nftables, UFWRaw connection floods, IP-based attacks
ProxyBungeeCord/VelocityProxy anti-bot pluginsDistributed attacks, early filtering
ServerPaper/SpigotEpicGuard, BotSentryBehavioral analysis, challenge-response
GamePlugin-levelAuthMe, custom systemsIn-game bot behavior, AFK farming

Network-Level Protection

Your first line of defense should block attacks before they ever touch your Minecraft process.

iptables

Rate-limit new connections and use ipset for scalable blacklisting. See the iptables documentation for more details.

# Allow established connections
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Rate limit new connections to port 25565 (10 per minute per IP)
sudo iptables -A INPUT -p tcp --dport 25565 -m state --state NEW \
  -m recent --set
sudo iptables -A INPUT -p tcp --dport 25565 -m state --state NEW \
  -m recent --update --seconds 60 --hitcount 11 -j DROP
sudo iptables -A INPUT -p tcp --dport 25565 -j ACCEPT

# SYN flood protection
sudo sysctl -w net.ipv4.tcp_syncookies=1

A normal join already opens several connections: the server list ping, the login, and a reconnect if your anti-bot plugin asks for one. Players behind one shared IP, such as a school or a household, also count together. A limit much lower than 10 per minute locks out real players.

Do not add a host-wide SYN limit such as --syn -m limit --limit 1/s. It applies to every port, so during a flood it also drops your own SSH connections.

For managing large blacklists efficiently, use ipset:

sudo ipset create minecraft-blacklist hash:ip hashsize 4096 maxelem 100000
sudo ipset add minecraft-blacklist 1.2.3.4
sudo iptables -I INPUT -p tcp --dport 25565 \
  -m set --match-set minecraft-blacklist src -j DROP
# Make rules persistent (Debian/Ubuntu)
sudo apt-get install iptables-persistent
sudo netfilter-persistent save

Server-Level Anti-Bot Plugins

Network filtering stops crude attacks, but sophisticated bots need behavioral analysis at the server level.

EpicGuard

EpicGuard is an open-source anti-bot plugin. Its repository was archived in 2025, so it gets no more fixes, but forks and existing installs remain common. It is simple to configure and has low overhead. EpicGuard uses a HOCON file. Each check has a check-mode of NEVER, ATTACK, or ALWAYS. See the EpicGuard repository for every option.

plugins/EpicGuard/settings.conf
server-list-check {
  check-mode = ATTACK   # Require a server list ping before joining
}
reconnect-check {
  check-mode = ALWAYS   # New players must join twice
}
proxy-check {
  check-mode = ATTACK   # Check for VPN and proxy addresses
}
auto-whitelist {
  enabled = true
  time-online = 600     # Seconds online before auto-whitelisting
}
misc {
  attack-connection-threshold = 6   # Connections per second that start attack mode
  lockdown-on-attack = true         # Only whitelisted players can join during an attack
}
SettingRecommendedWhy
server-list-check.check-modeATTACKBots often skip the server list ping
reconnect-check.check-modeALWAYSStops simple join spam
misc.attack-connection-threshold5-10Lower = more sensitive, higher risk of false positives
auto-whitelist.enabledtrueKnown players skip the checks

BotSentry

BotSentry is a paid plugin with more challenge-response checks than EpicGuard. Unlike EpicGuard, it still receives updates. Test it with the same waves before you rely on it.

UltimateAntiBot

UltimateAntiBot can also block at the firewall. Its firewall hook adds detected bot IPs to an ipset, so the kernel blocks them. Repeat offenders don't even make it to your Java process. The hook runs sudo commands, so it does not work on most shared hosting panels.

config.yml
antibotmode:
  trigger: 10   # Connections that start antibot mode
  keep: 15      # Seconds antibot mode stays on

checks:
  superjoin:
    enabled: true
    limit: 35   # Block IPs that connect more than 35 times...
    time: 300   # ...within 300 seconds

firewall:
  enabled: true
  ip-set-id: "uab_blacklist"
  timeout: 0    # 0 = keep the block until restart or a manual clear

DDoS Protection Services

Firewall rules and anti-bot plugins handle application-level attacks: bot joins, connection spam, and protocol abuse. But a volumetric DDoS attack saturates your network link before packets even reach your server. To stop that, you need a TCP reverse proxy that absorbs attack traffic before it reaches your network.

Some DDoS protection providers also filter Minecraft bots before traffic reaches your server. Test that layer with the same waves as your plugins.

For a full walkthrough of how these services work and how to make sure your real IP isn't leaking, see our DDoS protection guide.

Testing Your Defenses

A configured plugin is not a tested plugin. Confirm that your setup blocks bot waves and still lets real players in.

Setting Up a Test Environment

Do not test against your live server. Copy your setup to a separate server:

cp -r /path/to/prod-server /path/to/test-server

# Change port in server.properties to avoid conflicts
# server-port=25566

cd /path/to/test-server
java -Xms2G -Xmx2G -jar paper.jar nogui

Point the firewall rules from the sections above at the test port too, or they will not apply. Run the bots from a different machine than the server. Connections from 127.0.0.1 skip some checks, such as Paper's connection throttle.

What to Test

Start with legitimate traffic. Join with a real client. Have a few friends join within 30 seconds. Disconnect and reconnect a bunch of times. Everything should work without delays or false blocks.

Then move to simulated attacks. Start small (10 bots over 60 seconds) and escalate from there. 50 bots in 10 seconds, sustained reconnect spam over 5 minutes. Watch which checks trigger, how fast attack mode kicks in, and whether your TPS tanks.

Don't skip false positive testing either. Multiple players behind the same router, players on VPNs, players with flaky connections that cause rapid reconnects. If any of those get blocked, you need to loosen your thresholds or add whitelist exceptions.

Using SoulFire for Testing

SoulFire runs Minecraft client code on Fabric, so its bots send the same login sequence as a real client of that version. That lets you see which checks stop a bot that behaves like a client, not only a crude flood.

By default, all bots share the IP address of the machine that runs SoulFire. Per-IP limits then block them early. To test checks that look past the IP address, give the bots proxies.

Useful SoulFire plugins for testing:

  • Ping before join (server-list-bypass): Pings the server list before each join. Run one test with it off and one with it on to see whether your server list check stops bots that skip the ping and what it does with bots that don't. See Ping before join.
  • Anti AFK (anti-afk): Moves bots in random directions to test behavior checks.
  • Auto chat (auto-chat-message): Sends configured chat messages to test chat checks.
  • Minecraft client settings (client-settings): Sends the client settings packet that checks like EpicGuard's settings check expect.

The SoulFire testing guide covers how to ramp up load and record results.

Interpreting Results

After running tests, look at your plugin's statistics.

If most bots get through, tighten the checks or lower the thresholds. If a few get through, find the check they passed and tighten only that one. If every bot is blocked, repeat your real-player tests, because strict settings also block players behind VPNs or shared IPs.

Do not aim for a 100% block rate. Aim for a level of bot traffic that your server can absorb while real players still join without delay.

Monitoring

Log Analysis

Parse your server logs to spot attack patterns early:

check-bot-attack.sh
#!/bin/bash
THRESHOLD=50
LOG="/path/to/minecraft/logs/latest.log"

# Count logins per IP since the last restart (Paper logs "Name[/1.2.3.4:5678] logged in")
MAX_CONNECTS=$(grep "logged in with entity id" "$LOG" | grep -oE '\[/[0-9.]+:' | \
  sort | uniq -c | sort -rn | head -1 | awk '{print $1}')
MAX_CONNECTS=${MAX_CONNECTS:-0}

if [ "$MAX_CONNECTS" -gt "$THRESHOLD" ]; then
  curl -X POST "https://discord.com/api/webhooks/YOUR_WEBHOOK" \
    -H "Content-Type: application/json" \
    -d "{\"content\": \"Bot attack detected: $MAX_CONNECTS connections from single IP\"}"
fi
crontab
# Run every 5 minutes via cron
*/5 * * * * /usr/local/bin/check-bot-attack.sh

Track these metrics over time: blocks per hour, attack frequency, detection speed, and TPS during attacks versus baseline. Also keep an eye on how often you're manually whitelisting false positives. If that number keeps growing, it's time to dial back your thresholds.

Next steps

  1. Copy your server to a test machine and apply the firewall rules and plugin settings above.
  2. Download SoulFire and follow the staged load test with small waves first.
  3. Record which layer blocked each wave, then test again after every config change.
  4. To hide your server IP from volumetric attacks, read the DDoS protection guide.

Related articles