Table of Contents

Class OnixCommandOrigin

Namespace
OnixRuntime.Api.OnixClient.Commands
Assembly
OnixRuntime.dll

Wraper around the origin of a command getting run. When you check IsInWorld, you can assume World, Dimension and Region are not null. When you check IsEntity, you can assume Entity, World, Dimension and Region are not null. When you check IsClientSide, you can run client specific code.

public class OnixCommandOrigin
Inheritance
OnixCommandOrigin
Inherited Members

Constructors

OnixCommandOrigin()

Creates an origin with everything null or zero, this is used when the command is run in the menu.

public OnixCommandOrigin()

OnixCommandOrigin(Entity?)

Creates a new command origin from the given entity.

public OnixCommandOrigin(Entity? entity)

Parameters

entity Entity

The entity that will be the origin of the command.

OnixCommandOrigin(Dimension?, BlockPos)

The dimension and position the command is being run at.

public OnixCommandOrigin(Dimension? dimension, BlockPos position)

Parameters

dimension Dimension

The dimension in which the command was run.

position BlockPos

The position at which the command was run.

Properties

BlockPosition

The block position of whatever ran the command, (0,0,0) if run in the menu.

public BlockPos BlockPosition { get; init; }

Property Value

BlockPos

Dimension

The dimension the command is being run in, null if not run in a world (e.g. in the menu).

public Dimension? Dimension { get; init; }

Property Value

Dimension

Entity

The entity that ran the command, null if run in the menu or by a command block.

public Entity? Entity { get; init; }

Property Value

Entity

IsClientSide

Whether this command was run on the client side. If false, it was run on the server side.

public bool IsClientSide { get; }

Property Value

bool

IsEntity

When an entity ran this, you can assume Entity, World, Dimension and Region are not null.

public bool IsEntity { get; }

Property Value

bool

IsInWorld

When something in the world ran this, you can assume World, Dimension and Region are not null.

public bool IsInWorld { get; }

Property Value

bool

Position

The exact position of whatever ran the command, (0,0,0) if run in the menu.

public Vec3 Position { get; init; }

Property Value

Vec3

Region

The region the command is being run in, null if not run in a world (e.g. in the menu).

public WorldBlocks? Region { get; init; }

Property Value

WorldBlocks

World

The world the command is being run in, null if not run in a world (e.g. in the menu).

public RuntimeWorld? World { get; init; }

Property Value

RuntimeWorld