Class CommandUtil

java.lang.Object
org.moddingx.libx.command.CommandUtil

public class CommandUtil extends Object
Utilities for commands.
  • Constructor Details

    • CommandUtil

      public CommandUtil()
  • Method Details

    • getArgumentOrDefault

      public static <T> T getArgumentOrDefault(com.mojang.brigadier.context.CommandContext<?> ctx, String name, Class<T> clazz, T defaultValue)
      Gets an argument for a command and if it's not present a default value.
      Parameters:
      name - The argument's name
      clazz - The argument's class
      defaultValue - A default value when the argument is not present.