ClientCommandSource

object ClientCommandSource : SharedSuggestionProvider

Lightweight command source for LiquidBounce client commands, mirroring the role of Minecraft's CommandSourceStack on the server side.

The client only executes commands in the local game context, so the source is a singleton that exposes the current game state. requires predicates and handlers can use playerOrNull/levelOrNull/isIngame to gate execution, while the inherited MinecraftShortcuts properties stay non-null for use after the ingame check passed.

Implements vanilla SharedSuggestionProvider (like the client's own ClientSuggestionProvider) so argument types such as Vec3ArgumentType, ResourceArgument and ItemArgument resolve their suggestions through the source, instead of each provider hardcoding its candidates. Every delegate falls back to an empty/static value when no server connection exists (main menu, unit tests).

Properties

Link copied to clipboard
open val absoluteCoordinates: Collection<SharedSuggestionProvider.TextCoordinates?>?
Link copied to clipboard
open override val allTeams: Collection<String>
Link copied to clipboard
open override val availablePostEffects: Stream<Identifier>
Link copied to clipboard
open override val availableSounds: Stream<Identifier>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val levelOrNull: ClientLevel?
Link copied to clipboard
open override val onlinePlayerNames: Collection<String>
Link copied to clipboard
val playerOrNull: LocalPlayer?
Link copied to clipboard
open val relevantCoordinates: Collection<SharedSuggestionProvider.TextCoordinates?>?
Link copied to clipboard

Functions

Link copied to clipboard
open override fun customSuggestion(context: CommandContext<*>): CompletableFuture<Suggestions>

Server-driven custom tab completions require a request/response round-trip with a pending-suggestions id owned by the vanilla ClientSuggestionProvider; our client commands never reach the server, so there is nothing to query - empty by design.

Link copied to clipboard
open override fun enabledFeatures(): FeatureFlagSet

Feature flags announced by the current server connection; the vanilla defaults when no server is joined (main menu, unit tests).

Link copied to clipboard
open override fun getAllTeams(): Collection<String>
Link copied to clipboard
open override fun getAvailablePostEffects(): Stream<Identifier>
Link copied to clipboard
open override fun getAvailableSounds(): Stream<Identifier>
Link copied to clipboard
open override fun getOnlinePlayerNames(): Collection<String>
Link copied to clipboard
open override fun levels(): Set<ResourceKey<Level>>
Link copied to clipboard
open override fun permissions(): PermissionSet
Link copied to clipboard
open override fun registryAccess(): RegistryAccess

Synced world registries when a level is loaded; otherwise the static builtin RegistryAccess (not VanillaRegistries.createLookup, which is only a HolderLookup.Provider and is not a RegistryAccess).

Link copied to clipboard
open override fun <E : Any> suggestRegistryElements(key: ResourceKey<out Registry<E>>, elements: SharedSuggestionProvider.ElementSuggestionType, builder: SuggestionsBuilder, context: CommandContext<*>, filter: Predicate<E>): CompletableFuture<Suggestions>

Registry element suggestions for argument types such as ResourceArgument.

open fun <E : Any?> suggestRegistryElements(registry: HolderLookup<E?>?, elements: SharedSuggestionProvider.ElementSuggestionType?, builder: SuggestionsBuilder?, filter: Predicate<E?>?)