onyx.execute
- class onyx.execute.BaseCondition(parent, prefix)
BaseCondition -
execute if
andexecute unless
commands- Parameters
parent (Execute) – The
Execute
objectprefix (str) –
if
orunless
- block(position, value)
block - Checks if a block is of a certain type
- blocks(corner_1, corner_2, end_location, mask=False)
blocks - Checks the status of a selection of blocks
- Parameters
- Returns
The parent object
- Return type
- data(source)
data - Checks if a data path exists
- Parameters
source (DataSource) – The data source to check
- Returns
The parent object
- Return type
- entity(target)
entity - Checks if an entity exists
- predicate(predicate)
predicate - Checks if a predicate is true
- score(expression)
score - Checks if a score matches criteria
- Parameters
expression (Expression) – The expression to check. Created by using a conditional operator on a
Player
object.- Returns
The parent object
- Return type
- class onyx.execute.If(parent)
If - Provides synactic sugar for
execute if
commands- Parameters
parent (Execute) – The
Execute
object
- class onyx.execute.Unless(parent)
Unless - Provides synactic sugar for
execute unless
commands- Parameters
parent (Execute) – The
Execute
object
- class onyx.execute.BaseStore(parent, prefix)
BaseStore -
execute store result
andexecute store success
commands- Parameters
parent (Execute) – The
Execute
objectprefix (str) –
result
orsuccess
- block(source)
block - Stores data in a block
- Parameters
source (StoreTarget) – The data location to store the data in
- Returns
The parent object
- Return type
- bossbar(source)
bossbar - Stores data in a bossbar
- Parameters
source (StoreTarget) – The data location to store the data in
- Returns
The parent object
- Return type
- entity(source)
entity - Stores data in a entity
- Parameters
source (StoreTarget) – The data location to store the data in
- Returns
The parent object
- Return type
- score(target)
score - Stores data in a scoreboard player
- Parameters
source (StoreTarget) – The data location to store the data in
- Returns
The parent object
- Return type
- storage(source)
storage - Stores data in storage
- Parameters
source (StoreTarget) – The data location to store the data in
- Returns
The parent object
- Return type
- class onyx.execute.Result(parent)
Result - Provides synactic sugar for
execute store result
commands- Parameters
parent (Execute) – The
Execute
object
- class onyx.execute.Success(parent)
Success - Provides synactic sugar for
execute store success
commands- Parameters
parent (Execute) – The
Execute
object
- class onyx.execute.Store(parent)
Store - Provides synactic sugar for
execute store
commands. Only purpose is to provide a delimeter betweenexecute
andresult
or ``success`.- Parameters
parent (Execute) – The
Execute
object
- class onyx.execute.Execute(context=None)
Execute - Represents an
execute
command- Parameters
context (str, optional) – Context can be provided manually if you don’t want to construct it with method chaining. Do not include the
execute
keyword. Example:"if entity @s"
. Defaults to None.
- run(command)
run - Runs a command in the context specified by the
Execute
object- Parameters
command (Union[Function, str]) – The command to be run
- Returns
Returns an execute command. Does not return
self
as no more method chaining should be done after this.- Return type
str
- align(axes)
align - Aligns on the specified axes
- Parameters
axes (Union[axis, tuple]) – The axes to align the command on. You can specify a single axis, or multiple axes in a list or tuple.
- Returns
The current object
- Return type
self
- anchored(anchor)
anchored - Anchors on the eyes or feet of an entity
- Parameters
anchor (anchor) – The anchor to be used
- Returns
The current object
- Return type
self
- as_(targets)
as_ - Executes as the specified entity/entities
- Parameters
targets (Selector) – The entity/entities to execute as
- Returns
The current object
- Return type
self
- at(targets)
at - Executes at the specified entity/entities
- Parameters
targets (Selector) – The entity/entities to execute at
- Returns
The current object
- Return type
self
- as_at(targets)
as_at - Executes as AND at the specified entity/entities. Turns into
as <entity> at @s
.- Parameters
targets (Selector) – The entity/entities to execute as and at
- Returns
The current object
- Return type
self
- facing(target, anchor=anchor.eyes)
facing - Executes facing the specified entity or location
- in_(dimension)
in_ - Executes in a dimension
- Parameters
dimension (dimension) – The dimension to execute in
- Returns
The current object
- Return type
self
- positioned(position)
positioned - Changes the position of the execution context
- rotated(rotation)
rotated - Changes the rotation of the execution context
- build()
- Returns
The full execute chain as a string
- Return type
str