Arg
Namespace Mc.Scripting.Commands · Kind class (static)
public static class ArgFactories for the argument types of the vanilla command engine. Values are read in the executor with the typed getters of CommandContext (GetInt, GetPlayer, GetBlockPos, …); types without a typed getter are read as text with CommandContext.GetText.
Methods
Section titled “Methods”| Member | Description |
|---|---|
static ArgType Angle() |
A yaw angle, absolute or relative (90, ~-10). |
static ArgType BlockPos() |
A block position (1 64 1, ~ ~1 ~, ^ ^ ^2). |
static ArgType BlockPredicate() |
A block predicate (state, tag, block entity data). |
static ArgType BlockState() |
A block state such as minecraft:oak_stairs[facing=north] (read with CommandContext.GetBlockState). |
static ArgType Bool() |
true / false. |
static ArgType Color() |
A named chat colour (red, gold, …) or reset. |
static ArgType ColumnPos() |
An x/z column position. |
static ArgType Component() |
A text component in JSON/SNBT form (read with CommandContext.GetText). |
static ArgType ContextFloatProvider() |
A float provider as the loot / worldgen data writes it (a constant, {type:"minecraft:uniform",min_inclusive:0,max_exclusive:1}, …). |
static ArgType ContextIntProvider() |
An int provider as the loot / worldgen data writes it. |
static ArgType Dialog() |
A dialog: an id of the dialog registry or an inline definition. |
static ArgType Dimension() |
A dimension key. |
Double |
A double-precision number, optionally limited. |
static ArgType Entities() |
Any number of entities. |
static ArgType Entity() |
Exactly one entity. |
static ArgType EntityAnchor() |
An entity anchor: feet or eyes. |
static ArgType Feature() |
A configured worldgen feature (an id of the worldgen/configured_feature registry). |
static ArgType Float(float min = -3.4028235E+38f, float max = 3.4028235E+38f) |
A single-precision number, optionally limited. |
static ArgType FloatRange() |
An inclusive decimal range. |
static ArgType Function() |
A data pack function id or tag. |
static ArgType GameMode() |
A game mode name. |
static ArgType GameProfile() |
A player profile (also offline players: names and uuids). |
static ArgType GreedyString() |
The rest of the line. |
static ArgType Heightmap() |
A heightmap name (world_surface, motion_blocking, …). |
static ArgType HexColor() |
A colour as #RRGGBB. |
static ArgType Int(int min = -2147483648, int max = 2147483647) |
A 32-bit integer, optionally limited. |
static ArgType IntRange() |
An inclusive integer range (1..5, ..3). |
static ArgType Item() |
An item with components, e.g. |
static ArgType ItemPredicate() |
An item predicate. |
static ArgType ItemSlot() |
One inventory slot name (container.5, weapon.mainhand). |
static ArgType ItemSlots() |
A group of inventory slots (container.*). |
static ArgType Long(long min = -9223372036854775808, long max = 9223372036854775807) |
A 64-bit integer, optionally limited. |
static ArgType LootModifier() |
A loot modifier. |
static ArgType LootPredicate() |
A loot predicate. |
static ArgType LootTable() |
A loot table. |
static ArgType Message() |
A chat message that may contain selectors. |
static ArgType NbtCompound() |
An SNBT compound. |
static ArgType NbtPath() |
An NBT path. |
static ArgType NbtTag() |
Any SNBT tag. |
static ArgType Objective() |
A scoreboard objective name. |
static ArgType ObjectiveCriteria() |
A scoreboard criterion (dummy, health, minecraft.mined:minecraft.stone). |
static ArgType Operation() |
A scoreboard operation (+=, %=, ><). |
static ArgType Particle() |
A particle with its parameters (minecraft:dust{color:[1,0,0],scale:1}). |
static ArgType Player() |
One online player (name, uuid or a selector that matches exactly one player). |
static ArgType Players() |
Any number of online players (names or selectors such as @a). |
static ArgType Resource(string registry) |
An entry of a registry (“minecraft:enchantment”, “minecraft:sound_event”, …), suggested by the engine. |
static ArgType ResourceKey(string registry) |
A registry key (not the entry), e.g. |
static ArgType ResourceLocation() |
A resource location, namespace:path. |
static ArgType ResourceOrTag(string registry) |
An entry of a registry or a #tag of it. |
static ArgType ResourceOrTagKey(string registry) |
A registry key or a #tag of keys. |
static ArgType ResourceSelector(string registry) |
A selector over the entries of a registry (*, minecraft:*, tags). |
static ArgType Rotation() |
A rotation (yaw pitch). |
static ArgType ScoreHolder(bool multiple = false) |
A score holder (names, selectors, *). |
static ArgType ScoreboardSlot() |
A scoreboard display slot (sidebar, list, below_name, sidebar.team.red). |
static ArgType SlotSource() |
A slot source of the item modifier data (minecraft:slot_source). |
static ArgType String() |
A word or a quoted phrase. |
static ArgType Style() |
A text style in JSON/SNBT form. |
static ArgType SwingAnimation() |
A swing animation type (none, stab, whack). |
static ArgType Swizzle() |
A set of axes (xz, xyz). |
static ArgType Team() |
A team name. |
static ArgType TemplateMirror() |
A structure mirror (none, left_right, front_back). |
static ArgType TemplateRotation() |
A structure rotation (none, clockwise_90, 180, counterclockwise_90). |
static ArgType Time(int minTicks = 0) |
A duration such as 10s, 5d, 20t (parsed to ticks). |
static ArgType Uuid() |
A uuid (read with CommandContext.GetText). |
static ArgType Vec2() |
A 2D position. |
static ArgType Vec3() |
A position with decimals. |
static ArgType Word() |
A single word (letters, digits, `_ - . |
public static ArgType Angle()A yaw angle, absolute or relative (90, ~-10).
Returns ArgType
BlockPos
Section titled “BlockPos”public static ArgType BlockPos()A block position (1 64 1, ~ ~1 ~, ^ ^ ^2).
Returns ArgType
BlockPredicate
Section titled “BlockPredicate”public static ArgType BlockPredicate()A block predicate (state, tag, block entity data).
Returns ArgType
BlockState
Section titled “BlockState”public static ArgType BlockState()A block state such as minecraft:oak_stairs[facing=north] (read with CommandContext.GetBlockState).
Returns ArgType
public static ArgType Bool()true / false.
Returns ArgType
public static ArgType Color()A named chat colour (red, gold, …) or reset.
Returns ArgType
ColumnPos
Section titled “ColumnPos”public static ArgType ColumnPos()An x/z column position.
Returns ArgType
Component
Section titled “Component”public static ArgType Component()A text component in JSON/SNBT form (read with CommandContext.GetText).
Returns ArgType
ContextFloatProvider
Section titled “ContextFloatProvider”public static ArgType ContextFloatProvider()A float provider as the loot / worldgen data writes it (a constant, {type:"minecraft:uniform",min_inclusive:0,max_exclusive:1}, …).
Returns ArgType
ContextIntProvider
Section titled “ContextIntProvider”public static ArgType ContextIntProvider()An int provider as the loot / worldgen data writes it.
Returns ArgType
Dialog
Section titled “Dialog”public static ArgType Dialog()A dialog: an id of the dialog registry or an inline definition.
Returns ArgType
Dimension
Section titled “Dimension”public static ArgType Dimension()A dimension key.
Returns ArgType
Double
Section titled “Double”public static ArgType Double(double min = -1.7976931348623157E+308, double max = 1.7976931348623157E+308)A double-precision number, optionally limited.
Parameters
| Name | Type | Description |
|---|---|---|
min |
double = -1.7976931348623157E+308 |
|
max |
double = 1.7976931348623157E+308 |
Returns ArgType
Entities
Section titled “Entities”public static ArgType Entities()Any number of entities.
Returns ArgType
Entity
Section titled “Entity”public static ArgType Entity()Exactly one entity.
Returns ArgType
EntityAnchor
Section titled “EntityAnchor”public static ArgType EntityAnchor()An entity anchor: feet or eyes.
Returns ArgType
Feature
Section titled “Feature”public static ArgType Feature()A configured worldgen feature (an id of the worldgen/configured_feature registry).
Returns ArgType
public static ArgType Float(float min = -3.4028235E+38f, float max = 3.4028235E+38f)A single-precision number, optionally limited.
Parameters
| Name | Type | Description |
|---|---|---|
min |
float = -3.4028235E+38f |
|
max |
float = 3.4028235E+38f |
Returns ArgType
FloatRange
Section titled “FloatRange”public static ArgType FloatRange()An inclusive decimal range.
Returns ArgType
Function
Section titled “Function”public static ArgType Function()A data pack function id or tag.
Returns ArgType
GameMode
Section titled “GameMode”public static ArgType GameMode()A game mode name.
Returns ArgType
GameProfile
Section titled “GameProfile”public static ArgType GameProfile()A player profile (also offline players: names and uuids).
Returns ArgType
GreedyString
Section titled “GreedyString”public static ArgType GreedyString()The rest of the line.
Returns ArgType
Heightmap
Section titled “Heightmap”public static ArgType Heightmap()A heightmap name (world_surface, motion_blocking, …).
Returns ArgType
HexColor
Section titled “HexColor”public static ArgType HexColor()A colour as #RRGGBB.
Returns ArgType
public static ArgType Int(int min = -2147483648, int max = 2147483647)A 32-bit integer, optionally limited.
Parameters
| Name | Type | Description |
|---|---|---|
min |
int = -2147483648 |
Smallest accepted value. |
max |
int = 2147483647 |
Largest accepted value. |
Returns ArgType
IntRange
Section titled “IntRange”public static ArgType IntRange()An inclusive integer range (1..5, ..3).
Returns ArgType
public static ArgType Item()An item with components, e.g. minecraft:diamond_sword[damage=5].
Returns ArgType
ItemPredicate
Section titled “ItemPredicate”public static ArgType ItemPredicate()An item predicate.
Returns ArgType
ItemSlot
Section titled “ItemSlot”public static ArgType ItemSlot()One inventory slot name (container.5, weapon.mainhand).
Returns ArgType
ItemSlots
Section titled “ItemSlots”public static ArgType ItemSlots()A group of inventory slots (container.*).
Returns ArgType
public static ArgType Long(long min = -9223372036854775808, long max = 9223372036854775807)A 64-bit integer, optionally limited.
Parameters
| Name | Type | Description |
|---|---|---|
min |
long = -9223372036854775808 |
|
max |
long = 9223372036854775807 |
Returns ArgType
LootModifier
Section titled “LootModifier”public static ArgType LootModifier()A loot modifier.
Returns ArgType
LootPredicate
Section titled “LootPredicate”public static ArgType LootPredicate()A loot predicate.
Returns ArgType
LootTable
Section titled “LootTable”public static ArgType LootTable()A loot table.
Returns ArgType
Message
Section titled “Message”public static ArgType Message()A chat message that may contain selectors.
Returns ArgType
NbtCompound
Section titled “NbtCompound”public static ArgType NbtCompound()An SNBT compound.
Returns ArgType
NbtPath
Section titled “NbtPath”public static ArgType NbtPath()An NBT path.
Returns ArgType
NbtTag
Section titled “NbtTag”public static ArgType NbtTag()Any SNBT tag.
Returns ArgType
Objective
Section titled “Objective”public static ArgType Objective()A scoreboard objective name.
Returns ArgType
ObjectiveCriteria
Section titled “ObjectiveCriteria”public static ArgType ObjectiveCriteria()A scoreboard criterion (dummy, health, minecraft.mined:minecraft.stone).
Returns ArgType
Operation
Section titled “Operation”public static ArgType Operation()A scoreboard operation (+=, %=, ><).
Returns ArgType
Particle
Section titled “Particle”public static ArgType Particle()A particle with its parameters (minecraft:dust{color:[1,0,0],scale:1}).
Returns ArgType
Player
Section titled “Player”public static ArgType Player()One online player (name, uuid or a selector that matches exactly one player).
Returns ArgType
Players
Section titled “Players”public static ArgType Players()Any number of online players (names or selectors such as @a).
Returns ArgType
Resource
Section titled “Resource”public static ArgType Resource(string registry)An entry of a registry (“minecraft:enchantment”, “minecraft:sound_event”, …), suggested by the engine.
Parameters
| Name | Type | Description |
|---|---|---|
registry |
string |
The registry id. |
Returns ArgType
ResourceKey
Section titled “ResourceKey”public static ArgType ResourceKey(string registry)A registry key (not the entry), e.g. Arg.ResourceKey("minecraft:worldgen/biome").
Parameters
| Name | Type | Description |
|---|---|---|
registry |
string |
The registry id. |
Returns ArgType
ResourceLocation
Section titled “ResourceLocation”public static ArgType ResourceLocation()A resource location, namespace:path.
Returns ArgType
ResourceOrTag
Section titled “ResourceOrTag”public static ArgType ResourceOrTag(string registry)An entry of a registry or a #tag of it.
Parameters
| Name | Type | Description |
|---|---|---|
registry |
string |
The registry id. |
Returns ArgType
ResourceOrTagKey
Section titled “ResourceOrTagKey”public static ArgType ResourceOrTagKey(string registry)A registry key or a #tag of keys.
Parameters
| Name | Type | Description |
|---|---|---|
registry |
string |
The registry id. |
Returns ArgType
ResourceSelector
Section titled “ResourceSelector”public static ArgType ResourceSelector(string registry)A selector over the entries of a registry (*, minecraft:*, tags).
Parameters
| Name | Type | Description |
|---|---|---|
registry |
string |
The registry id. |
Returns ArgType
Rotation
Section titled “Rotation”public static ArgType Rotation()A rotation (yaw pitch).
Returns ArgType
ScoreHolder
Section titled “ScoreHolder”public static ArgType ScoreHolder(bool multiple = false)A score holder (names, selectors, *).
Parameters
| Name | Type | Description |
|---|---|---|
multiple |
bool = false |
Whether several holders are accepted. |
Returns ArgType
ScoreboardSlot
Section titled “ScoreboardSlot”public static ArgType ScoreboardSlot()A scoreboard display slot (sidebar, list, below_name, sidebar.team.red).
Returns ArgType
SlotSource
Section titled “SlotSource”public static ArgType SlotSource()A slot source of the item modifier data (minecraft:slot_source).
Returns ArgType
String
Section titled “String”public static ArgType String()A word or a quoted phrase.
Returns ArgType
public static ArgType Style()A text style in JSON/SNBT form.
Returns ArgType
SwingAnimation
Section titled “SwingAnimation”public static ArgType SwingAnimation()A swing animation type (none, stab, whack).
Returns ArgType
Swizzle
Section titled “Swizzle”public static ArgType Swizzle()A set of axes (xz, xyz).
Returns ArgType
public static ArgType Team()A team name.
Returns ArgType
TemplateMirror
Section titled “TemplateMirror”public static ArgType TemplateMirror()A structure mirror (none, left_right, front_back).
Returns ArgType
TemplateRotation
Section titled “TemplateRotation”public static ArgType TemplateRotation()A structure rotation (none, clockwise_90, 180, counterclockwise_90).
Returns ArgType
public static ArgType Time(int minTicks = 0)A duration such as 10s, 5d, 20t (parsed to ticks).
Parameters
| Name | Type | Description |
|---|---|---|
minTicks |
int = 0 |
Smallest accepted number of ticks. |
Returns ArgType
public static ArgType Uuid()A uuid (read with CommandContext.GetText).
Returns ArgType
public static ArgType Vec2()A 2D position.
Returns ArgType
public static ArgType Vec3()A position with decimals.
Returns ArgType
public static ArgType Word()A single word (letters, digits, _ - . +).
Returns ArgType
See also
Section titled “See also”ArgType · BlockPos · BlockState · Component · Entity · GameMode · NbtCompound · NbtTag · Objective · Particle · Player · Uuid