MCNewsTools / PHP-Minecraft-Query-API

Query Minecraft Server Status API
29 stars 6 forks source link

Motd extra? #3

Closed Pomdre closed 6 years ago

Pomdre commented 6 years ago

Why is this extra stuff coming? image

http://mc-status-api.gearhostpreview.com/json.php?host=90.149.222.18&port=25565

Raw json: { "status": "Online", "motd": { "ingame": { "extra": [ { "color": "yellow", "bold": true, "text": "Dag" }, { "color": "yellow", "bold": true, "text": " " }, { "color": "green", "bold": true, "text": "& " }, { "color": "blue", "bold": true, "text": "Natt" }, { "color": "white", "text": " En offisiell server for " }, { "color": "dark_green", "text": "Level Up Community" }, { "color": "white", "text": "." } ], "text": "" }, "clean": { "extra": [ { "color": "yellow", "bold": true, "text": "Dag" }, { "color": "yellow", "bold": true, "text": " " }, { "color": "green", "bold": true, "text": "& " }, { "color": "blue", "bold": true, "text": "Natt" }, { "color": "white", "text": " En offisiell server for " }, { "color": "dark_green", "text": "Level Up Community" }, { "color": "white", "text": "." } ], "text": "" }, "html": { "extra": [ { "color": "yellow", "bold": true, "text": "Dag" }, { "color": "yellow", "bold": true, "text": " " }, { "color": "green", "bold": true, "text": "& " }, { "color": "blue", "bold": true, "text": "Natt" }, { "color": "white", "text": " En offisiell server for " }, { "color": "dark_green", "text": "Level Up Community" }, { "color": "white", "text": "." } ], "text": "" } }, "host": { "host": "90.149.222.18", "port": "25565" }, "players": { "max": 250, "online": 3 }, "version": { "version": "1.8.x-1.13.x", "protocol": 393 }, "queryinfo": { "agreement": "Ping", "processed": "0.5063" } }

GoneTone commented 6 years ago

The MOTD returned by the server is the json format.

Pomdre commented 6 years ago

But how can I get it and look like this? image

GoneTone commented 6 years ago

Use plugin

Pomdre commented 6 years ago

Then I can not use that in my program

GoneTone commented 6 years ago

What do you mean?

Pomdre commented 6 years ago

I am createing a server list website

Pomdre commented 6 years ago

and I need clean motd without extra

GoneTone commented 6 years ago

Those MOTDs are returned by the server. If it is in json format, you may have to write your own judgment and then connect the strings together.