Introduction
DDoSGuard is a Spigot plugin for Minecraft that protects your server from DDoS attacks by controlling simultaneous connections from the same IP address. When a player or attacker attempts too many connections in a short period, the plugin blocks new connections from that IP and displays a configured warning message. This helps prevent the server from being overloaded due to multiple malicious connection attempts.
System Requirements
- Spigot or Bukkit version 1.17 or higher.
- Java 8 or higher.
Features
- DDoS Protection: Limits simultaneous connections from the same IP.
- Flexible Configuration: Allows you to define the connection limit through a config.yml file.
- Custom Notification: Sends a message when the connection limit from the same IP is exceeded.
- Easy Installation and Setup: Simply place the plugin in the plugins folder and adjust the config.yml file.
Installation
- Download the plugin's .jar file.
- Place the .jar file in your Minecraft server's plugins folder.
- Restart the server to properly load the plugin.
- The config.yml configuration file will be automatically generated when the server restarts for the first time.
Configuration File - config.yml
The config.yml file allows you to adjust the plugin's behavior. Here, you can configure the maximum number of connections allowed from the same IP.
Code (YAML):
# DDoSGuard Configuration
# Maximum number of simultaneous connections allowed per IP.
max-connections
: 3
# Allow connections from proxies (true/false).
allow-proxies
: false
# List of IPs that are whitelisted and not affected by connection limits.
whitelisted-ips
:
-
"127.0.0.1"
-
"192.168.0.1"
# Message sent to players when too many connections are detected from the same IP.
kick-message
:
"Too many simultaneous connections from your IP."
# Message sent to players if proxy connections are not allowed.
proxy-kick-message
:
"Proxy connections are not allowed."
Event Handling
The plugin automatically registers player connection and disconnection events to monitor the number of active connections from the same IP. If the configured limit is exceeded, the player is notified, and new connections from that IP are blocked until previous ones are freed.