
NetwatchZ 是一款适用于 Spigot、Paper 和 Velocity 的 Minecraft 插件,它通过 IP 屏蔽、地理屏蔽和 VPN 检测等功能,帮助保护你的服务器免受机器人和其他恶意活动的侵害。
功能特性
- ✅ IP 查询(例如 Geolite2、ip-api.com)
- ✅ IP 黑名单
- ✅ 动态获取 IP 列表
- ✅ 地理屏蔽
- ✅ 配置任意 IP 信息服务
- ✅ 自动下载并刷新 Geolite2 数据库
- ✅ VPN 屏蔽(例如 vpnapi.io、proxycheck.io)
权限
netwatchz.ipinfo - 获取玩家的 IP 及 IP 信息
netwatchz.admin.debug - 生成调试报告
配置
你可以在 plugins/NetwatchZ 文件夹中找到配置文件。主配置文件是 config.yml。
config.yml
#
# _ _ _ _ _ ______
# | \ | | | | | | | | |___ /
# | \| | ___| |___ ____ _| |_ ___| |__ / /
# | . ` |/ _ \ __\ \ /\ / / _` | __/ __| '_ \ / /
# | |\ | __/ |_ \ V V / (_| | || (__| | | | / /__
# |_| \_|\___|\__| \_/\_/ \__,_|\__\___|_| |_| /_____|
#
# 将语言设置为 "lang" 文件夹中找到的任何代码(不要添加 .yml 扩展名)
# 你可以添加自己的语言文件。使用 https://github.com/ZetaPlugins/NetwatchZ/tree/main/src/main/resources/lang/en-US.yml 作为模板
# 如果你想帮助翻译此插件,请参阅本文:https://docs.zetaplugins.com/localization
# | en-US | de-DE |
lang: "en-US"
# 如果设置为 true,OP 玩家将始终被允许加入
always_allow_ops: true
ip_list:
# 启用或禁用 IP 列表功能。
enabled: true
# 如果模式为 "blacklist"(黑名单),则列表中的 IP 将被屏蔽。
# 如果模式为 "whitelist"(白名单),则只允许列表中的 IP 接入。
mode: "blacklist"
# 设置要屏蔽或允许的 IP 或 CIDR 范围列表。
# 这些是位于 "plugins/NetwatchZ/ipLists" 文件夹内的文件。
lists:
- "vpn_list.txt"
# - "another_list.txt"
fetch_jobs:
vpn_list:
# 设置用于获取 IP 列表的 URL。
url: "https://raw.githubusercontent.com/X4BNet/lists_vpn/refs/heads/main/output/vpn/ipv4.txt"
# 设置保存获取到的列表的文件名。该文件将保存在 "plugins/NetwatchZ/ipLists" 文件夹中。
filename: "vpn_list.txt"
# 设置获取列表的频率(以小时为单位)。
# 最小值为 1 小时。
update_interval_hours: 24
# 你可以在这里添加更多获取任务。例如:
# another_list:
# url: "https://example.com/another_list.txt"
# filename: "another_list.txt"
# update_interval_hours: 12
geo_blocking:
# 启用或禁用地理屏蔽。
enabled: false
# 以下列表是黑名单还是白名单。
# 如果设置为 true,则列表中的国家将被屏蔽。
# 如果设置为 false,则列表中未包含的国家将被屏蔽。
blacklist: true
# 设置要屏蔽或允许的国家列表。
# 国家代码的格式取决于 IP 信息提供商,但通常是两位字母的国家代码(ISO 3166-1 alpha-2)。
# 示例:["US", "CA", "GB"]
countries: []
ip_info_provider:
# 设置要使用的 IP 信息提供商。
# 可能的值包括:
# - "ip-api" (https://ip-api.com)
# - "ipwhois" (https://ipwhois.app)
# - "geolite2" (MaxMind GeoLite2 数据库 - 推荐)
# - "custom" (使用下面定义的自定义 IP 信息提供商)
provider: "ip-api"
geolite2:
# 设置 GeoLite2 数据库的 URL。这些数据库每 7 天自动刷新一次。
# 这些可以是包含你许可证密钥的官方 MaxMind GeoLite2 数据库的 tar.gz 文件链接,也可以是你自己托管的数据库链接(也支持直接下载 .mmdb 文件)。
# 你可以通过在 https://www.maxmind.com/en/geolite2/signup 创建账户来获取免费许可证密钥。
asn_url: "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN&license_key=YOUR_KEY&suffix=tar.gz"
city_url: "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=YOUR_KEY&suffix=tar.gz"
country_url: "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=YOUR_KEY&suffix=tar.gz"
# 归属声明:本产品包含由 MaxMind 创建的 GeoLite2 数据,可从 https://www.maxmind.com 获取
custom:
# 设置自定义 IP 信息提供商的 URL。它应返回 JSON 响应。
# 使用 %ip% 作为 IP 地址的占位符。
url: "https://api.example.com/json/%ip%"
# 设置自定义 IP 信息提供商的请求头。
headers:
Authorization: "Bearer YOUR_API_KEY"
设置自定义 IP 信息提供程序的查询参数。
parse_fields:
# 键为所需的数据,值为响应中的 JSON 键。
# 如果 API 未提供某些数据,可以将其省略。
country: "country"
countryCode: "countryCode"
regionName: "regionName"
region: "region"
city: "city"
lat: "latitude"
lon: "longitude"
timezone: "timezone"
isp: "isp"
org: "organization"
asn: "asn"
ip: "ip"
vpn_block 设置用于在线服务,以提供有关 IP 是否为 VPN 或代理的信息。
这与 ip_list 功能独立,后者也可用于阻止 VPN。
vpn_block:
启用或禁用 VPN 阻止功能。
enabled: false
设置要使用的 VPN 信息提供程序。
可能的值为:
- "vpnapi" ()
- "proxycheck" ()
- "custom"(使用下面定义的自定义 VPN 信息提供程序)
provider: "vpnapi"
如果使用 vpnapi 或 proxycheck,请在此处设置你的 API 密钥
api_key: ""
custom:
# 设置自定义 VPN 信息提供程序的 URL。它应返回 JSON 响应。
# 使用 %ip% 作为 IP 地址的占位符。
url: "
# 设置自定义 VPN 信息提供程序的标头。
headers:
Authorization: "Bearer YOUR_API_KEY"
# 设置自定义 VPN 信息提供程序的查询参数。
parse_fields:
# 键为所需的数据,值为响应中的 JSON 键。
# 如果 API 未提供某些数据,可以将其省略。
vpn: "security.vpn"
proxy: "security.proxy"
tor: "security.tor"
relay: "security.relay"
hosting: "security.hosting"
设置当检测到特定类型的 VPN/代理时该做什么。
is_vpn:
# 如果检测到 IP 为 VPN,是否阻止连接。
block: true
is_proxy:
block: false
is_tor:
block: true
is_relay:
block: false
is_hosting:
block: false
</details>
## 免责声明
本插件支持 GeoLite2 用于 IP 地理定位。本产品包含由 MaxMind 创建的 GeoLite2 数据,可从 https://www.maxmind.com 获取。服务器所有者必须使用自己的 MaxMind 账户和许可证密钥下载 GeoLite2,并在插件设置中配置下载 URL。该数据不用于识别特定的家庭或个人。
## 支持
如果你需要帮助设置插件,或者发现了错误,你可以加入我们的 Discord [这里](https://strassburger.org/discord)。
[](https://strassburger.org/discord)
[](https://docs.zetaplugins.com/netwatchz)
---
[](https://bstats.org/plugin/bukkit/NetwatchZ/27376)
[](https://bstats.org/plugin/velocity/NetwatchZ/27407)

NetwatchZ is a Minecraft plugin for Spigot, Paper, and Velocity that helps protect your server against bots and other malicious activity through IP blocking, geoblocking, and VPN detection.
Features
- ✅ IP lookup (e.g. Geolite2, ip-api.com)
- ✅ IP blacklists
- ✅ Dynamically fetch IP lists
- ✅ Geoblocking
- ✅ Configure any IP information service
- ✅ Automatically download and refresh Geolite2 database
- ✅ VPN blocking (e.g. vpnapi.io, proxycheck.io)
Permissions
netwatchz.ipinfo - Get the IP and IP information from a player
netwatchz.admin.debug - Generate debug reports
Configuration
You can find the configuration files in the plugins/NetwatchZ folder. The main configuration file is config.yml.
config.yml
#
# _ _ _ _ _ ______
# | \ | | | | | | | | |___ /
# | \| | ___| |___ ____ _| |_ ___| |__ / /
# | . ` |/ _ \ __\ \ /\ / / _` | __/ __| '_ \ / /
# | |\ | __/ |_ \ V V / (_| | || (__| | | | / /__
# |_| \_|\___|\__| \_/\_/ \__,_|\__\___|_| |_| /_____|
#
# Set the language to any code found in the "lang" folder (don't add the .yml extension)
# You can add your own language files. Use https://github.com/ZetaPlugins/NetwatchZ/tree/main/src/main/resources/lang/en-US.yml as a template
# If you want to help translating the plugin, please refer to this article: https://docs.zetaplugins.com/localization
# | en-US | de-DE |
lang: "en-US"
# If set to true, OP players will always be allowed to join
always_allow_ops: true
ip_list:
# Enable or disable the IP list feature.
enabled: true
# If the mode is "blacklist", the IPs in the lists will be blocked.
# If the mode is "whitelist", only the IPs in the lists will be allowed.
mode: "blacklist"
# Set the list of IPs or CIDR ranges to block or allow.
# These are files inside the "plugins/NetwatchZ/ipLists" folder.
lists:
- "vpn_list.txt"
# - "another_list.txt"
fetch_jobs:
vpn_list:
# Set the URL to fetch the IP list from.
url: "https://raw.githubusercontent.com/X4BNet/lists_vpn/refs/heads/main/output/vpn/ipv4.txt"
# Set the filename to save the fetched list as. This file will be saved in the "plugins/NetwatchZ/ipLists" folder.
filename: "vpn_list.txt"
# Set how often the list should be fetched (in hours).
# The minimum is 1 hour.
update_interval_hours: 24
# You can add more fetch jobs here. e.g.
# another_list:
# url: "https://example.com/another_list.txt"
# filename: "another_list.txt"
# update_interval_hours: 12
geo_blocking:
# Enable or disable geo-blocking.
enabled: false
# Wether or not the following list should be a blacklist or a whitelist.
# If set to true, the countries in the list will be blocked.
# If set to false, only the countries not in the list will be blocked.
blacklist: true
# Set the list of countries to block or allow.
# The format of the country code depends on the IP info provider, but usually it is a two-letter country code (ISO 3166-1 alpha-2).
# Example: ["US", "CA", "GB"]
countries: []
ip_info_provider:
# Set the IP info provider to use.
# Possible values are:
# - "ip-api" (https://ip-api.com)
# - "ipwhois" (https://ipwhois.app)
# - "geolite2" (MaxMind GeoLite2 databases - recommended)
# - "custom" (Uses the custom IP info provider defined below)
provider: "ip-api"
geolite2:
# Set the urls to the GeoLite2 databases. These are refreshed automatically every 7 days.
# These can be links to tar.gz files of the official MaxMind GeoLite2 databases with your license key included or links to your own hosted databases (downloading .mmdb files directly is also supported).
# You can get a free license key by creating an account on https://www.maxmind.com/en/geolite2/signup
asn_url: "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN&license_key=YOUR_KEY&suffix=tar.gz"
city_url: "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=YOUR_KEY&suffix=tar.gz"
country_url: "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=YOUR_KEY&suffix=tar.gz"
# Attribution: This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com
custom:
# Set the custom IP info provider URL. It should return a JSON response.
# Use %ip% as a placeholder for the IP address.
url: "https://api.example.com/json/%ip%"
# Set the custom IP info provider headers.
headers:
Authorization: "Bearer YOUR_API_KEY"
# Set the custom IP info provider query parameters.
parse_fields:
# Keys are the data needed. Values are the json keys in the response.
# If certain data is not provided by the API, you can leave it out.
country: "country"
countryCode: "countryCode"
regionName: "regionName"
region: "region"
city: "city"
lat: "latitude"
lon: "longitude"
timezone: "timezone"
isp: "isp"
org: "organization"
asn: "asn"
ip: "ip"
# The vpn_block settings are for online services that provide information about whether an IP is a VPN or proxy.
# This is independent of the ip_list feature, which can also be used to block VPNs
vpn_block:
# Enable or disable the VPN blocking feature.
enabled: false
# Set the VPN info provider to use.
# Possible values are:
# - "vpnapi" (https://vpnapi.io)
# - "proxycheck" (https://proxycheck.io)
# - "custom" (Uses the custom VPN info provider defined below)
provider: "vpnapi"
# If using vpnapi or proxycheck, set your api key here
api_key: ""
custom:
# Set the custom VPN info provider URL. It should return a JSON response.
# Use %ip% as a placeholder for the IP address.
url: "https://api.example.com/vpn/%ip%"
# Set the custom VPN info provider headers.
headers:
Authorization: "Bearer YOUR_API_KEY"
# Set the custom VPN info provider query parameters.
parse_fields:
# Keys are the data needed. Values are the json keys in the response.
# If certain data is not provided by the API, you can leave it out.
vpn: "security.vpn"
proxy: "security.proxy"
tor: "security.tor"
relay: "security.relay"
hosting: "security.hosting"
# Set what to do when a certain type of VPN/proxy is detected.
is_vpn:
# Wether or not to block the connection if the IP is detected as a VPN.
block: true
is_proxy:
block: false
is_tor:
block: true
is_relay:
block: false
is_hosting:
block: false
Disclaimer
This plugin supports GeoLite2 for IP geolocation. This product includes GeoLite2 data created by MaxMind, available from . Server owners must download GeoLite2 with their own MaxMind account and license key and configure the download URL in plugin settings. The data is not used for identifying specific households or individuals.
Support
If you need help with the setup of the plugin, or found a bug, you can join our discord here.
评论 0
登录后参与评分
还没有评论,来抢沙发吧