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

Player command should accept a target selector #768

Open
Username-Cant-Be-Blank opened this issue Mar 17, 2021 · 3 comments
Open

Player command should accept a target selector #768

Username-Cant-Be-Blank opened this issue Mar 17, 2021 · 3 comments
Labels
feature suggestion New feature or request

Comments

@Username-Cant-Be-Blank
Copy link

Carpet Version 1.4.29
Fabric Version 0.32.0+1.16
Minecraft Version 1.16.5
Description: The player command won't accept a Minecraft target selector
Steps to reproduce: run /player @p attack once. you will get the error Expected whitespace to end one argument, but found trailing data

@altrisi
Copy link
Collaborator

altrisi commented Mar 19, 2021

Problem is, target selector built-in argument (for autocomplete and things, which is probably what matters) doesn't allow using that argument for non-existent players (therefore breaking player [name] spawn command, which is an important one).

Target selectors could probably be added artificially, but as said, it would probably break autocomplete for those selectors.

If you really need to use the @p/@anything commands, you could use Scarpet's entity_selector('@anything') as a replacement, though if it's for just running the command once/in chat, it would make it a bit verbose
(/script run run('player '+entity_selector('@p')+' attack once'), or something similar ).

You could probably put it in an app to make a custom command accepting selectors, though.

@gnembon
Copy link
Owner

gnembon commented Apr 4, 2021

Yeah, the reason is that fake players are not players, and you would always require just one to be provided. And also not in all circumstances @p is valid. I get ya, having ability to target @p could be useful

@gnembon gnembon added the feature suggestion New feature or request label Apr 4, 2021
@gnembon gnembon changed the title Player command won't accept a target selector Player command should accept a target selector Apr 4, 2021
@vlad2305m
Copy link
Contributor

There was a vanilla command that errored "more than one target provided", so there is no reason to deprive people of, for example, command books interacting with the closest bot. You can limit it to just @s, and we would use it through execute as.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature suggestion New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants