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
tutorial:command_exceptions [2024/04/15 06:35] solidblocktutorial:command_exceptions [2024/04/15 06:43] (current) solidblock
Line 18: Line 18:
   
         if(random.nextBoolean()) { // If heads succeed.         if(random.nextBoolean()) { // If heads succeed.
-            ctx.getSource().sendFeedback(Text.translatable("coin.flip.heads"), true);+            ctx.getSource().sendFeedback(() -> Text.translatable("coin.flip.heads"), true);
             return Command.SINGLE_SUCCESS;             return Command.SINGLE_SUCCESS;
         }         }
Line 41: Line 41:
  
           if (random.nextBoolean()) { // If heads succeed.           if (random.nextBoolean()) { // If heads succeed.
-            ctx.getSource().sendFeedback(Text.translatable("coin.flip.heads"), true);+            ctx.getSource().sendFeedback(() -> Text.translatable("coin.flip.heads"), true);
             return Command.SINGLE_SUCCESS;             return Command.SINGLE_SUCCESS;
           }           }
Line 63: Line 63:
  
           if (random.nextBoolean()) { // If heads succeed.           if (random.nextBoolean()) { // If heads succeed.
-            ctx.getSource().sendFeedback(Text.translatable("coin.flip.heads"), true);+            ctx.getSource().sendFeedback(() -> Text.translatable("coin.flip.heads"), true);
             return Command.SINGLE_SUCCESS;             return Command.SINGLE_SUCCESS;
           }           }
tutorial/command_exceptions.txt · Last modified: 2024/04/15 06:43 by solidblock