-
Notifications
You must be signed in to change notification settings - Fork 0
Home
A spell is an instance of a VM executing bytecode compiled from terracotta blocks in-world representing a stack-based language. Each spell begins with a and proceeds to read blocks in a line based on the direction the caster was facing when casting the spell. Instructions are then read down the line and processed with the following meanings (Operation (Blocks) - Description of stack modification ║ Stack before 🠪 Stack after
):
…, NumberValue 🠪 …, NumberValue
…, NumberValue (2) 🠪 …, NumberValue
…, NumberValue (2) 🠪 …, NumberValue
…, NumberValue (2) 🠪 …, NumberValue
…, NumberValue (2) 🠪 …, NumberValue
…, Value 🠪 …, Value (2)
…, NumberValue (3) 🠪 …, NumberValue (3)
…, NumberValue (6) 🠪 …, NumberValue (3)
VECTOR SUBTRACT () - Subtracts the top six numbers on the stack in pairs (as if they were two 3D vectors)
…, NumberValue (6) 🠪 …, NumberValue (3)
VECTOR MULTIPLY () - Multiplies the top six numbers on the stack in pairs (as if they were two 3D vectors)
…, NumberValue (6) 🠪 …, NumberValue (3)
VECTOR DIVIDE () - Divides the top six numbers on the stack in pairs (as if they were two 3D vectors)
…, NumberValue (6) 🠪 …, NumberValue (3)
VECTOR DUPLICATE () - Duplicates the top three values on the stack, preserving order (as if it was a 3D vector)
…, NumberValue (3) 🠪 …, NumberValue (6)
RAYCAST BLOCK POSITION () - Performs a raycast given the position (second vector from top) and look (top vector) and pushes the found block position (if succeeded) to the stack, followed by a 0 for success and 1 for failure.
…, NumberValue (6) 🠪 …, NumberValue (4)
RAYCAST BLOCK SIDE () - Performs a raycast given the position (second vector from top) and look (top vector) and pushes a vector representing the side of the block looked at (if succeeded) to the stack, followed by a 0 for success and 1 for failure.
…, NumberValue (6) 🠪 …, NumberValue (4)
…, EntityValue 🠪 …, NumberValue (3)
…, EntityValue 🠪 …, NumberValue (3)
…, EntityValue 🠪 …, NumberValue (3)
ENTITY LOOKED AT () - Pushes the entity looked at by the entity on the top of the stack to the stack
…, EntityValue 🠪 …, EntityValue
… 🠪 …, EntityValue
…, NumberValue 🠪 …
…, EntityValue, NumberValue (3) 🠪 …
SPAWN ENTITY () - Summons the entity via registry name (eg, minecraft:cow
) at the specified position
…, StringValue (2), NumberValue (3) 🠪 …, EntityValue
CREATE EXPLOSION () - Creates an explosion that does not destroy blocks with size specified on the top of the stack and position beneath that
…, NumberValue (4) 🠪 …
MOVE BLOCK () - Moves the block at the second vector on the stack by the delta vector on the top of the stack
…, NumberValue (6) 🠪 …
…, EntityValue, NBTValue 🠪 …
Formatted as type (fullcircle type)
are any of the following:
- byte (NumberValue)
- short (NumberValue)
- int (NumberValue)
- long (NumberValue)
- float (NumberValue)
- double (NumberValue)
- string (StringValue)
- nbt (NBTValue)
… 🠪 …, NBTValue
NBT GET () - Gets a value from a NBT tag and pushes it to the stack. Uses .
to indicate nested NBT, such as Item.Count
for {Item:{Count:1b}}
…, NBTValue, StringValue 🠪 …, Value
NBT SET () - Sets a value on a NBT tag of the given type, keeping the NBT tag on the stack. Uses .
to indicate nested NBT, such as Item.Count
for {Item:{Count:1b}}
…, NBTValue, StringValue (value location), StringValue (value type), Value 🠪 …, NBTValue
… 🠪 …, NumberValue
… 🠪 …, NumberValue
CONSTANT DOUBLE () - Pushes a floating-pointe number to the stack with the last two numbers after the decimal place
… 🠪 …, NumberValue
STRING () - Pushes a string to the stack - right click with a named piece of paper to change the string
… 🠪 …, StringValue
… 🠪 …, Value
… 🠪 …, Value (3)
…, Value 🠪 …
VECTOR STORE () - Stores the top three values of the stack into vector register and pops them from the stack
…, Value (3) 🠪 …
REDIRECTION () - Redirects execution in the direction of the arrow on the top of the block's texture.
… 🠪 …
IF () - Pops the top value on the stack and turns execution to the left if negative, continues straight if zero, and turns execution to the right if positive.
…, NumberValue 🠪 …