Skip to content

API reference Obsidian.API.Commands

CommandCoordinates class

Reads vanilla's command coordinates: absolute numbers, ~ offsets from where the command runs, or ^ offsets along the way it faces (left, up, forwards).

public static class CommandCoordinates

In Obsidian.API.

Methods

Local(VectorD, float, float, double, double, double)

public static VectorD Local(VectorD origin, float yaw, float pitch, double left, double up, double forwards);

The position left, up and forwards blocks along the directions of a rotation from origin, as vanilla's LocalCoordinates places it.

TryParse(string, CommandContext, bool, bool, VectorD)

public static bool TryParse(string input, CommandContext context, bool centerBlocks, bool wholeNumbers, out VectorD result);

Reads three coordinates separated by spaces, relative to context's CommandContext.Origin and CommandContext.Rotation.

Parameters

centerBlocks
Whether absolute whole numbers of x and z name the block's center, as vanilla's vec3 arguments do.
wholeNumbers
Whether absolute numbers must be whole, as in a block position.

On this page