Is there a way to get the message the user sends in the global chat right after he/she runs a command?
For example:
1. User runs command /hello 2. Command responds: What is your name? 3. The user presses ‘t’ and types their name. 4. The plugin responds, "Hello (username)"
I would prefer if this could be done in the command executor and without the use of events.
You’d probably have to write a MutableMessageChannel and add the player as a member from your command executor. When the player types their message to input their username, the transformMessage() method will be called, so do all your player messaging stuff in there. Make sure that you return Optional.empty() so that the message doesn’t actually go into chat. After you’re done doing stuff with the player and whatever username they inputted, remember to remove them from the members set.