-
Notifications
You must be signed in to change notification settings - Fork 5
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
[Request] getPlayerInput function #213
Comments
@lrmtheboss Technically would be possible but there isn't a way to open the player's chat afaik. I would probably prefer implementing anvil or sign guis but I would need a way to do this cross platform in the future which shouldn't be too hard if I just maintain libraries per version and platform. |
For the bukkit implementation I was thinking could use the chat event and watch for messages from that player that way, once you got a message from them you would also want to cancel that event so no other plugins pick up on it and it does not get sent in chat. You could just register the event when you needed to get input and unregister it once you have gotten some input or the set time has run out. An Anvil GUI for input would be much better than relying on the chat event as I mentioned above |
Yea I'm probably just going to implement anvil guis. Should be done in 5.0.0 which will make api breaking changes but gui files will still stay the same. |
@virustotalop great, can't wait for 5.0.0 release |
Add a function to have the player give input by typing it into the chat box when requested and then set a slot metaData value when input is gotten, for use in later functions
GUI function example
For input validation could do int(<10), int(>5), int(5<10), String(maybe regex check) or use condition function for validation
The 'getPlayerInput' function when called should send a message to the player to let the player know that they need to give input and a description of what type of input is required (description of input required). Then it should close the GUI and wait for input for a set amount of time. If no input is gotten within the set amount of time it should send an error message to the player that no input was given (maybe reopen the previous
GUI)
and cancel the execution of the remaining functions in that slotThe text was updated successfully, but these errors were encountered: