Package-level declarations

Types

Link copied to clipboard
class BooleanArgumentType(parameterName: String) : ArgumentType<Boolean>

Boolean argument mirroring the legacy boolean parameter preset: accepts yes/on/true and no/off/false (case-insensitive).

Link copied to clipboard

Client-command string arguments. Prefer these over Brigadier com.mojang.brigadier.arguments.StringArgumentType.word / string() so unquoted tokens are not limited to the ASCII identifier whitelist.

Link copied to clipboard

Typed parse-error factories for the client argument types, mirroring the vanilla pattern of one DynamicCommandExceptionType per failure mode (see e.g. Vec3Argument.ERROR_NOT_COMPLETE). Unlike vanilla's Component.literal messages, the factories produce translatable components so the whole error sentence renders in the user's language.

Link copied to clipboard
sealed interface EnchantLevel

A parsed enchantment level: either an explicit positive Explicit.level or the max keyword (Max), which resolves to the enchantment's highest level.

Link copied to clipboard
object EnchantLevelArgumentType : ArgumentType<EnchantLevel>

Positive enchantment level or the keyword max (the enchantment's highest level), mirroring the legacy string-based level parameter of the .enchant command.

Link copied to clipboard

Resolves a friend by name at parse time: unknown names fail during parse instead of inside the handler (mirrors PlayerInfoArgumentType), and every consumer receives the same FriendManager.Friend instead of re-implementing the lookup.

Link copied to clipboard
class ModuleArgumentType(parameterName: String, predicate: (ClientModule) -> Boolean = { true }) : ArgumentType<ClientModule>

Single-choice module argument, mirroring the legacy module() parameter preset: the module name is matched case-insensitively.

Link copied to clipboard
class MultiSelectArgumentType<T : Any>(typeName: String, all: Iterable<T>, predicate: (T) -> Boolean, nameOf: (T) -> String) : ArgumentType<Set<T>>

Comma-separated multi-select argument, parsing to a Set of validated values.

Link copied to clipboard
class MultiTaggedArgumentType<T : Any>(parameterName: String, values: Collection<T>, tagOf: (T) -> String) : ArgumentType<List<T>>

Greedy multi-value argument that parses every remaining token as a tagged value, mirroring the legacy enumChoice(...).vararg() parameter (one token per value).

Link copied to clipboard
object PlayerInfoArgumentType : ArgumentType<PlayerInfo>

Resolves a tab-list player by name at parse time: invalid names fail during parse instead of inside the handler, and every consumer receives the same PlayerInfo instead of re-implementing the lookup.

Link copied to clipboard
class TaggedArgumentType<T : Tagged>(parameterName: String, values: Collection<T>, predicate: (T) -> Boolean = { true }) : ArgumentType<T>

Single-choice argument over an enum-like set of tagged values: the tag is matched case-insensitively.

Link copied to clipboard
class Vec3ArgumentType(centerCorrect: Boolean = true) : ArgumentType<Coordinates>

Client shell over the vanilla coordinate parsing (WorldCoordinates.parseDouble / LocalCoordinates.parse). Only position resolution differs from vanilla: the vanilla getters require a server-side net.minecraft.commands.CommandSourceStack, so getPosition resolves against the local player instead.

Functions

Link copied to clipboard
fun itemArgument(): ItemArgument

Creates the vanilla ItemArgument bound to the current world's registry access, accepting exactly what /give does (id, minecraft:id, [id|components]).

Link copied to clipboard
fun StringReader.readClientString(): String

Quoted string (same rules as StringReader.readString) or, if unquoted, an readUnquotedToken that accepts any non-space character.

Link copied to clipboard
inline fun <T> readGreedyTokens(reader: StringReader, parseToken: (String) -> T): List<T>

Reads every remaining whitespace-separated token of reader, translating each one through parseToken. The callback validates the token and throws a com.mojang.brigadier.exceptions.CommandSyntaxException on invalid input.

Link copied to clipboard
fun StringReader.readUnquotedToken(): String

Reads the next unquoted token: every character up to the next space (or end of input).

Link copied to clipboard

Renders this parsed level for the command result message: max stays the keyword, an explicit level prints as its number.

Link copied to clipboard
fun <T : Any> resourceArgument(key: ResourceKey<out Registry<T>>): ResourceArgument<T>

Creates the vanilla ResourceArgument for the registry identified by key, parsing to a type-safe Holder.Reference with vanilla errors and suggestions.