triumph-gui icon indicating copy to clipboard operation
triumph-gui copied to clipboard

Cant shift click items into Workbench GUI

Open RotzRohr opened this issue 1 year ago • 0 comments

Cant shift click items into Workbench GUI Version 1.19.4 Paper

public final class Test extends JavaPlugin implements Listener
{
    Listener playerClick;
    @EventHandler
    public void onJoin(org.bukkit.event.player.PlayerJoinEvent event)
    {
        event.getPlayer().sendMessage("Welcome to the server!");
        //after 3sec send message "Hello"
        getServer().getScheduler().scheduleSyncDelayedTask(this, () -> CraftingTable.open(event.getPlayer()), 60L);
    }

    @Override
    public void onEnable() {
        // Plugin startup logic
        getServer().getPluginManager().registerEvents(this, this);


    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}

public class CraftingTable {
    private static Gui gui = Gui.gui()
            .title(Component.text("Custom Workbench!"))
            .type(GuiType.WORKBENCH).enableAllInteractions()
            .create();
    public static void open(Player player)
    {
        gui.setDefaultClickAction(event -> {
            System.out.println("Clicked in GUI! setDefaultClickAction");
        });
        gui.setCloseGuiAction(event -> {
            System.out.println("Closed GUI! setCloseGuiAction");
        });
        gui.setDefaultTopClickAction(event -> {
            System.out.println("Clicked in GUI! setDefaultTopClickAction");
        });
        gui.setDragAction(event -> {
            System.out.println("Dragged in GUI! setDragAction");
        });
        gui.setOutsideClickAction(event -> {
            System.out.println("Clicked outside GUI! setOutsideClickAction");
        });
        gui.setPlayerInventoryAction(event -> {
            System.out.println("Clicked in GUI! setPlayerInventoryAction");
        });
        gui.setOpenGuiAction(event -> {
            System.out.println("Opened GUI! setOpenGuiAction");
        });

        gui.open(player);
    }
}

Proof Video YouTube

RotzRohr avatar Sep 09 '23 01:09 RotzRohr