User Tools

Site Tools


tutorial:command_exceptions

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:command_exceptions [2022/09/18 13:37] nexus-dinotutorial:command_exceptions [2022/09/18 13:38] nexus-dino
Line 20: Line 20:
         throw new SimpleCommandExceptionType(new TranslatableText("coin.flip.tails")).create(); // Oh no tails, you lose.         throw new SimpleCommandExceptionType(new TranslatableText("coin.flip.tails")).create(); // Oh no tails, you lose.
     }));     }));
 +</code>
 +
 +<code java [enable_line_numbers="true"]>
 +DynamicCommandExceptionType used_name = new DynamicCommandExceptionType(name -> {
 +    return new LiteralText("The name: " + (String) name + " has been used");
 +});
 </code> </code>
  
tutorial/command_exceptions.txt · Last modified: 2024/04/15 06:43 by solidblock