Java: How to make a tablist for Minecraft 1.14?

Ba
- in Servers
5

In version 1.13 it was still working with my code, but now it does not work anymore, even if there are no errors.

package main;

import java.lang.reflect.Field;
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import net.minecraft.server.v1_14_R1.IChatBaseComponent;
import net.minecraft.server.v1_14_R1.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_14_R1.PacketPlayOutPlayerListHeaderFooter;

public class tablist {
public static void headerfootertablist (player player, string header, string footer) {
if (header == null)
header = "";

if (footer == null)
header = "";

IChatBaseComponent tabHeader = ChatSerializer.a ("{\" text \ ": \" "+ header +" \ "}");
IChatBaseComponent tabFooter = ChatSerializer.a ("{\" text \ ": \" "+ footer +" \ "}");

PacketPlayOutPlayerListHeaderFooter tabPacket = new PacketPlayOutPlayerListHeaderFooter ();

try {
Field headerField = tabPacket.getClass (). GetDeclaredField ("a");
headerField.setAccessible (true);
headerField.set (tabPacket, tabHeader);
Field footerField = tabPacket.getClass (). GetDeclaredField ("b");
footerField.setAccessible (true);
footerField.set (tabPacket, tabFooter);
}
catch (Exception e) {
e.printStackTrace ();
}
finally {
((Craft Player) player) .getHandle () playerConnection.sendPacket (tabPacket).
}
}
}

Is anyone up to date on this? What was changed?

Bu

1) Do a more thorough analysis that will tell you more about the actual history of your program code. Use, if possible, debugging tools for it.

2) A changelog can be found https://www.spigotmc.org/...changelog/, the responsible developer you can even write via chat. You can also search for API snapshots https://hub.spigotmc.org/...mmary.html to check your methods and classes.

3) https://dev.bukkit.org/...ab-tablist probably someone has developed a tablist plugin, which should also be functional for 1.14.x. Maybe you can use a decompiler to see how the developer did that.

Ba

How do I decompile? There's nothing useful in the .class

Bu

Find a decompiler for Java.

Ba

Yes i mean how does this work?

Bu

Is there no manual for the decompiler you found? For graphical applications, it is usually no more than selecting File> Open> Jar File. Then the files should be in a Treelist or similar. Be reproduced and you can open them individually to read the code.