Ticket Plugin

AwesomelyEpic1

New member
Apr 2, 2022
1
0
1
I am working on creating a ticket plugin with different categories. I need to listen for a chat event after a player has clicked on an item in a GUI but cant figure out how to activate that listener inside of the click event. It is a 1.18 server, all I need it to listen for a chat event and be able to store the username, uuid, and chat content after they send a message. I am hoping the listener can be inside the click event so that I don't have to define extra variables.
 

bobooski

New member
Apr 9, 2022
7
0
1
You cannot currently have a listener inside of another listener. You will have to play around with external Maps or Lists that you create to store the UUID and other defining data that can be used to differentiate between what the necessary details are to be used back in the GUI.

I would suggest a Map<UUID, String> with the String value updating after the chat message and then retrieved later when you want via a UUID. Also, if you were unaware you can retrieve a Player object via a UUID which would allow you to get the username in that way.