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
entityEntityThe 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
dimensionDimensionThe dimension in which the command was run.
positionBlockPosThe 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
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
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
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
IsEntity
public bool IsEntity { get; }
Property Value
IsInWorld
public bool IsInWorld { get; }
Property Value
Position
The exact position of whatever ran the command, (0,0,0) if run in the menu.
public Vec3 Position { get; init; }
Property Value
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
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; }