GeoIP provides an approximate lookup of where your players come from, based on their public IP and public geographical databases.
If you found any bugs or have any suggestions, please open an issue on GitHub Issues.
If you like this plugin, please star it on GitHub.
Command | Permission | Description | Default |
---|---|---|---|
/geoip |
geoip.show | Shows the GeoIP location of a player. | OP |
/geoip |
geoip.show.fullip | Shows the full ip address of a player. | false |
geoip.hide | Allows player to hide player's country and city from people who have permission geoip.show | false |
config.yml
database:
show-cities: false
download-if-missing: true
# Url for country
lzma-download-url: "https://cdn.jsdelivr.net/gh/wodeBot/geoipdb@lzma/country.mmdb.lzma"
# Url for cities
lzma-download-url-city: "https://cdn.jsdelivr.net/gh/wodeBot/geoipdb@lzma/city.mmdb.lzma"
show-on-login: true
# "enable-locale" enables locale on geolocation display.
enable-locale: true
# Not all languages are supported. See https://dev.maxmind.com/geoip/geoip2/web-services/#Languages
locale: en
example code
import cn.wode490390.nukkit.geoip.GeoIP;
import java.util.UUID;
class Example {
Example() {
UUID uuid = UUID.fromString("ecb32467-6cee-4a59-b3c0-5468fec58ed4");
String geoLocation = GeoIP.query(uuid); //Our API :)
System.out.println("Location: " + geoLocation);
}
}
- Install Maven.
- Fork and clone the repo.
- Run
mvn clean package
. The compiled JAR can be found in thetarget/
directory.
This plugin uses bStats. You can opt out using the global bStats config; see the official website for more details.