Skip to content

Instantly share code, notes, and snippets.

@DoGame5
DoGame5 / AbstractPacket.java
Created May 17, 2025 19:02
An Extension for the UltimateAdvancementAPI using ProtocolLib + PacketWrapper. This enable standard advancement tabs.
public abstract class AbstractPacket {
// The packet we will be modifying
protected PacketContainer handle;
/**
* Constructs a new strongly typed wrapper for the given packet.
*
* @param handle - handle to the raw packet data.
* @param type - the packet type.
*/
@DoGame5
DoGame5 / Main.java
Created May 17, 2025 13:35
An extension for the UltimateAdvancementAPI using ProtocolLib. This listener detects when a player opens the custom advancement tab close_tab:root and immediately closes their inventory. Can be used to create interactive menus or hidden triggers via the advancement screen.
public class Main extends JavaPlugin {
@Override
public void onEnable() {
new TabSwitchListener(this).register();
setupClose();
}
private void setupClose() {
var api = UltimateAdvancementAPI.getInstance(this);