Interface ResourceKey

    • Method Detail

      • brigadier

        static @NonNull ResourceKey brigadier​(String value)
        Creates a resource key with a namespace of brigadier.
        Parameters:
        value - The value
        Returns:
        A new resource key
      • minecraft

        static @NonNull ResourceKey minecraft​(String value)
        Creates a resource key with a namespace of minecraft.
        Parameters:
        value - The value
        Returns:
        A new resource key
      • sponge

        static @NonNull ResourceKey sponge​(String value)
        Creates a resource key with a namespace of sponge.
        Parameters:
        value - The value
        Returns:
        A new resource key
      • of

        static ResourceKey of​(String namespace,
                              String value)
        Creates a resource key.
        Parameters:
        namespace - The namespace
        value - The value
        Returns:
        A new resource key
      • of

        static ResourceKey of​(org.spongepowered.plugin.PluginContainer plugin,
                              String value)
        Creates a resource key.
        Parameters:
        plugin - The plugin
        value - The value
        Returns:
        A new resource key
      • resolve

        static ResourceKey resolve​(String formatted)
        Resolves a resource key from a string.

        If no namespace is found in formatted then MINECRAFT_NAMESPACE will be the namespace.

        Parameters:
        formatted - The formatted string to parse
        Returns:
        A new resource key
      • formatted

        default String formatted()
        Gets this key as a formatted value.

        It is up to the implementation to determine the formatting. In vanilla Minecraft, keys are formatted as "namespace:value". For example, "minecraft:carrot".

        Returns:
        The key, formatted