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

Integrate "@a", "@p" e.t.c in values section of the httpsend command #8

Open
DNAmaster10 opened this issue Jun 16, 2023 · 3 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@DNAmaster10
Copy link
Owner

@A should insert a list of online players into the values section of the httpsend command.

@p should insert the name of the closest player to the sender (e.g a command block) into the value section.

@DNAmaster10 DNAmaster10 added the enhancement New feature or request label Jun 16, 2023
@DNAmaster10 DNAmaster10 self-assigned this Jun 16, 2023
@Dinty1
Copy link

Dinty1 commented Jun 23, 2023

There is slightly more to this. Ideally arguments would also be supported within these selectors, for which there would hopefully be a library already in existence. https://minecraft.fandom.com/wiki/Target_selectors

@DNAmaster10
Copy link
Owner Author

I've started implementing some basic selector features. Currently, @A should be possible for display names, actual names and UUIDs. Will publish and update documentation when completed.

@DNAmaster10
Copy link
Owner Author

DNAmaster10 commented Dec 20, 2023

The general idea for how this will work is users will insert a special selector with parameters into their command. This will look something like this:

/httpsend POST https://10.8.1.1:80 data=Hey!-#-Players:-#-|@a:displayNames|

Upon execution, the plugin will first replace all the space characters, so the data string will look like this:
data=Hey! Players: |@a:displayNames|

Then, anything between the "|" symbols will be replaced with whatever it's asking for. The above will be an @A selector which returns all player display names separated by a comma.

So following the selectors being replaced, it might look like:
data=Hey! Players: jim_bob,notch

It will also be possible to escape the "|" symbols by adding a "\".

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

No branches or pull requests

2 participants