New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use mc.ping() #774
Comments
It seems to be correct, but this code does not work const mc = require('minecraft-protocol')
const options = {
host: process.argv[2],
port: parseInt(process.argv[3]),
version: "1.12.2"
}
console.log(mc.ping(options,function(){console.log("done!")})) |
Try using: const mc = require('minecraft-protocol')
const options = {
host: process.argv[2],
port: parseInt(process.argv[3]),
version: "1.12.2"
}
console.log(mc.ping(options, function(err) {
if (err) console.log(err)
else console.log("done!")
})) See if any errors are printed to the console. |
This outputs first undefined then done! |
This is working for me. mc.ping({ host: localhost, port: port }, (err, data) => {
if (err) {
console.log(err)
return
}
console.log(data)
}) |
ghost
closed this as completed
Nov 6, 2020
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can show part of the code using mc.ping()?
The text was updated successfully, but these errors were encountered: