KSpigot icon indicating copy to clipboard operation
KSpigot copied to clipboard

Using GUIPageBuilder#changeGUI button makes the target gui unresponsive

Open xNoobyyy opened this issue 2 months ago • 0 comments

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.

xNoobyyy avatar May 01 '24 18:05 xNoobyyy