Skip to content

Expand the CommandSourceStack interface by exposing mutators #11866

@emilyy-dev

Description

@emilyy-dev

Is your feature request related to a problem?

While brigadier is capable of redirecting or forking a node modifying the command source via (Single)RedirectModifier, it is impossible to make use of this feature using the current command API

Describe the solution you'd like.

Expand the CommandSourceStack interface by adding wither methods:

  • CommandSourceStack withExecutor(Entity executingEntity)
  • CommandSourceStack withLocation(Location location) (atLocation?)
  • For the sake of completion and because Minecraft's CSS also has this method, CommandSourceStack withSender(CommandSender sender), but I'm not really sure how to feel about this, it's one to discuss: do we want to retain the original sender or be able to change it? We can also do both by exposing an additional originalSender method as well, or simply not add such method today but can be revisited in the future

This would allow for plugins to use the forwarding mechanisms of brigadier and better integrate with it without needing to give players permission to run /execute or API users recoursing to use internals

Describe alternatives you've considered.

Using internals or giving players permission to use /execute

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions