8000 Access raw commands from executor · Issue #422 · CommandAPI/CommandAPI · GitHub
[go: up one dir, main page]

Skip to content < 8000 /span>
Access raw commands from executor #422
Closed
@DerEchtePilz

Description

@DerEchtePilz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestimplemented for next releaseThis has been implemented in the current dev build for the next public release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0