ModsJava
Protocol
Minecraft Java mod. Downloads from the MC Java Mods app on Android.
⬇ Download on SpigotProtocol gives you more control over how you reply to client ping requests.
NOTE: This is an API as well! Use it to your advantage
What can it do?
- Modify the online player count and the max players
- Change the player sample (list of players shown when hovering over the player count)
- Fake the protocol name and version to display text instead of the player count
- Create server list 'animations'
- Hide the player count
Tutorials: For each mutator featured in these tutorials there is a corresponding accessor method.
Spoiler: Changing the player sample (hover message)
Documentation
PingEvent: Stores the PingReply and defines whether the event is cancelled or not.
Whitelist: false
Message: "&c&lPlease use 1.7!"
Protocols:
- 47
// 4 = 1.7.1 - 1.7.5
// 5 = 1.7.6 - 1.7.10
// 47 = 1.8
[/spoiler]
NOTE: This is an API as well! Use it to your advantage
What can it do?
- Modify the online player count and the max players
- Change the player sample (list of players shown when hovering over the player count)
- Fake the protocol name and version to display text instead of the player count
- Create server list 'animations'
- Hide the player count
Tutorials: For each mutator featured in these tutorials there is a corresponding accessor method.
Spoiler: Creating a basic listener
To use Protocol to it's full potential you have to create a Listener. This is done similar to registering a Bukkit listener. Before we actually register it we need to create it. You can either create a new class that implements 'PingListener,' or just an anonymous inner class which is my method of choice. Here is a simple example of a PingListener
public class TestListener implements PingListener {
public void onPing(PingEvent event) {
event.getReply().setMOTD("This is an MOTD");
}
}
Now that we have created the PingListener we need to actually register it. You can do so by invoking the static method 'Protocol.registerListener(PingListener).' Here is an example using an anonymous inner class.
public class MyPlugin extends JavaPlugin {
public void onEnable() {
Protocol.registerListener(new PingListener() {
public void onPing(PingEvent event) {
event.getReply().setMOTD("This is an MOTD");
}
}
}
}
Code (Text):
public class TestListener implements PingListener {
public void onPing(PingEvent event) {
event.getReply().setMOTD("This is an MOTD");
}
}
Code (Text):
public class MyPlugin extends JavaPlugin {
public void onEnable() {
Protocol.registerListener(new PingListener() {
public void onPing(PingEvent event) {
event.getReply().setMOTD("This is an MOTD");
}
}
}
}
Spoiler: Changing the player count
Spoiler: Changing the player count to text
Bukkit does not support changing the online player count with the ServerListPingEvent due to obvious reasons, but Protocol does. You can easily do this by invoking PingReply#setOnlinePlayers(int). Here is an example:
public class TestListener implements PingListener {
public void onPing(PingEvent event) {
event.getReply().setOnlinePlayers(5000);
}
}
Code (Text):
public class TestListener implements PingListener {
public void onPing(PingEvent event) {
event.getReply().setOnlinePlayers(5000);
}
}
Spoiler: Changing the player sample (hover message)
Documentation
PingEvent: Stores the PingReply and defines whether the event is cancelled or not.
- getReply() - PingReply
- createNewPacket(PingReply) - ServerInfoPacket
- isCancelled() - boolean
- setCancelled(boolean) - void
- getOnlinePlayers() - int
- getMaxPlayers() - int
- getMOTD() - String
- getProtocolVersion() - int
- getProtocolName() - String
- getPlayerSample() - GameProfile[]
- arePlayersHidden() - boolean
- setOnlinePlayers(int) - void
- setMaxPlayers(int) - void
- setMOTD(String) - void
- setProtocolVersion(int) - void
- setProtocolName(String) - void
- setPlayerSample(GameProfile[]) - void
- hidePlayers(boolean) - void
- send() - void
- setPingReply() - void
- getPingReply() - PingReply
Code (Text):
Whitelist: false
Message: "&c&lPlease use 1.7!"
Protocols:
- 47
// 4 = 1.7.1 - 1.7.5
// 5 = 1.7.6 - 1.7.10
// 47 = 1.8
Quick facts
- Edition: Minecraft Java
- File type: .jar
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
Protocol is a free Minecraft Java mod. Downloaded 456 times (via Spigot). Download it and open it directly in the game.