User Tools

Site Tools


ru: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 revision
Previous revision
ru:tutorial:commands [2022/03/03 11:50] furnygoru:tutorial:commands [2022/03/03 13:27] (current) furnygo
Line 221: Line 221:
 | [[ru:tutorial:commands:exceptions|Исключения]]| Сбой выполнения команды с описательным сообщением и в определенных контекстах.|                                                                   | [[ru:tutorial:commands:exceptions|Исключения]]| Сбой выполнения команды с описательным сообщением и в определенных контекстах.|                                                                  
 | [[ru:tutorial:commands:suggestions|Предложения]]| Предложение входных данных для отправки клиенту.| | [[ru:tutorial:commands:suggestions|Предложения]]| Предложение входных данных для отправки клиенту.|
-| [[ru:tutorial:commands:redirects_aliases|Перенаправления (Разные вариации)]]| Разрешить использование разновидностей команд.| +| [[ru:tutorial:commands:redirects_aliases|Редиректы (Разные вариации)]]| Разрешить использование разновидностей команд.| 
-| [[ru:tutorial:commands:redirects_chaining|Перенаправления (Цепочки)]]| Разрешить командам иметь повторяющиеся элементы и флаги.|+| [[ru:tutorial:commands:redirects_chaining|Редиректы (Цепочки)]]| Разрешить командам иметь повторяющиеся элементы и флаги.|
 | [[ru:tutorial:commands:argument_types|Свои типы аргументов]]| Анализируйте свои аргументы и возвращайте свои типы.| | [[ru:tutorial:commands:argument_types|Свои типы аргументов]]| Анализируйте свои аргументы и возвращайте свои типы.|
- 
-**Будет сделано позже:** Разделы перемещаются в подкатегории и будут добавлены в соответствующие статьи по мере их переноса. 
  
 ====== Часто задаваемые вопросы ====== ====== Часто задаваемые вопросы ======
Line 261: Line 259:
 ---- ----
  
-====== Со временем уберётся ======+====== Со временем будет перенесено ======
  
-**__Currently this article is being migrated, so things may be a mess. Below is are the parts of the article that are yet to be migrated to the new format.__**+===== Что может сделать ServerCommandSource? =====
  
-===== Requirements ===== +''ServerCommandSource'' предоставляет некоторый дополнительный контекстспецифичный для конкретной реализациипри выполнении командыЭто включает в себя возможность получить объекткоторый выполнил командумирв котором была запущена командаили серверна котором была запущена команда:
- +
-Lets say you have a command you only want operators to be able to execute. This is where the ''requires'' method comes into play. The requires method has one argument of a Predicate<ServerCommandSource> which will supply a ServerCommandSource to test with and determine if the CommandSource can execute the command. +
- +
-For example this may look like the following: +
- +
-<code java [enable_line_numbers="true"]> +
-dispatcher.register(literal("foo"+
- .requires(source -> source.hasPermissionLevel(4)) +
- .executes(ctx -> { +
- ctx.getSource().sendFeedback(new LiteralText("You are an operator", false)); +
- return 1; +
- }); +
-</code> +
- +
-This command will only execute if the Source of the command is a level 4 operator at minimum. If the predicate returns false, then the command will not execute. Also this has the side effect of not showing this command in tab completion to anyone who is not a level 4 operator. +
- +
-Nothing prevents someone from specifying calls to permissions implementations within the ''requires'' block. Just note that if permissions changeyou need to re send the command tree. +
- +
-===== Exceptions ===== +
- +
-Brigadier supports command exceptions which can be used to end a command such as if an argument didn't parse properly or the command failed to executeas well as including richer details of the failure. +
- +
-All the exceptions from Brigadier are based on the CommandSyntaxException. The two main types of exceptions Brigadier provides are Dynamic and Simple exception typesof which you must ''create()'' the exception to throw it. These exceptions also allow you to specify the context in which the exception was thrown using ''createWithContext(ImmutableStringReader)''which builds the error message to point to where on the inputted command line the error occured. +
-Below is a coin flip command to show an example of exceptions in use. +
- +
-<code java [enable_line_numbers="true"]> +
-dispatcher.register(CommandManager.literal("coinflip"+
-    .executes(ctx -> { +
-        Random random = new Random(); +
-  +
-        if(random.nextBoolean()) { // If heads succeed. +
-            ctx.getSource().sendMessage(new TranslateableText("coin.flip.heads")) +
-            return Command.SINGLE_SUCCESS; +
-        } +
- +
-        throw new SimpleCommandExceptionType(new TranslateableText("coin.flip.tails")).create(); // Oh no tailsyou lose. +
-    })); +
-</code> +
- +
-Though you are not just limited to a single type of exception as Brigadier also supplies Dynamic exceptions which take additional parameters for context. +
- +
-<code java [enable_line_numbers="true"]> +
-DynamicCommandExceptionType used_name = new DynamicCommandExceptionType(name -> { +
-    return new LiteralText("The name: " + (String) name + " has been used"); +
-}); +
-</code> +
- +
-There are more Dynamic exception types which each take a different amount of arguments into account (''Dynamic2CommandExceptionType''''Dynamic3CommandExceptionType''''Dynamic4CommandExceptionType'', ''DynamicNCommandExceptionType''). +
-You should remember that the Dynamic exceptions takes an object as an argument so you may have to cast the argument for your use. +
- +
-===== Redirects (Aliases) ===== +
- +
-Redirects are Brigadier's form of aliases. Below is how Minecraft handles /msg have an alias of /tell and /w.  +
- +
-<code java [enable_line_numbers="true"]> +
-public static void register(CommandDispatcher<ServerCommandSource> dispatcher) { +
-    LiteralCommandNode node = registerMain(dispatcher); // Registers main command +
-    dispatcher.register(literal("tell"+
-        .redirect(node)); // Alias 1, redirect to main command +
-    dispatcher.register(literal("w"+
-        .redirect(node)); // Alias 2, redirect to main command +
-+
- +
-public static LiteralCommandNode registerMain(CommandDispatcher<ServerCommandSource> dispatcher) { +
-    return dispatcher.register(literal("msg"+
-    .then(argument("targets", EntityArgumentType.players()) +
-        .then(argument("message", MessageArgumentType.message()) +
-            .executes(ctx -> { +
-                return execute(ctx.getSource(), getPlayers(ctx, "targets"), getMessage(ctx, "message")); +
-            })))); +
-+
-</code> +
- +
-The redirect tells brigadier to continue parsing the command at another command node. +
- +
-===== Redirects (Chainable Commands) ===== +
-Commands such as ''/execute as @e[type=player] in the_end run tp ~ ~ ~'' are possible because of redirects. Below is an example of a chainable command: +
- +
-<code java [enable_line_numbers="true"]> +
-LiteralCommandNode<ServerCommandSource> root = dispatcher.register(literal("fabric_test")); +
-LiteralCommandNode<ServerCommandSource> root1 = dispatcher.register(literal("fabric_test")  +
-// You can register under the same literal more than once, it will just register new parts of the branch as shown below if you register a duplicate branch an error will popup in console warning of conflicting commands but one will still work. +
-    .then(literal("extra"+
-        .then(literal("long"+
-            .redirect(root, this::lengthen)) // Return to root for chaining +
-        .then(literal("short"+
-            .redirect(root, this::shorten))) // Return to root for chaining +
-        .then(literal("command"+
-            .executes(ctx -> { +
-                ctx.getSource().sendFeedback(new LiteralText("Chainable Command"), false); +
-                return Command.SINGLE_SUCCESS; +
-}))); +
-</code> +
-The redirect can also modify the CommandSource by use of a ''redirect modifier'' which can be used for builder commands. +
- +
-<code java [enable_line_numbers="true"]> +
-.redirect(rootNode, context -> { +
-    return ((ServerCommandSource) context.getSource()).withLookingAt(Vec3ArgumentType.getVec3(context, "pos")); +
-}) +
-</code> +
- +
-===== What can the ServerCommandSource do? ===== +
- +
-A server command source provides some additional implementation specific context when a command is run. This includes the ability to get the entity that executed the command, the world the command was ran in or the server the command was run on.+
  
 <code java [enable_line_numbers="true"]> <code java [enable_line_numbers="true"]>
 final ServerCommandSource source = ctx.getSource();  final ServerCommandSource source = ctx.getSource(); 
-// Get the sourceThis will always work.+// Находка источникаЭто всегда будет работать.
  
 final Entity sender = source.getEntity();  final Entity sender = source.getEntity(); 
-// Uncheckedmay be null if the sender was the console.+// Непроверенныйможет быть нулевым, если отправителем была консоль.
  
 final Entity sender2 = source.getEntityOrThrow();  final Entity sender2 = source.getEntityOrThrow(); 
-// Will end the command if the source of the command was not an Entity.  +// Завершит выполнение команды, если источником команды не была не сущность.  
-// The result of this could contain a playerAlso will send feedback telling the sender of the command that they must be an entity.  +// В результате этого может появиться игрокТакже будет отправлена обратная связь, сообщающая отправителю команды, что он должен быть сущностью.  
-// This method will require your methods to throw a CommandSyntaxException.  +// Этот метод потребует, чтобы ваши методы вызывали исключение CommandSyntaxException.  
-// The entity options in ServerCommandSource could return a CommandBlock entityany living entity or a player.+// Параметры сущности в ServerCommandSource могут возвращать сущность CommandBlock, любое живое существо или игрока.
  
 final ServerPlayerEntity player = source.getPlayer();  final ServerPlayerEntity player = source.getPlayer(); 
-// Will end the command if the source of the command was not explicitly a PlayerAlso will send feedback telling the sender of the command that they must be a player This method will require your methods to throw a CommandSyntaxException+// Завершит выполнение команды, если источником команды явно не был игрокТакже будет отправлен отзыв, сообщающий отправителю команды, что он должен быть игроком. 
 +// Этот метод потребует, чтобы ваши методы вызывали исключение CommandSyntaxException
  
 source.getPosition();  source.getPosition(); 
-// Get's the sender's position as a Vec3 when the command was sentThis could be the location of the entity/command block or in the case of the consolethe world's spawn point.+// Позиция отправителя в качестве Vec3, когда была отправлена командаЭто может быть местоположение сущности/командного блока или, в случае консолиточка появления в мире.
  
 source.getWorld();  source.getWorld(); 
-// Get's the world the sender is withinThe console's world is the same as the default spawn world.+// Мир, в котором находится отправительМир консоли такой же, как и мир создания по умолчанию.
  
 source.getRotation();  source.getRotation(); 
-// Get's the sender's rotation as a Vec2f.+// Вращение отправителя как Vec2f.
  
 source.getMinecraftServer();  source.getMinecraftServer(); 
-// Access to the instance of the MinecraftServer this command was ran on.+// Доступ к экземпляру MinecraftServer, на котором была запущена эта команда.
  
 source.getName();  source.getName(); 
-// The name of the command sourceThis could be the name of the entityplayerthe name of a CommandBlock that has been renamed before being placed down or in the case of the Console, "Console"+// Имя источника командыЭто может быть имя сущностиигрокаимя командного блока, который был переименован перед размещением, или, в случае консоли, "Console".
  
 source.hasPermissionLevel(int level);  source.hasPermissionLevel(int level); 
-// Returns true if the source of the command has a certain permission levelThis is based on the operator status of the sender. (On an integrated server, the player must have cheats enabled to execute these commands)+// Возвращает значение true, если источник команды имеет определенный уровень разрешенийЭто зависит от статуса оператора отправителя. (На интегрированном сервере у игрока должны быть включены читы для выполнения этих команд)
 </code> </code>
  
-===== Some example commands examples =====+===== Некоторые примеры команд =====
  
-=== Broadcast a message ===+=== Транслировать сообщение ===
  
 <code java [enable_line_numbers="true"]>  <code java [enable_line_numbers="true"]> 
 public static void register(CommandDispatcher<ServerCommandSource> dispatcher){ public static void register(CommandDispatcher<ServerCommandSource> dispatcher){
     dispatcher.register(literal("broadcast")     dispatcher.register(literal("broadcast")
-        .requires(source -> source.hasPermissionLevel(2)) // Must be a game master to use the commandCommand will not show up in tab completion or execute to non operators or any operator that is permission level 1.+        .requires(source -> source.hasPermissionLevel(2)) // Должен быть мастером игры, чтобы использовать эту командуКоманда не будет отображаться при перебора через Tab или выполняться не для операторов или любого оператора, имеющего уровень разрешений 1.
             .then(argument("color", ColorArgumentType.color())             .then(argument("color", ColorArgumentType.color())
                 .then(argument("message", greedyString())                 .then(argument("message", greedyString())
-                    .executes(ctx -> broadcast(ctx.getSource(), getColor(ctx, "color"), getString(ctx, "message")))))); // You can deal with the arguments out here and pipe them into the command.+                    .executes(ctx -> broadcast(ctx.getSource(), getColor(ctx, "color"), getString(ctx, "message")))))); // Вы можете разобраться с приведенными здесь аргументами и передать их в команду.
 } }
  
Line 423: Line 318:
  
     source.getMinecraftServer().getPlayerManager().broadcastChatMessage(text, false);     source.getMinecraftServer().getPlayerManager().broadcastChatMessage(text, false);
-    return Command.SINGLE_SUCCESS; // Success+    return Command.SINGLE_SUCCESS; // Успех
 } }
 </code> </code>
Line 429: Line 324:
 ==== /giveMeDiamond ==== ==== /giveMeDiamond ====
  
-First the basic code where we register "giveMeDiamond" as a literal and then an executes block to tell the dispatcher which method to run.+Сначала базовый код, в котором мы регистрируем ''giveMeDiamond'' как литерал, а затем вызываем блок, чтобы сообщить диспетчеру, какой метод запускать:
  
 <code java [enable_line_numbers="true"]> <code java [enable_line_numbers="true"]>
-public static LiteralCommandNode register(CommandDispatcher<ServerCommandSource> dispatcher) { // You can also return a LiteralCommandNode for use with possible redirects+public static LiteralCommandNode register(CommandDispatcher<ServerCommandSource> dispatcher) { // Вы также можете вернуть LiteralCommandNode для использования с возможными редиректорами.
     return dispatcher.register(literal("giveMeDiamond")     return dispatcher.register(literal("giveMeDiamond")
         .executes(ctx -> giveDiamond(ctx)));         .executes(ctx -> giveDiamond(ctx)));
Line 438: Line 333:
 </code> </code>
  
-Then since we only want to give to playerswe check if the CommandSource is a playerBut we can use ''getPlayer'' and do both at the same time and throw an error if the source is not a player.+Затемпоскольку мы хотим передавать только игрокам, мы проверяем, является ли CommandSource игрокомНо мы можем использовать ''getPlayer'' и сделать и то, и другое одновременно, и выдать ошибку, если источник не является игроком:
  
 <code java [enable_line_numbers="true"]> <code java [enable_line_numbers="true"]>
Line 444: Line 339:
     final ServerCommandSource source = ctx.getSource();     final ServerCommandSource source = ctx.getSource();
   
-    final PlayerEntity self = source.getPlayer(); // If not a player than the command ends+    final PlayerEntity self = source.getPlayer(); // Если это не игрок, то команда заканчивается
 </code> </code>
  
-Then we add to the player's inventorywith a check to see if the inventory is full:+Затем мы добавляем в инвентарь игрокапроверяя, заполнен ли инвентарь:
  
 <code java [enable_line_numbers="true"]> <code java [enable_line_numbers="true"]>
Line 458: Line 353:
 </code> </code>
  
-==== Antioch ==== +==== Граната Антиоха ==== 
-...lobbest thou thy Holy Hand Grenade of Antioch towards thy foe+...брось ты свою Святую Ручную Гранату из Антиохии своему врагу
-who being naughty in My sightshall snuff it.+которыйбудучи непослушным в моих глазах, погубит его 
 +(Иностранный прикол)
  
-Aside from the joke this command summons a primed TNT to a specified location or the location of the sender's cursor.+Помимо шутки, эта команда вызывает заряженный TNT в указанное местоположение или местоположение курсора отправителя.
  
-First create an entry into the CommandDispatcher that takes a literal of antioch with an optional argument of the location to summon the entity at.+Сначала создайте запись в CommandDispatcher, которая принимает литерал antioch с необязательным аргументом местоположения для вызова сущности.
  
 <code java [enable_line_numbers="true"]> <code java [enable_line_numbers="true"]>
Line 475: Line 371:
 </code> </code>
  
-Then the creation and messages behind the joke.+Затем создайте сообщения, стоящие за шуткой:
  
 <code java [enable_line_numbers="true"]> <code java [enable_line_numbers="true"]>
 public static int antioch(ServerCommandSource source, BlockPos blockPos) throws CommandSyntaxException { public static int antioch(ServerCommandSource source, BlockPos blockPos) throws CommandSyntaxException {
     if(blockPos == null) {     if(blockPos == null) {
-        // For the case of no inputted argument we calculate the cursor position of the player or throw an error if the nearest position is too far or is outside of the world+        // В случае отсутствия введенного аргумента мы вычисляем положение курсора игрока или выдаем ошибку, если ближайшая позиция находится слишком далеко или находится за пределами мира
-        // This class is used as an example and actually doesn't exist yet.+        // Этот класс используется в качестве примера и на самом деле еще не существует.
         blockPos = LocationUtil.calculateCursorOrThrow(source, source.getRotation());         blockPos = LocationUtil.calculateCursorOrThrow(source, source.getRotation());
     }     }
Line 488: Line 384:
     tnt.setFuse(3);     tnt.setFuse(3);
                  
-    source.getMinecraftServer().getPlayerManager().broadcastChatMessage(new LiteralText("...lobbest thou thy Holy Hand Grenade of Antioch towards thy foe").formatting(Formatting.RED), false); +    source.getMinecraftServer().getPlayerManager().broadcastChatMessage(new LiteralText("...брось ты свою Святую Ручную Гранату из Антиохии своему врагу").formatting(Formatting.RED), false); 
-    source.getMinecraftServer().getPlayerManager().broadcastChatMessage(new LiteralText("who being naughty in My sightshall snuff it.").formatting(Formatting.RED), false);+    source.getMinecraftServer().getPlayerManager().broadcastChatMessage(new LiteralText("которыйбудучи непослушным в моих глазах, погубит его.").formatting(Formatting.RED), false);
     source.getWorld().spawnEntity(tnt);     source.getWorld().spawnEntity(tnt);
     return 1;     return 1;
Line 495: Line 391:
 </code> </code>
  
-==== More examples coming soon ==== +==== Скоро появятся новые примеры ====
- +
-===== Custom Argument Types ===== +
- +
-Brigadier has support for custom argument types and this section goes into showing how to create a simple argument type.  +
- +
-Warning: Custom arguments require client mod installation to be registered correctly! If you are making a server plugin, consider using existing argument type and a custom suggestions provider instead. +
- +
-For this example we will create a UuidArgumentType. +
- +
-First create a class which extends ''ArgumentType''. Note that ArgumentType is a generic, so the generic will define what type the ArgumentType will return +
- +
-<code java [enable_line_numbers="true"]> +
-public class UuidArgumentType implements ArgumentType<UUID>+
-</code> +
- +
-ArgumentType requires you to implement the ''parse'' method, the type it returns will match with the Generic type. +
-<code java> +
-@Override +
-public UUID parse(StringReader reader) throws CommandSyntaxException { +
-</code> +
- +
-This method is where all of your parsing will occur. Either this method will return the object based on the arguments provided in the command line or throw a CommandSyntaxException and parsing will fail. +
- +
-Next you will store the current position of the cursor, this is so you can substring out only the specific argument. This will always be at the beginning of where your argument appears on the command line. +
- +
-<code java [enable_line_numbers="true"]> +
-int argBeginning = reader.getCursor(); // The starting position of the cursor is at the beginning of the argument. +
-if (!reader.canRead()) { +
-    reader.skip(); +
-+
-</code> +
- +
-Now we grab the entire argument. Depending on your argument type, you may have a different criteria or be similar to some arguments where detecting a ''{'' on the command line will require it to be closed. For a UUID we will just figure out what cursor position the argument ends at. +
- +
-<code java [enable_line_numbers="true"]> +
-while (reader.canRead() && reader.peek() != ' ') { // peek provides the character at the current cursor position. +
-    reader.skip(); // Tells the StringReader to move it's cursor to the next position. +
-+
-</code> +
- +
-Then we will ask the StringReader what the current position of the cursor is an substring our argument out of the command line. +
- +
-<code java [enable_line_numbers="true"]>String uuidString = reader.getString().substring(argBeginning, reader.getCursor());</code> +
- +
-Now finally we check if our argument is correct and parse the specific argument to our liking, and throwing an exception if the parsing fails. +
- +
-<code java [enable_line_numbers="true"]> +
-try { +
-    UUID uuid = UUID.fromString(uuidString); // Now our actual logic. +
-    return uuid; // And we return our type, in this case the parser will consider this argument to have parsed properly and then move on. +
-    } catch (Exception ex) { +
-    // UUIDs can throw an exception when made by a string, so we catch the exception and repackage it into a CommandSyntaxException type. +
-    // Create with context tells Brigadier to supply some context to tell the user where the command failed at. +
-    // Though normal create method could be used. +
-    throw new SimpleCommandExceptionType(new LiteralText(ex.getMessage())).createWithContext(reader); +
-+
-</code> +
- +
-The ArgumentType is done, however your client will refuse the parse the argument and throw an error. This is because the server will tell the client what argument type the command node is. And the client will not parse any argument types it does not know how to parse. To fix this we need to register an ArgumentSerializer.  +
-Within your ModInitializer. For more complex argument types, you may need to create your own ArgumentSerializer. +
- +
-<code java [enable_line_numbers="true"]> +
-ArgumentTypes.register("mymod:uuid", UuidArgumentType.class, new ConstantArgumentSerializer(UuidArgumentType::uuid));  +
-// The argument should be what will create the ArgumentType. +
-</code> +
- +
-And here is the whole ArgumentType: +
- +
-<file java UuidArgumentType.java [enable_line_numbers="true"]> +
- +
-import com.mojang.brigadier.StringReader; +
-import com.mojang.brigadier.arguments.ArgumentType; +
-import com.mojang.brigadier.context.CommandContext; +
-import com.mojang.brigadier.exceptions.CommandSyntaxException; +
-import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; +
-import net.minecraft.text.LiteralText; +
-import net.minecraft.util.SystemUtil; +
- +
-import java.util.ArrayList; +
-import java.util.Collection; +
-import java.util.UUID; +
- +
-/** +
- * Represents an ArgumentType that will return a UUID. +
- */ +
-public class UuidArgumentType implements ArgumentType<UUID>+
-    public static UuidArgumentType uuid() { +
-        return new UuidArgumentType(); +
-    } +
- +
-    public static <S> UUID getUuid(String name, CommandContext<S> context) { +
-        // Note that you should assume the CommandSource wrapped inside of the CommandContext will always be a generic type. +
-        // If you need to access the ServerCommandSource make sure you verify the source is a server command source before casting. +
-        return context.getArgument(name, UUID.class); +
-    } +
- +
-    private static final Collection<String> EXAMPLES = SystemUtil.consume(new ArrayList<>(), list -> { +
-        list.add("765e5d33-c991-454f-8775-b6a7a394c097"); // i509VCB: Username The_1_gamers +
-        list.add("069a79f4-44e9-4726-a5be-fca90e38aaf5"); // Notch +
-        list.add("61699b2e-d327-4a01-9f1e-0ea8c3f06bc6"); // Dinnerbone +
-    }); +
- +
-    @Override +
-    public UUID parse(StringReader reader) throws CommandSyntaxException { +
-        int argBeginning = reader.getCursor(); // The starting position of the cursor is at the beginning of the argument. +
-        if (!reader.canRead()) { +
-            reader.skip(); +
-        } +
- +
-        // Now we check the contents of the argument till either we hit the end of the command line (When canRead becomes false) +
-        // Otherwise we go till reach reach a space, which signifies the next argument +
-        while (reader.canRead() && reader.peek() != ' ') { // peek provides the character at the current cursor position. +
-            reader.skip(); // Tells the StringReader to move it's cursor to the next position. +
-        } +
- +
-        // Now we substring the specific part we want to see using the starting cursor position and the ends where the next argument starts. +
-        String uuidString = reader.getString().substring(argBeginning, reader.getCursor()); +
-        try { +
-            UUID uuid = UUID.fromString(uuidString); // Now our actual logic. +
-            return uuid; // And we return our type, in this case the parser will consider this argument to have parsed properly and then move on. +
-        } catch (Exception ex) { +
-            // UUIDs can throw an exception when made by a string, so we catch the exception and repackage it into a CommandSyntaxException type. +
-            // Create with context tells Brigadier to supply some context to tell the user where the command failed at. +
-            // Though normal create method could be used. +
-            throw new SimpleCommandExceptionType(new LiteralText(ex.getMessage())).createWithContext(reader); +
-        } +
-    } +
- +
-    @Override +
-    public Collection<String> getExamples() { // Brigadier has support to show examples for what the argument should look like, this should contain a Collection of only the argument this type will return. This is mainly used to calculate ambiguous commands which share the exact same  +
-        return EXAMPLES; +
-    } +
-+
-</file>+
ru/tutorial/commands.1646308225.txt.gz · Last modified: 2022/03/03 11:50 by furnygo