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

Support new execute command #450

Closed
Joelant05 opened this issue May 25, 2022 · 10 comments
Closed

Support new execute command #450

Joelant05 opened this issue May 25, 2022 · 10 comments
Assignees
Labels
data Something that requires work inside of the editor-packages repo feature Request of a new feature
Milestone

Comments

@Joelant05
Copy link
Member

Available as of 1.19.10.20

@Joelant05 Joelant05 added the data Something that requires work inside of the editor-packages repo label May 25, 2022
@Joelant05 Joelant05 added this to the v2.2.X milestone May 25, 2022
@Joelant05 Joelant05 self-assigned this May 25, 2022
@Joelant05 Joelant05 added the feature Request of a new feature label May 27, 2022
@Joelant05
Copy link
Member Author

In order to support this, we need some way of supporting recursive command arguments, e.g. chain of as, at, unless and run in execute as @a at @s unless block ~ ~1 ~ air 0 run say there is a block above my head
Is this something you could look into when you get the time @solvedDev? I'll let you know if I think of a nice way of supporting this

@solvedDev
Copy link
Member

I've been thinking about how to implement the new /execute as well. Maybe we can add the subcommands as normal commands and then have a new "requiredCommandPrefix" property?

@Joelant05
Copy link
Member Author

How exactly would this work? I understand we could introduce as, at etc as individual commands with "requiredCommandPrefix": "execute" but what about when it comes to nesting these. We won't know what the prefix will be as it could be a selector for example, so how could we use "requiredCommandPrefix" then? Unless I have understood this wrong

@solvedDev
Copy link
Member

solvedDev commented May 27, 2022

“requireCommandPrefix” would look at the last command that was used, not the last argument the user typed.
Maybe something like this would work better:

{
  “requires”: {
    “commandBefore”: “execute”
  }
}

@Joelant05
Copy link
Member Author

Joelant05 commented May 27, 2022

oh I see, but how would this let us choose when to begin the chain within the command?
e.g. execute positioned as @p ... how would it know when to propose the chain after @p specifically

@solvedDev
Copy link
Member

An alternative would be to add a dedicate system for subcommands...

{
  "commands": [
    {
      "commandName": "execute",
      "arguments": [
	{
	  "type": "subcommand",
          "allowMultiple": true
	}, 
        {
          "additionalData": {
	    "values": ["run"]
	  }
        },
        {
          "argumentName": "command",
          "type": "command"
        }
      ]
    }
  ],
  "subcommands": [
    {
      "commandName": "execute",
      "commands": [{...}]
    }
  ]
}

@solvedDev
Copy link
Member

oh I see, but how would this let us choose when to begin the chain within the command? e.g. execute positioned as @p ... how would it know when to propose the chain after @p specifically

I think this won't be a big problem but I believe my latest proposal probably still makes more sense

@Joelant05
Copy link
Member Author

Joelant05 commented May 28, 2022

An alternative would be to add a dedicate system for subcommands...

I like this format 👍

@solvedDev solvedDev modified the milestones: v2.2.X, v2.3.0 Jun 24, 2022
@solvedDev solvedDev self-assigned this Aug 3, 2022
solvedDev added a commit that referenced this issue Aug 3, 2022
solvedDev added a commit to bridge-core/editor-packages that referenced this issue Aug 3, 2022
solvedDev added a commit that referenced this issue Aug 3, 2022
@Joelant05
Copy link
Member Author

bridge-core/editor-packages@1728c36

@solvedDev
Copy link
Member

6e372b0

solvedDev added a commit that referenced this issue Aug 15, 2022
solvedDev added a commit that referenced this issue Aug 15, 2022
solvedDev added a commit that referenced this issue Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data Something that requires work inside of the editor-packages repo feature Request of a new feature
Projects
Status: 🚀 Done
Development

No branches or pull requests

2 participants