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

Using GUIPageBuilder#changeGUI button makes the target gui unresponsive #64

Open
xNoobyyy opened this issue May 1, 2024 · 0 comments
Open

Comments

@xNoobyyy
Copy link

xNoobyyy commented May 1, 2024

Version: 1.20.3 (Minecraft 1.20.4)
Software: PaperMC #496
Errors / Stacktraces: None

Problem Description:
I want to implement functionality to switch between different independent GUIs using changeGUI(). For me this helps maintain GUI independence without merging them all into a single gui and using pages. However, there currently is an issue where the GUI targeted by changeGUI() becomes unresponsive.

Steps to reproduce:

  1. Open the initial GUI (GUI A) using the Player#openGui() extension function
  2. Use a changeGUI() button to switch to another GUI (GUI B).
  3. Attempt to interact with any clickable elements within GUI B.

Expected Behavior:
Clickable elements in GUI B should function normally and trigger corresponding event listeners or actions, as they do when accessed directly from their own GUI context.

Actual Behavior:
After using changeGUI() to switch to GUI B, none of the elements within GUI B respond to clicks or other interactions. All the items are in the right places, but it appears as though the event listeners are not active or are not recognizing interactions.

Additional Information:

  • The changeGUI() button is the only function that doesn't work for me. Other buttons that change around items like changePage(), nextPage(), or previousPage() work without any problems, so this has probably to do with how the gui gets registered when opening?
  • Using Player#openGui() inside a action of a normal button works but resets the mouse cursor to the center, as it closes the current inventory before opening the new GUI, so this isn't really a good solution for me.
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