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

Access raw commands from executor #422

Closed
DerEchtePilz opened this issue Mar 12, 2023 · 1 comment
Closed

Access raw commands from executor #422

DerEchtePilz opened this issue Mar 12, 2023 · 1 comment
Labels
enhancement New feature or request implemented for next release This has been implemented in the current dev build for the next public release

Comments

@DerEchtePilz
Copy link
Collaborator

Description

Currently, when adding an executor to a command, you cannot retrieve the raw command string.
For most argument combinations it is pretty easy to convert an Object into a String (for example: turning a Player into a String using Player#getName() or turning any primitve types into strings)

However, this gets pretty difficult when using the EntitySelectorArgument which lets you input selectors (@a, @e, etc.) which can produce the exact same result.

Thus it would be useful if the CommandAPI implemented a way to retrieve the raw command string in the executor.

Expected code

In order to implement this, the CommandAPI could add a new method to the CommandArguments class like this:

public String getFullInput() {
    // Return whatever the user entered as a command
}

Extra details

For anyone wanting to implement this, the CommandArguments class is filled with information in the CommandAPIHandler. In there, there is a method called argsToCommandArgs which populates that with content.

@DerEchtePilz DerEchtePilz added enhancement New feature or request implemented for next release This has been implemented in the current dev build for the next public release labels Mar 12, 2023
@JorelAli
Copy link
Owner

Implemented in 9.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request implemented for next release This has been implemented in the current dev build for the next public release
Projects
Archived in project
Development

No branches or pull requests

2 participants