About MCPing
MCPing is an MCP server published by Lenni0451 in the Gaming category: simple library to ping minecraft servers.
The repository has 14 stars and 1 forks, with the last commit 8 days ago. Recent commit activity is the strongest signal that reported issues will get attention.
Install
git clone https://github.com/Lenni0451/MCPingThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about MCPing
Powered by Claude · Grounded in docs
Security checks
Static checks derived from the repository yesterday. Heuristics on the source, not an audit.
- ✓README presentThe repository ships documentation.
- ✓License declaredUsable under a stated license.
- ✓Tests presentA test suite exists in the repository.
- !Dependencies pinnedNo lockfile. Installs can pull different code over time.
- ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
1 check has not been run yet.
Releases
README
MCPing
A simple library to ping minecraft servers
Releases
Gradle/Maven
To use MCPing with Gradle/Maven you can follow the instructions on maven central.
Gradle:
repositories {
mavenCentral()
}
dependencies {
implementation "net.lenni0451:MCPing:1.0.0"
}
Maven:
<dependency>
<groupId>net.lenni0451</groupId>
<artifactId>MCPing</artifactId>
<version>1.0.0</version>
</dependency>
Make sure to use the latest version from maven central.
Jar File
You can download the compiled jar file from my Jenkins server.
Gson is required and not included in the jar file.
Usage
Implemented ping protocols:
- Modern (>= 1.7)
- Legacy (<= 1.6)
- Classic
- Bedrock Raknet
- Bedrock Nethernet
- Query (default/full)
- Socket
The only class you need to ping a server is the MCPing class.
The class has a builder pattern to easily create a ping request.
After creating the request you can use the getSync(), getAsync() or getAsync(ExecutorService) methods to get the ping result.
To set listener for the ping result you can use the handler(IStatusListener) method to listen for all ping states.
To set listener for each specific ping state you can use the following methods:
exceptionHandler(Consumer<Throwable>)responseHandler(Consumer<? extends IPingResponse>)finishHandler(Consumer<? extends IPingResponse>)
Example:
Get the ping result of a modern server synchronously.
No handler is set so exceptions will be thrown.
MCPing.pingModern(761).address("lenni0451.net").getSync();
Ping a legacy server using the 1.5 protocol.
The ping result is printed to the console and the future is joined.
MCPing.pingLegacy(LegacyPing.Version.V1_5).responseHandler(response -> {
System.out.println(response);
}).address("lenni0451.net").getAsync().join();
Ping a modern server and correctly handle all status responses.
MCPing
.pingModern()
.address("lenni0451.net")
.noResolve()
.exceptionHandler(t -> {
//TODO: Show error message if no response was received yet
//It is recommended to not cancel the entire ping process if a response was already received
//See the javadoc of IStatusListener for more information
})
.responseHandler(response -> {
//TODO: Show response like online players, max players, motd, ...
})
.finishHandler(response -> {
//TODO: Also show ping time
})
.getAsync();
README fetched from the repository yesterday. The original is authoritative.