Class MinecraftArgumentTypes

java.lang.Object
org.kingdoms.commands.brigadier.MinecraftArgumentTypes

public final class MinecraftArgumentTypes extends Object
A registry of the ArgumentTypes provided by Minecraft.
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.mojang.brigadier.arguments.ArgumentType<?>
    getByKey(org.bukkit.NamespacedKey key)
    Gets a registered argument type by key.
    static Class<? extends com.mojang.brigadier.arguments.ArgumentType<?>>
    getClassByKey(org.bukkit.NamespacedKey key)
    Gets a registered argument type class by key.
    static boolean
    isRegistered(org.bukkit.NamespacedKey key)
    Gets if a argument is registered for the given key.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isRegistered

      public static boolean isRegistered(org.bukkit.NamespacedKey key)
      Gets if a argument is registered for the given key.
      Parameters:
      key - the key
      Returns:
      if an argument is registered
    • getClassByKey

      public static Class<? extends com.mojang.brigadier.arguments.ArgumentType<?>> getClassByKey(org.bukkit.NamespacedKey key) throws IllegalArgumentException
      Gets a registered argument type class by key.
      Parameters:
      key - the key
      Returns:
      the returned argument type class
      Throws:
      IllegalArgumentException - if no such argument is registered
    • getByKey

      public static com.mojang.brigadier.arguments.ArgumentType<?> getByKey(org.bukkit.NamespacedKey key) throws IllegalArgumentException
      Gets a registered argument type by key.
      Parameters:
      key - the key
      Returns:
      the returned argument
      Throws:
      IllegalArgumentException - if no such argument is registered