Sueta

MOTD Ping API

1.0.0

Edit Everything from the MOTD | [1.8.x - 1.12.2]

·Plugin

How to use this API

add to your OnEnable()

@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.

@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

@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

Similar projects

Plugin →