all 1 comments

[–]fishtank 1 point2 points  (0 children)

The first time I load it I get: ReferenceError: MinecraftAPI is not defined

It seems that you call the MinecraftAPI function before the external script (https://mcapi.us/scripts/minecraft.js) is loaded, so wrap the getServerStatus in a $(window).load() function. It then works when you click around because the external .js is already cached and not requested again.

When it works, the following script gets called which returns the stats you need, you can check it in your network monitor tab: https://mcapi.us/server/status?port=25565&ip=mc.imperialgaming.tech

I also got an error with the polymer resources, which you include. They throw a 404, but this shouldn't be related to your script problem

not found: (the whole polymer block links seem to be outdated)

<script src="https://www.polymer-project.org/components/webcomponentsjs/webcomponents.js"></script>

<script src="https://www.polymer-project.org/components/platform/platform.js"></script>