You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a bit unsure of how to make calls to the JSON Api on my server using Javascript. I want to make more information available on my server's website and take it from the server itself without having to use external services. If this information is documented in the Wiki forgive me for my ignorance but I can't seem to find any at the moment. From what I can gather, process for making a call to a Minecraft server seems to be as so:
Install the JSONAPI Plugin to your server (along with the other dependencies as needed)
Look into configuration files and save the username and password in the users.yml file for later use
If you want to use a salt, include a salt in the config.yml file
Look into the Javascript SDK from tools and load it as one of the scripts for the index.html
In my own script.js file, insert this: var j = new jsonapi({ hostname: "serverIP/domainName", port: 20059, username: "usernameFromUsers.yml", password: "passwordFromUsers.yml", salt: "saltFromConfig.yml" });
And then make calls, like so: j.call('getPlayers', console.log);
However, I seem to get errors with my server and nothing is returned from my get requests. Could I get some help with this?
The text was updated successfully, but these errors were encountered:
Hey Mates,
I'm a bit unsure of how to make calls to the JSON Api on my server using Javascript. I want to make more information available on my server's website and take it from the server itself without having to use external services. If this information is documented in the Wiki forgive me for my ignorance but I can't seem to find any at the moment. From what I can gather, process for making a call to a Minecraft server seems to be as so:
var j = new jsonapi({ hostname: "serverIP/domainName", port: 20059, username: "usernameFromUsers.yml", password: "passwordFromUsers.yml", salt: "saltFromConfig.yml" });
j.call('getPlayers', console.log);
However, I seem to get errors with my server and nothing is returned from my get requests. Could I get some help with this?
The text was updated successfully, but these errors were encountered: