Home›Java›Mods›MOTD Ping API
MOTD Ping API
ModsJava

MOTD Ping API

Java mod listed for Minecraft 1.8–1.12. Downloads from the MC Java Mods app on Android.

⬇ Download on Spigot
How to use this API

add to your OnEnable()

Code (Text):
@Override
public void onEnable() {
    MOTDAPI.registerListener(this);
}
Implement all the Plugin Wants, from com.designlyi.motdapi

now you should have a new Method in your Main class wich Looks like this one.

Code (Text):
@Override
public void onPing(PingEvent e) {
}
Now you can add this example to look if Everithing is working.
I Hope my API did Help you.
Maybe Leave a Rating <3

Code (Text):
@Override
public void onPing(PingEvent e) {
    PingReply reply = e.getReply();
    reply.setMaxPlayers(new Random().nextInt(999));
    reply.setOnlinePlayers(new Random().nextInt(999));
    reply.setMOTD("Line 1" + "\n" + "Line 2);
    List<String> sample = new LinkedList<String>();
    sample.add("§4MaintenanceMode!");
    reply.setPlayerSample(sample);
    reply.setProtocolName("§4Maintenance!");
    reply.setProtocolVersion(2);
}
If you Liked this API maybe you want to support me :)

paypal-button.png
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

MOTD Ping API is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9, 1.10, 1.11 and newer. Downloaded 320 times (via Spigot). Download it and open it directly in the game.

Explore more