Skip to content

cloud-bukkit#

The cloud-bukkit module is home to parsers and other classes that make up the base of Cloud for Bukkit-based platforms. cloud-bukkit is not intended to be consumed as a direct dependency, instead it should be consumed as a transitive dependency of cloud-paper.

Parsers#

Parser Type (* = cloud type) Brigadier Type Note
UUIDParser UUID uuid link
NamespacedKeyParser NamespacedKey resource_location
EnchantmentParser Enchantment enchantment
ItemStackParser ProtoItemStack* item_stack
ItemStackPredicateParser ItemStackPredicate* item_predicate
BlockPredicateParser BlockPredicate* block_predicate
SingleEntitySelectorParser SingleEntitySelector* entity link
SinglePlayerSelectorParser SinglePlayerSelector* entity link
MultipleEntitySelectorParser MultipleEntitySelector* entity link
MultiplePlayerSelectorParser MultiplePlayerSelector* entity link
LocationParser Location vec3
Location2DParser Location2D* vec2
MaterialParser Material
OfflinePlayerParser OfflinePlayer
PlayerPayer Player
WorldParser World

NamespacedKeyParser#

The NamespacedKeyParser parses namespaced key in the form namespace:key.

Annotations#

@DefaultNamespace#

Use @DefaultNamespace("namespace") on a component to set the namespace which will be used in the case that no namespace is supplied by the command sender.

@RequireExplicitNamespace#

Use @RequireExplicitNamespace to fail parsing if the command sender does not supply a namespace.

Selectors#

Annotations#

@AllowEmptySelection#

Use @AllowEmptySelection to allow the command sender to execute a command with a selector which selects zero entities.

Descriptions#

Cloud will register all root literals to the Bukkit CommandMap which means that they will show up in the Bukkit help menu. Cloud will try to determine the description for the Bukkit help menu by:

  1. Use the BukkitCommandMeta.BUKKIT_DESCRIPTION meta value of the command, if it exists.
  2. Using the CommandDescription, if a command is attached directly to the root literal.
  3. Use the root literal Description, if it’s non-empty.

Localization#

cloud-bukkit provides additional caption keys for the localization system. These can be found in BukkitCaptionKeys. The default caption values can be found in BukkitDefaultCaptionsProvider.