Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant shift click items into Workbench GUI #101

Open
RotzRohr opened this issue Sep 9, 2023 · 0 comments
Open

Cant shift click items into Workbench GUI #101

RotzRohr opened this issue Sep 9, 2023 · 0 comments

Comments

@RotzRohr
Copy link

RotzRohr commented Sep 9, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant