Skip to content

Location

Namespace Mc.Scripting · Kind struct (readonly)

public readonly struct Location : IEquatable<Location>

A position with a rotation in a world.

Member Description
Location(World World, Vec3d Position, float Yaw = 0f, float Pitch = 0f) A position with a rotation in a world.
Location(World world, double x, double y, double z, float yaw = 0f, float pitch = 0f) Creates a location from coordinates.
public Location(World World, Vec3d Position, float Yaw = 0f, float Pitch = 0f)

A position with a rotation in a world.

Parameters

Name Type Description
World World The dimension.
Position Vec3d Position in blocks.
Yaw float = 0f Yaw in degrees (0 = south, 90 = west).
Pitch float = 0f Pitch in degrees (-90 = up, 90 = down).
public Location(World world, double x, double y, double z, float yaw = 0f, float pitch = 0f)

Creates a location from coordinates.

Parameters

Name Type Description
world World
x double
y double
z double
yaw float = 0f
pitch float = 0f
Member Description
BlockPos BlockPos { get; } The block containing the position.
float Pitch { get; init; } Pitch in degrees (-90 = up, 90 = down).
Vec3d Position { get; init; } Position in blocks.
World World { get; init; } The dimension.
double X { get; } X coordinate.
double Y { get; } Y coordinate.
float Yaw { get; init; } Yaw in degrees (0 = south, 90 = west).
double Z { get; } Z coordinate.
public BlockPos BlockPos { get; }

The block containing the position.

public float Pitch { get; init; }

Pitch in degrees (-90 = up, 90 = down).

public Vec3d Position { get; init; }

Position in blocks.

public World World { get; init; }

The dimension.

public double X { get; }

X coordinate.

public double Y { get; }

Y coordinate.

public float Yaw { get; init; }

Yaw in degrees (0 = south, 90 = west).

public double Z { get; }

Z coordinate.

BlockPos · Vec3d · World