Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Based on a pen done on codepen by @robinselmer
- //Change there the server IP. Set the IP and the port here.
- //E.g.:
- //note: use: var url = "https://api.minetools.eu/ping/<server ip>/<server port>";
- //E.g.:
- //var url = "https://api.minetools.eu/ping/104.13.120.110/25565";
- function servername() {
- document.title = prompt('Modify the title', document.title);
- }
- var url = "https://api.minetools.eu/ping/104.13.120.110/25565";
- //https://mcapi.us/server/status?ip=104.13.120.110&port=25565
- $.getJSON(url, function(r) {
- //data is the JSON string
- if(r.error){
- $('#rest').html('0');
- return false;
- }
- var pl = '';
- if(r.players.sample.length > 0 ) { pl = r.players.sample[players].name}
- $('#rest').html(r.players.online+pl);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement