Skip to content

Arg

Namespace Mc.Scripting.Commands · Kind class (static)

public static class Arg

Factories 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.

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

public static ArgType BlockPos()

A block position (1 64 1, ~ ~1 ~, ^ ^ ^2).

Returns ArgType

public static ArgType BlockPredicate()

A block predicate (state, tag, block entity data).

Returns ArgType

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

public static ArgType ColumnPos()

An x/z column position.

Returns ArgType

public static ArgType Component()

A text component in JSON/SNBT form (read with CommandContext.GetText).

Returns ArgType

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

public static ArgType ContextIntProvider()

An int provider as the loot / worldgen data writes it.

Returns ArgType

public static ArgType Dialog()

A dialog: an id of the dialog registry or an inline definition.

Returns ArgType

public static ArgType Dimension()

A dimension key.

Returns ArgType

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

public static ArgType Entities()

Any number of entities.

Returns ArgType

public static ArgType Entity()

Exactly one entity.

Returns ArgType

public static ArgType EntityAnchor()

An entity anchor: feet or eyes.

Returns ArgType

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

public static ArgType FloatRange()

An inclusive decimal range.

Returns ArgType

public static ArgType Function()

A data pack function id or tag.

Returns ArgType

public static ArgType GameMode()

A game mode name.

Returns ArgType

public static ArgType GameProfile()

A player profile (also offline players: names and uuids).

Returns ArgType

public static ArgType GreedyString()

The rest of the line.

Returns ArgType

public static ArgType Heightmap()

A heightmap name (world_surface, motion_blocking, …).

Returns ArgType

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

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

public static ArgType ItemPredicate()

An item predicate.

Returns ArgType

public static ArgType ItemSlot()

One inventory slot name (container.5, weapon.mainhand).

Returns ArgType

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

public static ArgType LootModifier()

A loot modifier.

Returns ArgType

public static ArgType LootPredicate()

A loot predicate.

Returns ArgType

public static ArgType LootTable()

A loot table.

Returns ArgType

public static ArgType Message()

A chat message that may contain selectors.

Returns ArgType

public static ArgType NbtCompound()

An SNBT compound.

Returns ArgType

public static ArgType NbtPath()

An NBT path.

Returns ArgType

public static ArgType NbtTag()

Any SNBT tag.

Returns ArgType

public static ArgType Objective()

A scoreboard objective name.

Returns ArgType

public static ArgType ObjectiveCriteria()

A scoreboard criterion (dummy, health, minecraft.mined:minecraft.stone).

Returns ArgType

public static ArgType Operation()

A scoreboard operation (+=, %=, ><).

Returns ArgType

public static ArgType Particle()

A particle with its parameters (minecraft:dust{color:[1,0,0],scale:1}).

Returns ArgType

public static ArgType Player()

One online player (name, uuid or a selector that matches exactly one player).

Returns ArgType

public static ArgType Players()

Any number of online players (names or selectors such as @a).

Returns ArgType

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

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

public static ArgType ResourceLocation()

A resource location, namespace:path.

Returns ArgType

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

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

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

public static ArgType Rotation()

A rotation (yaw pitch).

Returns ArgType

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

public static ArgType ScoreboardSlot()

A scoreboard display slot (sidebar, list, below_name, sidebar.team.red).

Returns ArgType

public static ArgType SlotSource()

A slot source of the item modifier data (minecraft:slot_source).

Returns ArgType

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

public static ArgType SwingAnimation()

A swing animation type (none, stab, whack).

Returns ArgType

public static ArgType Swizzle()

A set of axes (xz, xyz).

Returns ArgType

public static ArgType Team()

A team name.

Returns ArgType

public static ArgType TemplateMirror()

A structure mirror (none, left_right, front_back).

Returns ArgType

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

ArgType · BlockPos · BlockState · Component · Entity · GameMode · NbtCompound · NbtTag · Objective · Particle · Player · Uuid