lumien231 / Custom-Main-Menu

A mod that allows you to modify the minecraft main menu
MIT License
67 stars 36 forks source link

Playercount using refresh #361

Open Kevin1Smid opened 5 years ago

Kevin1Smid commented 5 years ago

"playerscount": { "text": { "type": "web", "url": "http://api.serveurs-minecraft.com/api.php?Joueurs_En_Ligne_Ping&ip=xxxxxxxx.com&port=12345", "refreshInterval": 60 }, "posX": 85, "posY": -38, "width": 98, "height": 20, "alignment": "center" },

When I use this (with proper ip and port it doesnt work) it gives the following error:

[02:59:31] [Client thread/ERROR]: Error getting random value out of {"type":"web","url":"http://api.serveurs-minecraft.com/api.php?Joueurs_En_Ligne_Ping&ip=xxxxxxxx.com&port=12345","refreshInterval":60}

Using the normal webtext works but I would like for it to refresh as that would make it a better player counter. This does work: "playerscount": { "text": "web:http://api.serveurs-minecraft.com/api.php?Joueurs_En_Ligne_Ping&ip=xxxxxx.com&port=12345", "posX": 85, "posY": -38, "width": 98, "height": 20, "alignment": "center" },

kebabmamedov commented 5 years ago

I don't know why your label doesn't work. Here's my code and it does work: "playerscount": { "text": { "type": "web", "url": "http://api.serveurs-minecraft.com/api.php?Joueurs_En_Ligne_Ping&ip=mc.hypixel.net&port=25565", "refreshInterval": 60 }, "posX": 105, "posY": -38, "width": 98, "height": 20, "alignment": "center" }

I guess you insert bad IP or port (btw 70%of MC ports are 25565)