User Tools

Site Tools


tutorial:commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorial:commands [2019/08/13 15:02] – Add line numbers to code, clarify issue with redirects. Add another Command example i509vcbtutorial:commands [2019/08/22 03:55] – [A very basic command] Change ArgumentBuilders to CommandManager i509vcb
Line 35: Line 35:
 <code java [enable_line_numbers="true"]> <code java [enable_line_numbers="true"]>
 // The root of the command. This must be a literal argument. // The root of the command. This must be a literal argument.
-dispatcher.register(LiteralArgumentBuilder.literal("foo"+dispatcher.register(CommandManager.literal("foo"
 // Then add an argument named bar that is an integer // Then add an argument named bar that is an integer
-    .then(RequiredArgumentBuilder.argument("bar", integer())+    .then(CommandManager.argument("bar", integer())
  // The command to be executed if the command "foo" is entered with the argument "bar"  // The command to be executed if the command "foo" is entered with the argument "bar"
         .executes(ctx -> {          .executes(ctx -> { 
tutorial/commands.txt · Last modified: 2024/02/23 14:22 by allen1210