You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -86,8 +86,6 @@ public class GreetCommand {
86
86
```
87
87
The `CommandBuilder` is what you use create commands.
88
88
89
-
The constructor argument tells CommandCore that only `Player`s may execute this command and won't let other senders execute it (command blocks, the console, etc.).
90
-
91
89
On the 5th line, we use a `.executes` call. This tells CommandCore to execute whatever is in the lambda when we run the command with no arguments.
92
90
93
91
On the next line, we make a `.then` call. It adds another 'branch' to the command 'tree'. You can think of the entire command as a tree, with the `CommandBuilder` as the main trunk. Any extra `.then` calls creates another branch, or path, that the user can go down.
@@ -98,7 +96,8 @@ Notice how the literal `CommandNode` doesn't have an `.executes` call. This tell
98
96
99
97
On the next line, we create a new branch under the literal. This time, it is an argument. An argument is any string that the argument type can understand. In this case, we give it an argument type of `PLAYER`. This means that CommandCore will suggest us player names.
100
98
101
-
After that, we have a `.executes` call. This gets executed when we have typed that entire branch out. (ex. `/... player DatAsiqn`).
99
+
After that, we have a `.requiresPlayer` call. This tells CommandCore that the current node (the PLAYER argument) requires a player to use it. If, for example, the console sends it, CommandCore will not execute the command and instead give the user an error.
100
+
Finally, we have a `.executes` call. This gets executed when we have typed that entire branch out. (ex. `/... player DatAsiqn`).
102
101
103
102
The next line is adding another literal onto the main trunk (notice the indentation). This literal is less complicated than the last, and just makes the sender chat "Hello Server!".
104
103
@@ -128,4 +127,4 @@ You can contribute to this project by
128
127
*[Forking](https://github.com/DatAsianBoi123/CommandCore/fork) this repo
129
128
* Creating a [pull request](https://github.com/DatAsianBoi123/CommandCore/compare)
130
129
---
131
-
Have any questions? Ask me on [discord](https://discord.com)! My tag is `DatAsianBoi1234#7767`
130
+
Have any questions? Ask me on [discord](https://discord.com)! My tag is `datasianboi123`
0 commit comments