Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/astei/mcping-elixir
A simple library to ping Minecraft: Java Edition servers using Elixir.
https://github.com/astei/mcping-elixir
elixir minecraft server-list
Last synced: 6 days ago
JSON representation
A simple library to ping Minecraft: Java Edition servers using Elixir.
- Host: GitHub
- URL: https://github.com/astei/mcping-elixir
- Owner: astei
- License: mit
- Created: 2018-07-18T20:19:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-11T20:42:22.000Z (3 months ago)
- Last Synced: 2024-10-11T22:20:02.176Z (about 1 month ago)
- Topics: elixir, minecraft, server-list
- Language: Elixir
- Size: 25.4 KB
- Stars: 2
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MCPing
This is a simple library that you can use to ping _Minecraft: Java Edition_ servers
using Elixir. It's built primarily on Erlang's `gen_tcp` support, and the response
JSON is deserialized automatically with [Jason](https://github.com/michalmuskala/jason).## How to Use It
It's pretty easy. Here's how you might use it:
```elixir
{:ok, response} = MCPing.get_info("mc.hypixel.net")
````get_info` takes three parameters, of which only the `address` is required.
The return value is a tuple:* `{:ok, status}` - we were able to contact the server successfully.
* `{:error, reason}` - we were unable to contact the server (the `reason` is usually from
the underlying `gen_tcp` client).The docs can be found at [https://hexdocs.pm/mcping](https://hexdocs.pm/mcping).
## Installation
This package can be installed by adding `mcping` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:mcping, "~> 0.2.0"}
]
end
```