0

I'm making a simple mojang-api-based on powershell and I'm trying to know if there is any native way to ping/get status of aminecraft minecraft server. Until now I found that: [System.Net.Dns]::GetHostAddresses("mc.hypixel.net")[0].IPAddressToString can resolve an adress to 209.222.115.37, When I try to ping it with a simple ping 209.222.115.37 or ping mc.hypixel.net cannot connect to the server. So I tried with telnet 209.222.115.37 25565 or telnet mc.hypixel.net 25565 than It waits a little bit and than losts connection. I'm thinking if It's just some minecraft server(but I don't think so, because when I do it on my own server with localhost, same error with telnet, but works with ping)... Can someone tell me if there is any other way to do it by ping it(maybe sending special packets to make the server responde?)

PS: I found this reddit that explains very good how does connection to a minecraft server work.

2
  • What are you trying to do? Are you trying to write some PowerShell script for personal use? Or an actual API, that might be useful to other as well? Because I don't think you would want to write an API in PowerShell.
    – Bassie-c
    Commented Jan 18, 2019 at 0:34
  • Just personal use.
    – DadiBit
    Commented Jan 18, 2019 at 11:06

1 Answer 1

2

I found a workaround at the moment by using this googling: https://api.mcsrvstat.us/1/mc.hypixel.net and then ConvertFrom-JSON -InputObject ($(Invoke-webrequest -URI "https://api.mcsrvstat.us/1/mc.hypixel.net").Content), but I would like still to use something more easy.

1
  • This relies on a third party though
    – creulcat
    Commented Sep 16, 2020 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.