Class ServerArgumentType.Builder<T extends com.mojang.brigadier.arguments.ArgumentType<?>>

    • Constructor Detail

    • Method Detail

      • type

        public abstract ServerArgumentType.Builder<Ttype​(Class<? super T> type)
        Set the native argument type.

        A superclass is accepted within the type parameter to allow for parameterized argument types. This does not allow for extensions types.

        Parameters:
        type - Native argument type
        Returns:
        this
      • fallbackProvider

        public abstract ServerArgumentType.Builder<TfallbackProvider​(Function<T,​com.mojang.brigadier.arguments.ArgumentType<?>> provider)
        Set the provider to be sent to clients without this argument type.

        The returned argument type may be provided as

        Parameters:
        provider - function taking own argument type and creating a
        Returns:
        this
      • fallbackSuggestions

        public abstract ServerArgumentType.Builder<TfallbackSuggestions​(@Nullable com.mojang.brigadier.suggestion.SuggestionProvider<?> suggestions)
        Set the suggestion provider that will be set to clients that don't have this argument type.

        By default, this is SuggestionProviders.ASK_SERVER, in order to use the full argument type's suggestions. However, if the fallback type provides its own suggestions that meet requirements, this can be explicitly set to null

        Parameters:
        suggestions - Provider for suggestions that will be sent to the client.
        Returns:
        this