Internal CommandAPI

The CommandAPI does a lot of stuff "behind the scenes". This internal CommandAPI section will go into detail about what the CommandAPI does, how it's implemented and why it has been implemented like that.


Argument identifiers

The CommandAPI's arguments are basically representations of the different arguments that the Minecraft Command Data protocol handles. These are outlined in the table below:

IdentifierCommandAPI argument
brigadier:boolBooleanArgument
brigadier:doubleDoubleArgument
brigadier:floatFloatArgument
brigadier:integerIntegerArgument
brigadier:longLongArgument
brigadier:stringStringArgument
TextArgument
GreedyStringArgument
CustomArgument<T>
minecraft:angleAngleArgument
minecraft:block_posLocationArgument
(LocationType.BLOCK_POSITION)
minecraft:block_predicateBlockPredicateArgument
minecraft:block_stateBlockStateArgument
minecraft:colorChatColorArgument
minecraft:column_posLocation2DArgument
(LocationType.BLOCK_POSITION)
minecraft:componentChatComponentArgument
minecraft:dimensionEnvironmentArgument
minecraft:entityEntitySelectorArgument
minecraft:entity_anchor
minecraft:entity_summonEntityTypeArgument
minecraft:float_rangeFloatRangeArgument
minecraft:functionFunctionArgument
minecraft:game_profilePlayerArgument
minecraft:int_rangeIntegerRangeArgument
minecraft:item_enchantmentEnchantmentArgument
minecraft:item_predicateItemStackPredicateArgument
minecraft:item_slot
minecraft:item_stackItemStackArgument
minecraft:messageChatArgument
minecraft:mob_effectPotionEffectArgument
minecraft:nbt
minecraft:nbt_compound_tagNBTCompoundArgument
minecraft:nbt_path
minecraft:nbt_tag
minecraft:objectiveObjectiveArgument
minecraft:objective_criteriaObjectiveCriteriaArgument
minecraft:operationMathOperationArgument
minecraft:particleParticleArgument
minecraft:resource_locationAdvancementArgument
BiomeArgument
CustomArgument<T>
LootTableArgument
RecipeArgument
SoundArgument
minecraft:rotationRotationArgument
minecraft:score_holderScoreHolderArgument
minecraft:scoreboard_slotScoreboardSlotArgument
minecraft:swizzleAxisArgument
minecraft:teamTeamArgument
minecraft:timeTimeArgument
minecraft:uuidUUIDArgument
minecraft:vec2Location2DArgument
(LocationType.PRECISE_POSITION)
minecraft:vec3LocationArgument
(LocationType.PRECISE_POSITION)

There are a few arguments that aren't implemented. Here's why:

  • minecraft:entity_anchor - This argument only has two values: eyes and feet. It's incredibly unnecessary for any other purpose and is easier to implement with a MultiLiteralArgument.

  • minecraft:item_slot - Bukkit's implementation of item slot numbers differs very wildly to Minecraft's implementation of item slot numbers. This difference makes it near-impossible to have a suitable middle-ground for item slot numbers that ensures that invalid numbers cannot be passed to the wrong inventory type. An implementation of this would require a rewrite of the current system to maintain proper inventory slot access safety.

  • minecraft:nbt, minecraft:nbt_path, minecraft:nbt_tag - You've got the NBTCompoundArgument, that's good enough, right? ¯\_(ツ)_/¯