Skip to content

handy-git/ip2region

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ip2region


🌎中文文档


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~

Placeholder Support:

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+)

Special Notes on PAPI

You can use the following commands to test variable results:

/papi parse me %ip2region_region%
/papi parse me %ip2region_municipal%

User Guide

Data Sources

The plugin currently supports five methods for getting IP geolocation.
If you have your own ideas or channels, feel free to let me know for integration.

  1. offline - Local data source mode (IPv4 only, ~99% accuracy)
  2. ipPlus360 - Online API mode (IPv4/IPv6, paid)
  3. ipApi - Online API mode (IPv4/IPv6, free with rate limits)
  4. whois - Online API mode (IPv4/IPv6, free)
  5. voreApi - Online API mode (IPv4/IPv6, free)

Pros and Cons

Type Cost Accuracy Network Required IP Support Max Level Website
offline Free 99% No IPv4 City level Site
ipPlus360 Paid 99.999% Yes IPv4 & IPv6 District level Site
ipApi Free 99.9% Yes IPv4 & IPv6 City level Site
whois (1.3.0+) Free 99.9% Yes IPv4 & IPv6 District level Site
voreApi (1.3.0+) Free 99.9% Yes IPv4 & IPv6 District level Site

Special Note

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/"

Testing Instructions

For offline and ipApi 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

Project Page Views

Page Views Count

Download GitHub CI Builds:

GITHUB ACTIONS

Usage Statistics

Star History

Star History Chart

About

Provide PAPI variables for country, province, city, and ISP in Minecraft.

Topics

Resources

License

Stars

Watchers

Forks

Languages