A simple and efficient geolocation plugin.
If this plugin helps you, clicking the ⭐ Star in the upper right corner would be a great support to the author~
This plugin currently registers the following PAPI variables (requires: PlaceholderAPI)
| Variable | Description | Example |
|---|---|---|
| %ip2region_region% | Overall region | China |
| %ip2region_national% | Country | China |
| %ip2region_provincial% | Province | Shanghai |
| %ip2region_municipal% | City | Shanghai City |
| %ip2region_serviceProvider% | ISP | China Telecom |
| %ip2region_ip% | Player current IP (1.0.8+) | 127.0.0.1 |
| %ip2region_district% | District (1.1.0+) | Songjiang (1.1.0+) |
You can use the following commands to test variable results:
/papi parse me %ip2region_region%
/papi parse me %ip2region_municipal%
The plugin currently supports seven methods for getting IP geolocation. If you have your own ideas or channels, feel free to let me know for integration.
- offline - Local data source mode (IPv4/IPv6, ~99% accuracy)
- ipPlus360 - Online API mode (IPv4/IPv6, paid)
- ipApi - Online API mode (IPv4/IPv6, free with rate limits)
- whois - Online API mode (IPv4/IPv6, free)
- voreApi - Online API mode (IPv4/IPv6, free)
- tencent - Tencent Maps online API mode (requires an application Key and SecretKey)
- internetData - Online API mode (IPv4/IPv6, free; country and ISP need no key, an optional key adds province and city)
| Type | Cost | Accuracy | Network Required | IP Support | Max Level | Language | Website |
|---|---|---|---|---|---|---|---|
| offline | Free | 99% | No | IPv4 & IPv6 | City level | Chinese | Site |
| ipPlus360 | Paid | 99.999% | Yes | IPv4 & IPv6 | District level | Chinese | Site |
| ipApi | Free | 99.9% | Yes | IPv4 & IPv6 | City level | 8 options | Site |
| whois (1.3.0+) | Free | 99.9% | Yes | IPv4 & IPv6 | District level | Chinese | Site |
| voreApi (1.3.0+) | Free | 99.9% | Yes | IPv4 & IPv6 | District level | Chinese | Site |
| tencent | Per official quota | See official data | Yes | IPv4 | District level | Chinese | Site |
| internetData | Free | See official data | Yes | IPv4 & IPv6 | City level | English | Site |
ipApi language is controlled by
ipApiLangin config.yml: en, de, es, pt-BR, fr, ja, zh-CN, ru. Leave it empty to use the API default (en).
For offline type starting from plugin version 2.0.0+, data is no longer built-in and needs to be downloaded manually and placed in the plugins/ip2region directory.
123 Drive: Click to Access
GitHub: Click to Access
If you choose to purchase ipPlus360, city-level data is recommended:
IPv4
IPv6
For district-level data,
please refer to the official API docs and manually add the following to your config.yml.
Modify other levels accordingly.
ipPlus360Ipv4Url: "https://api.ipplus360.com/ip/geo/v1/district/"
ipPlus360Ipv6Url: "https://api.ipplus360.com/ip/geo/v1/ipv6/district/"
For tencent mode, create an application in the Tencent Maps console, enable WebServiceAPI and signature verification:
dataSource: tencent
tencentAppKey: "application Key"
tencentAppSecret: "SecretKey"
For internetData mode, country and ISP (the network name) need no key, see the terms and privacy policy. To also get province and city, add a free key from InternetData:
dataSource: internetData
internetDataKey: "your key"
For offline, ipApi, internetData and tencent modes, add the following in config.yml and reload the plugin, then
re-login the player:
testIp: test IP
For ipPlus360 mode, add the following in config.yml and reload the plugin, then re-login the player
(Only one can be set at a time, if both are present, IPv4 will be used by default):
testIp4: test IP
testIp6: test IP