Encyclopaedia Psionica Online

Introduction
Welcome to Psi, the greatest spell-program-based magitech mod this side of the universe!
Psi is a mod (inspired by the Mahouka series) about creating and casting Spells to do your bidding.
To begin your journey to become a spellslinging mage, you'll first need some Psidust-- however, one does not simply craft the stuff.

Instead, start by crafting a CAD Assembler and an Iron CAD Assembly.
Place the CAD Assembler, open it, and insert the Iron CAD Assembly to construct a very bare-bones Casting Assistant Device (CAD, for short).
From there, drop some Redstone Dust on the ground, point your new CAD at the dust, and cast (Right Button) to create some Psidust.


CAD Assembler
The CAD Assembler is the heart of Psi, serving two essential functions.
First, it assembles a CAD from its component parts. Second, it loads non-empty Spell Bullets into CADs (as well as other things that hold Bullets, such as Psimetal Tools).

A CAD is built from up to five components; the simplest CAD only uses one component, an Assembly, though this is only useful for crafting Psidust.
A CAD capable of casting Spells requires a Core and a Socket as well.
Adding a Battery slightly increases a user's maximum Psi energy, and adding a Colorizer changes the color of cast Spells, which is purely cosmetic.

Once a CAD is created, it can be placed in the leftmost panel of the CAD Assembler.
When placed there, the slots below open; Spell Bullets can be placed in these slots to be loaded into the CAD.
Once the Bullets are loaded, the CAD is removed and held, and the Psi master keybind (c) is held, the Bullets' Spells will be displayed on a radial menu, ready to be selected and cast.


Spell Programmer
If the CAD Assembler is the heart of Psi, then the Spell Programmer is the brains of the mod. It's where Spells are written and compiled, and eventually copied into Spell Bullets to be cast.
When placed and opened (Right Button), it displays a large 9x9 grid; see the tutorial entries for more in-depth knowledge on using this grid.


A Primer On Vectors
Psi uses the concept of a Vector extensively. Therefore, if you haven't the foggiest idea what a vector is, I strongly recommend you watch the video below.
The explanation in the next few pages is simplified for beginners. Don't take it as definitive.

In the world of Psi (and indeed in a Minecraft world), all vectors are three-dimensional. In essence, they're just lists of three coordinates: x, y, z.
The x-coordinate represents east when positive and west when negative, the y-direction up and down, and the z-direction south and north.
If this doesn't make sense yet, open the debug screen (F3) and run around, paying attention to the row labeled "XYZ:".
You'll understand.

That list of three numbers on the debug screen is, in fact, the first type of vector you'll meet: a position vector.
A position vector simply represents the location of a block, or an entity, or perhaps some empty space in the world. A single fixed location, represented by a list [x, y, z].
However, not all vectors represent positions-- and it's important to note that any three numbers in a list constitute a vector.

An interesting fact about vectors is that they're extremely easy to add.
For example, say we have a grass block at some location, which we choose to represent as [x, y, z].
If we wish to add another vector (e.g. [0, 1, 0]) to this one, all we would have to do is add corresponding numbers:
our vector sum would be [x+0, y+1, z+0], or just [x, y+1, z].

Since the y-component of our new vector has increased by one, and positive-y means up, this new vector simply represents the block above our grass block.
The vector [0, 1, 0] represents the difference in position between our original and new vector, and it's our second type of vector: an offset vector.

Offset vectors are what most spellslingers spend the majority of their time manipulating, so a mastery over them is key.
Usually, a mage starts with a single position vector, then adds, subtracts, or otherwise combines offset vectors with this position vector in order to target their desired point in the world.

It's important to note that the idea "offset" and "position" vectors is conceptual; the terms are unique to the terminology of this tablet.
Again: all Psi vectors are just lists of three numbers, and there's nothing stopping you from pretending the distinction doesn't exist.
Indeed, in some contexts outside the scope of this book, the distinction doesn't even make sense.

Offset vectors have magnitudes.
You can think of an offset vector's magnitude as its "length," or the distance between a position in the world, and that same position when the offset vector is added to it.
For example, our earlier offset vector [0, 1, 0] simply moved the position one block-length up, so it had a length, and therefore a magnitude, of 1.

Since a distance is always positive, so are vectors' magnitudes.
Consider the vector [0, -3, 0] as an example: it represents down, three blocks-- yet the total distance moved is three blocks, and the "down" bit doesn't matter.
Therefore, the magnitude of this vector is positive 3.

Almost all vectors also have directions.
An offset vector's direction is, well, the direction something would move if it followed the vector in a straight line.
For example, the direction of [0, 1, 0] is simply straight up.
The vector [1, 0, -1], on the other hand, represents one block east and one block north, so its direction is just straight ahead, due northeast.

(Most directions aren't so nice, usually looking like "36.86 degrees north of west, 22.62 degrees below the horizon.")
Note that the only vector without a direction is [0, 0, 0] (the zero vector), since you have to be going somewhere else to have a direction.
Note that the direction of a position vector is almost as meaningless as its magnitude-- most Spells don't need to know "where should I go to get away from bedrock at world spawn."

As a matter of fact, you can reconstruct any vector, given only its magnitude and direction, into a list of three numbers (which are known as the components of the vector).
For example, the direction "up" and the magnitude 1 correspond to the vector [0, 1, 0].
This isn't as surprising as it may seem: after all, if someone tells you which direction to go, and how far, you should know they want you to be.

There are several simple ways to manipulate position and offset vectors.
First, we can add a position and an offset vector to get another position vector, as we did earlier with the grass block example.
On the other hand, we can of course subtract two position vectors to get the offset vector representing the offset from one to the other:
[x, y+1, z] − [x, y, z] = [0, 1, 0].

Perhaps more interestingly, we can add two offset vectors, to get a single offset representing their combination.
Adding this offset to a position vector would be equivalent to first adding one of its components to that position vector, then adding the other.

And last, but most certainly not least, of the simple operations: we can scale a vector, by multiplying it by a number.
Note that we're multiplying it by a number, and not another vector.
If we wish to scale an vector [p, q, r] by a factor n, we simply multiply each of the vector's components by n:
n·[p, q, r] = [n·p, n·q, n·r].

This final operation relates nicely indeed to the concepts of magnitude and direction.
When you scale a vector by a number n, you: • multiply its magnitude by the absolute value of n, and • don't change its direction if n is positive, but reverse its direction if n is negative.
If n=0, then of course the resulting vector is the zero vector.

On the other hand, if we set n=-1, then we get a vector with the same magnitude (the absolute value of -1 is 1), but pointing the opposite way (since -1 is negative)!
This vector is known as the negative of the original, and when the two are added we get the zero vector.
This makes sense, since if we go in a direction, then go in the opposite direction for the same distance, our net movement is zero.

If, instead of multiplying, we divide a (nonzero) vector by its magnitude, we get a vector with magnitude 1 (since anything divided by itself is 1), but the same direction (since magnitudes are always positive).
This is an important and well-known operation, known as normalizing a vector; the vector that results (and, in fact, any vector with magnitude 1) is called a unit vector.

Unit vectors have a fixed magnitude, so they only represent direction.
Many Spell Pieces related to direction return unit vectors, like Operator: Vector Axis Raycast and Operator: Entity Look.
Indeed, there are Operators to do most of the vector operations laid out in this article, usually with self-explanatory names.

The operations and their corresponding Operators are as follows: • Negating is Operator: Vector Negate; • Normalizing is Operator: Vector Normalize; • Scaling is Operator: Vector Multiply and Operator: Vector Divide; • Taking the magnitude is Operator: Vector Magnitude; • Adding is Operator: Vector Sum; • Subtracting is Operator: Vector Subtract.

Finally: vectors are still lists of three numbers. Don't lose sight of that.
In a Spell Programmer, they can be constructed from up to three numbers with Operator: Vector Construct.
Conversely, a vector can also be broken back down into numbers with Operator: Extract X, Operator: Extract Y, and Operator: Extract Z.

Congratulations on making it through this tutorial!
Again, this is just an introduction to vectors-- I've not said anything about dot or cross products, or vector projections, for example.
But this should be more than enough to put together some quite interesting Spells already.
That's all-- now go forth and spellsling!


Tutorial (1): Writing A Spell
Congratulations on getting acquainted with your brand-new CAD!
This tablet will serve as a reference manual for this mod, but certain entries (like this one) are tutorials, introducing you to the concepts and terms of a proper spellslinger.
Don't worry, this is the longest tutorial, as it covers all the basics.

Note that many keywords in colored italicized text are links, and can be clicked on to learn more about their respective items or concepts.
To get started with Spell programming, you'll need (duh) a Spell Programmer.
Additionally, to actually execute your Spells, you'll need a better CAD than the one you have right now-- you can construct one in your CAD Assembler.

To that end, you probably want to make a Basic CAD Core and Basic CAD Socket.
You don't have to make another Assembly; you can put your current CAD in a crafting grid to revert it back to one (since it's pretty much just an Assembly anyway).
Additionally, Spells can't be cast directly out of a CAD; instead they're stored in Spell Bullets, so to get rolling you'll need a small handful of those as well.

Once all your materials are gathered, the standard workflow for Spell creation goes as follows: • Construct a Spell in the Programmer; • Copy the Spell into a Spell Bullet; • Load the Spell Bullet into your CAD using the CAD Assembler; • Hold your CAD, point, and cast.
In this tutorial and the next, we'll walk you through this process.

When you open up your Spell Programmer, you'll see a large grid-- this is where Spells are made, and where the magic happens.
Psi's programming system isn't exactly a traditional, complex one; instead, Spells are composed of simple actions, called Tricks, executed in sequence.
The whole mod centers around simply getting Tricks to do what you want them to.

Psi's Spells are all created on the Programmer's grid from Spell Pieces; you can add as many pieces of as many types to a grid as you want, though not all arrangements of Spell Pieces will produce valid Spells.
To add a piece to the grid, right-click where you want the piece to go, and select from the menu of pieces that pops up.

When selecting from the menu of Spell Pieces, you can hover over one to see its name, and click on it to place it in the grid.
Don't worry about the myriad of pieces that appear for you; you can simply type to search for specific pieces, and press Enter to place the first search result.
You can hold Shift and hover over the "?" button on the bottom-right to see the full list of shortcuts.

Start by placing the piece called Trick: Debug anywhere on the grid.
As mentioned before, Tricks like this one are the Spell Pieces responsible for interacting with the world.
This is the simplest Trick; all it does is say something in your chat. Yet Tricks can use your Psi energy to do a huge variety of things.

Select a grid piece adjacent to your Trick: Debug, and place the piece called Selector: Caster there.
Selectors are the Spell Pieces that provide information about the surrounding world to Spells.
This particular piece represents you, the eventual caster of this Spell. You'll probably use this one rather often, as it's a natural starting-point for your Spells.

Nearly all Spell Pieces need parameters, which tell the pieces what to perform their actions on.
For example, we know that Trick: Debug sends something to chat; its first parameter tells it what to say.
Parameters also have data types, or types for short, but we'll worry about those in a later tutorial.

Left-click your Trick: Debug piece; you should see a panel appear on the left-hand side with two rows. Each row should have a label and several small arrows.
These two rows represent the two parameters that Trick: Debug takes.
Ignore the row labeled "Number" for now; just know that the dot in the center means it's optional. For a Spell to function, all non-optional parameters must be filled.

Look at the arrows labeled "Target," and select the one corresponding to where you placed Selector: Caster (for example, if you placed it to the right of Trick: Debug, select the rightmost arrow that points left), so it appears that the Selector piece is pointing towards the Trick piece.

This will make the Trick use the Selector as its "Target" parameter.
We say that Trick: Debug accepts or takes Selector: Caster as its "Target" parameter.
Parameters are also known as arguments, or simply inputs.
Technical note: In programming-vocabulary there's a subtle difference in the terms, but it's beyond the scope of this tablet.

At this point, the X in the upper-left hand corner of the Programmer should have turned into a check-mark.
A check-mark means that the Spell compiled successfully (which is a compact way of saying "the Programmer made sure that all the Spell Pieces you've placed fit together correctly").

If at any time the X is present (which means that the compilation failed or errored), you can hover over it to see the problem with your Spell and correct that problem.
Once your Spell compiles successfully, it can be copied into a Spell Bullet and cast. And that's exactly what we'll do in the next tutorial!


Tutorial (2): Casting A Spell
So, you've written your first Spell! Actually casting it, though, will take a few extra steps.
First, close out your Spell Programmer, hold a Spell Bullet (which you should have prepared in the last tutorial), and use (Right Button) the bullet on the Programmer. You should hear a chime, and the bullet should rename itself to "Debug."

The bullet now contains a copy of the Spell you've written, and is ready to be loaded into your CAD.
To load a Spell Bullet into your CAD, open your CAD Assembler and insert your CAD into the leftmost slot. Some of the slots below it should open; place the bullet with the Spell you've written in one of these slots. Take your CAD back out.

$(s$(0) can hold multiple Spell Bullets, and therefore multiple Spells; the active Spell to be cast can be switched on-the-fly.
To select a Spell to cast, hold your CAD in either hand and hold down the Psi master keybind (c).
A radial menu should appear; hover over the Spell labeled "Debug" (the one you just wrote) and release the key to select it.

When you cast the Spell (Right Button), you should see displayed in chat a long block of text that includes your username and coordinates. If so: congratulations! You've managed to write and cast your first Spell!
If you need to craft more Psidust, re-open the radial menu and select a slot without a Spell stored, then cast at Redstone Dust as you normally would.

A sidenote: you should carry only one CAD at a time.
If more than one is carried, their channeled Psi energies interfere, shorting out any Spells cast. This phenomenon, known as "cast jamming," is best avoided by simply keeping to one-CAD-per-mage.
Once you've successfully cast your Debug Spell, you can move on to the next tutorial.


Tutorial (3): Types & Numbers
Open up your Spell Programmer and take a look at your "Debug" Spell again.
Remember the "Number" parameter on Trick: Debug that we saw in the first tutorial? We mentioned previously that that parameter has an extra dot in the center, meaning it can be disabled. But this time, we won't disable it.

The "Number" parameter of Trick: Debug, when used, is printed as a label of sorts, so that multiple copies of Trick: Debug in a complex Spell can be differentiated.
The type of this parameter is "Number," which means that the parameter will only accept arguments that output (or return) Numbers.
The first parameter, "Target," accepts the special type "Any," which means it can accept anything.

If you hold Shift and hover over a Spell Piece, it'll tell you the types of all its parameters, as well as its output's type. For example, we can see that the Selector: Caster piece returns an Entity, which isn't a Number. So we'll need some other piece to represent one.

Choose an empty grid piece adjacent to Trick: Debug, and place the piece called Constant: Number.
If you Shift-hover over this piece, you'll see that it does return a Number (actually, it returns a Number Constant, which is a Number but more specific).
Therefore, if you left-click your Trick: Debug again and point its Number parameter at the Constant: Number, your Spell should compile.

To run your new-and-improved Debug Spell, you might believe that you need to unload the bullet, re-copy the Spell, reload the bullet, and re-select the Spell.
Luckily, your CAD comes with a shortcut: simply select your Debug Spell on your CAD and crouch and swipe (Right Button) your CAD over your Programmer, and the Spell stored in the corresponding bullet will update itself to the Programmer's version.

If you cast your Debug Spell now, you'll notice that you get the same long block of text as before, but with a bracketed zero in front: in fact, the same zero that was displayed in the Constant: Number piece when you placed it.
So the logical next question is: How do we display a number other than zero?

Well, the Constant: Number piece is special: to set its stored constant, all you have to do is select the piece and simply type a new number.
All other Spell Pieces are configured only from the left-hand parameter panel.
Technical wayside: all Number Constants count as Numbers, but plain Numbers don't count as Number Constants. Only Constant Spell Pieces return Number Constants.

Try editing the number stored in the Constant: Number, updating the Spell stored in your CAD, and re-casting. You should see that the prefixed number has, in fact, changed! Neat!

Now, here's the thing: we've hooked Trick: Debug up to two different inputs at once.
Truth be told, most Spell Pieces take two (or even three) inputs. And when it comes right down to it, your Spell's inputs might end up adjacent to one another.
That's where Connectors come in.

Connectors are simple pieces, yet powerful: They take one input, of any type, and return that same input. Thus, if a certain Spell Piece requires as input another piece that's two grid-spaces away, you can connect them with a Connector.

Of course, the true power of a Connector is that they can connect to each other: so you can of course daisy-chain them together to connect Spell Pieces from as far-away as you please.
Play around with some Connectors, and as soon as you feel comfortable with them you can move on to the next tutorial!


Tutorial (4): Move It
Okay, okay. I know what you're thinking: "This is boring. When do we start doing cool stuff?" Well... now!
Let's introduce a Trick that actually interacts with the world-- introducing: Trick: Add Motion.
This Trick takes an entity, and adds motion to it (i.e. gives it a push) in a certain direction.

Examples of entities include: you, the caster; a chicken; a zombie; a minecart; a falling sand block; an arrow; the Wither.
This Trick takes as parameters an Entity (which represents the entity to move), a Vector (the direction to push it in), and a Number Constant (how hard the Trick should push the entity).
Note: If you don't understand what the word "vector" means, this entry should serve as a good introduction.

Let's write a Spell that, when cast, simply boosts its caster forwards, using Trick: Add Motion.
As mentioned before, Selector: Caster returns an Entity (namely: you, the caster), so we can use that as the first parameter to Trick: Add Motion.
We'd like the Trick to boost you forward-- that is, in the direction you're looking. To do that, let's introduce our next piece: Operator: Entity Look.

No Operator pieces change the world around them in any way, nor do they pull information from it (with a few exceptions). Instead, they merely transform information into more useful forms.
In particular, Operator: Entity Look accepts an Entity, and returns a unit Vector: the direction the Entity is looking.
Thus, one of these, hooked up to a Selector: Caster, will return a Vector that points wherever you're looking at.

Finally, for the last parameter of Trick: Add Motion, a simple Constant: Number will do.
Let's put this Spell all together: first, open up your Spell Programmer and clear any Spell currently on it. Then, place a Trick: Add Motion near the middle of the grid.

Place a Selector: Caster directly above the Trick, an Operator: Entity Look to its right, and a Constant: Number to its left.
Fill in the number 3 for the Constant (you can tinker with this later).
Place a Connector between the Operator and the Selector, and then set up all the parameters for the Operator and Trick so the Spell compiles-- it should look something like the image on the next page.

Copy the Spell into your CAD, look straight ahead, and cast. If you get thrown forward, then congratulations! You've just finished writing your first real Spell!
Note: Casting your new Spell too many times in a row might be bad for your health. More on this in the next tutorial.


Tutorial (5): Limits
Open your Spell Programmer again, and review the Spell you wrote in the last tutorial.
When it compiled correctly, you should have seen five icons appear to the right of the grid, each with two numbers. These numerical stats define the practical limits on exactly what Spells you're able to cast.

The stats for your Add Motion Spell (assuming your constant was 2)

The first stat is Complexity, the total number of Operators, Selectors, and non-debug Tricks in the Spell.
Its maximum value is determined by the CAD Core you have installed; if a Spell's Complexity exceeds your CAD's capacity, it won't be castable.

The second is Potency, capped by your Assembly component; the approximate total power draw of all Tricks used in the Spell.
Some Tricks have a fixed Potency cost per-use. However, most Tricks that have a Number Constant-type parameter use it to determine their Potency; the higher the constant, the greater the Potency.

The third stat, Cost, is unique in that your CAD sets no limits on it. Instead, each time a Spell is cast, it consumes its Cost from your own body's Psi energy.
The first number shown is the ideal Cost of the Spell-- all CAD Assemblies have flaws that increase it.

The true Cost of casting with your CAD is the parenthesized number on the Programmer display, and the higher an Assembly's Efficiency, the closer to ideal the actual Cost of casting from your CAD becomes.

Your Psi energy regenerates at around 500 units per second, limiting the speed at which you can cast Spells.
Your current level of Psi energy can be accessed from within a Spell with Selector: Caster Energy.

Note that if you cast a Spell without enough Psi energy available (known as overdrawing), your CAD will draw the excess cost from your own health, and promptly disable itself until your Psi energy fully regenerates, for your own protection.
A Battery added to a CAD can guard against this.
Be careful-- overdrawing has consequences that are painful, and maybe even lethal!

The fourth stat displayed on the Programmer is Projection: the total number of non-debug Tricks in the Spell.
Your CAD's Core determines your maximum Projection per-Spell; too many Tricks and the Spell is uncastable.

And the fifth and final stat is Bandwidth, capped by your CAD Socket: the width or height of the Spell, measured in grid spaces-- whichever is larger.
This is, with a bit of ingenuity, one of the more interesting stats to work with; if your Spell is too big, the technique of moving some pieces around and eliminating others to pack it into a smaller space is known as compression.

There's one final limitation on Spells: no Trick can affect anything more than 32 blocks away from its Focal Point (for a plain Spell Bullet, that's just you, the caster), excepting the caster of the Spell themself.
A Spell that attempts to do so will display an error in chat, then fizzle.
When a Spell fizzles, it harmlessly disperses its stored Psi energy, and any remaining Tricks it would otherwise execute don't happen.

To clarify the earlier exception mentioned:
Certain types of Spell Bullets have Focal Points that aren't their casters-- yet in these cases, their stored Spells can still affect their casters through Selector: Caster, no matter how far away their Focal Points are.
There's one final tutorial lined up, putting most of what we've learned together, and then we'll cut you loose into the wider world of Psi. Good luck!


Tutorial (6): EXPLOSION
Do you like explosions?
Of course you do. Everyone loves explosions!
So let's make a Spell that blows up whatever you're looking at when you cast it.
What could possibly go wrong?

To write this Spell, let's start with the Trick we'll use to cause an explosion, and work backwards.
Conveniently, it's named Trick: Explode-- so open up your Spell Programmer, clear out the grid, and place a Trick: Explode near the middle.
Shift-hovering over it reveals that it accepts a Vector and a Number Constant as parameters.

The Number Constant parameter represents the explosion's power-- easy enough to fill with a Constant: Number piece.
The Vector, on the other hand, accepts the position vector of the location you want the explosion to go off at. This is what'll take a bit more effort to calculate.

Last tutorial, we used Operator: Entity Look.
However, that Operator returns a unit vector, and Trick: Explode needs a position, so feeding that piece directly into the Trick would probably not produce the results we want.
So let's introduce another Operator: namely, Operator: Entity Position.

Operator: Entity Position accepts an Entity (like the caster of the Spell), and returns that entity's position (to be more precise: for a player like you, it returns your position at eye-level).
However, we don't want to pass this directly into Trick: Explode, either-- because it would literally explode in your face when cast.

What we could do here is simply scale up the vector we got from Operator: Entity Look by a factor of, say, 10, and then add this to Operator: Entity Position's output.
When fed into Trick: Explode, this would create a Spell that, when cast, would create an explosion exactly ten blocks away from you, in the direction you're looking.

But the limitations of this Spell seem obvious: if you want to blow something up that's closer or further than ten blocks away, you'll have to do some awkward moving-around and guesstimating of distances.
Not very practical, all things considered.
Instead, let's use a smarter operator: Operator: Vector Raycast.

This Operator's function is intuitively simple; it accepts a position vector and a "ray" vector (which is just a vector to represent direction).
Its return value pretty much represents "if I stood there and looked in that direction, what position would I be looking at?", which makes it perfect for our purposes.
For more details, including what the "Max" argument does, read the page about Operator: Vector Raycast.

So! To build this Spell, let's work backwards.
If you haven't done so already, place a Constant: Number near the Trick: Explode (if you're still using the CAD you built in the first tutorial, 1.4 would be a good number to set it to).
Then, place a Operator: Vector Raycast next to the Trick as well, and hook the Trick up to the other two Spell Pieces.

Next, place an Operator: Entity Position and an Operator: Entity Look, then connect your Operator: Vector Raycast to the two.
Make sure to hook "Position" up to Entity Position and "Ray" up to Entity Look, and not the other way around, or else you'll get some odd results/errors when you cast the Spell.
Finally, place a Selector: Caster, and hook this up to the two Entity Operators.

Once your Spell compiles successfully, load it into your CAD, take careful aim at something (preferably something you don't care much about), and cast.
If that thing you're looking at explodes, take a moment to savor your newfound power.
Just, er, try not to cast it at your own two feet.

One final note: Try casting your new "Explode" Spell at something that's more than 32 blocks away (or at nothing, like the sky).
You should see no explosion, and an error should pop up in chat, telling you "Spell Target is outside maximum 32 block radius." (this limit was discussed last tutorial).
These sorts of errors popping up in chat can get rather annoying.

To fix this, simply place an Error Suppressor piece anywhere on the grid, and the resulting Spell will instead fail silently, when cast.
You might want to remove the piece when debugging, though. Errors can be useful sometimes.

This concludes this set of tutorials!
Have a read through the rest of this book for an idea of exactly what you can do with this mod. Experienced mages can do terrifying things, after all.
It's up to you to experiment with your CAD and Spell Programmer, and to create your own unique Spells.
Good luck, and welcome to the wide world of Psi!


Evaluation Order
Nearly all Tricks execute simultaneously with the Spell containing them. Nonetheless, to use flow control tricks, you'll need a basic knowledge of evaluation order; that is, the order that Spell Pieces get evaluated in.

There are three basic rules to evaluation order; they're explained in more detail in the following pages, but a brief summary follows: • When a Spell is executed, its Tricks are each evaluated (and then executed) left-to-right, then top-to-bottom; • Any Spell Piece being evaluated will evaluate all of its inputs first; • A Spell Piece is evaluated at most once per Spell execution, when its value is first required.

The first rule should be rather self-explanatory: a Trick placed higher on the grid is executed earlier than a Trick placed lower, and when two or more Tricks are in the same row, the leftmost one executes first.
Thus, the Spell shown on the next page should display "1.0", "2.0", "3.0", and "4.0" in chat, in that exact order.

The second rule is just as simple; a Spell Piece is only evaluated when its value is required.
However, notably, the converse is also true-- namely: if a Spell Piece isn't required for a Trick, directly or indirectly, it's never evaluated when the Spell executes.
Any Spell Piece that isn't connected to a Trick causes undefined behavior-- no guarantees on Spell behavior in those cases.

The third and final rule is a bit more subtle, and is best illustrated in the Spell on the next page:
A Spell Piece only evaluates once, and returns the exact same value for subsequent evaluations. Therefore, the four copies of Trick: Debug displayed will all output the same number, since the Operator: Random only gets evaluated once.
Trick: Evaluate can be used to evaluate a Spell Piece "early."


Psidust
Psidust is a material transmuted from Redstone Dust by an unfocused burst of Psi energy, and is, as such, a good conductor of said energies.
Therefore, it's a critical component in low-tier $(s$(0), since it's used in simple CAD Cores, Sockets, and Batteries, as well as all CAD Colorizers.
It's also used in Spell Bullets.

To create Psidust, first throw some Redstone Dust on the ground. Then stand nearby and cast (Right Button) with a CAD that has no Spell selected to convert the redstone into Psidust.
Psidust can also be created with any of the infusion tricks.


Psimetal
Psimetal is a material transmuted from Gold Ingots that conducts, stores, and transfers Psi energy much better than Psidust does.
In addition to being a component in more powerful CAD Cores, Sockets, and Batteries, it can be fashioned into a superior CAD Assembly. It's also used to craft Psimetal Tools and Armor, as well as Ebony & Ivory Ingots.

To create Psimetal, first drop Gold Ingots on the ground.
Then, stand nearby, and cast a Spell with Trick: Infusion (or any other infusion trick) as one of its Tricks to convert the gold into Psimetal.


Psigem
Psigems are crystals transmuted from Diamonds whose refractive properties make them extraordinarily good at conducting, transferring, and storing Psi energy.
These are used to fashion top-of-the-line CAD Cores, Sockets, and Batteries, and as essential components in Psimetal Tools and Armor.

To create a Psigem, first throw a Diamond on the ground.
Then, stand nearby, and cast a Spell with Trick: Greater Infusion (or Trick: Ebony & Ivory) as one of its tricks to convert the Diamond into a Psigem.


Ebony & Ivory
The End is much closer to a dimension of the mind than the Overworld. Therefore, its essences are much more conductive to Psi energy, which derives from the mind as well.
Trick: Ebony & Ivory can be used to capture these essences in Coal and Nether Quartz, transmuting them into Ebony Substance and Ivory Substance, respectively.

Unfortunately, as it turns out, neither Ebony nor Ivory Substance plays nicely with Overworld-y materials.
This means that fashioning them into CAD Cores, Sockets, and Batteries proves rather difficult.
We can, however, coat Psimetal Ingots with the stuff, yielding Ebony and Ivory Psimetal Ingots, respectively, which are just about stable enough to be shaped into CAD Assemblies.

To create Ebony Substance, first travel to the End, and drop Coal on the ground there.
Then, stand nearby, and cast a Spell with Trick: Ebony & Ivory as one of its Tricks to convert the Coal into Ebony Substance.

To create Ivory Substance, first travel to the End, and drop Nether Quartz on the ground there.
Then, stand nearby, and cast a Spell with Trick: Ebony & Ivory as one of its Tricks to convert the Nether Quartz into Ivory Substance.


Assemblies
The CAD Assembly is simple in structure, yet the single most important component of a CAD.
An Assembly is responsible for channeling its user's Psi energy-- it's simply a conveniently-shaped conduit for the task.
All Psi CADs are crafted from four ingots of their component material in a crafting grid, shaped in a sideways L.


The Assembly is the only CAD component that's strictly necessary in an CAD Assembler-- indeed, any CAD consisting of just an Assembly can be reverted to one in a crafting grid.
Every Assembly has a Potency: roughly, the maximum rate it can channel Psi energy at.
It also has an Efficiency, which is the percent of its user's Psi energy that it can actually use in a Spell-- a higher Efficiency is better.

The humble Iron CAD Assembly has the lowest Potency and Efficiency of any Assembly in this book.
But it's relatively cheap, and crafts Psidust as well any other CAD, so it's the go-to Assembly for beginners.

The Gold CAD Assembly boasts a higher Potency as well as a higher Efficiency than its iron counterpart-- in fact, it's the best Assembly in the book that's made from mundane materials.

The Psimetal CAD Assembly has a higher Efficiency than an Iron Assembly as well as a higher Potency than a Gold Assembly, making it versatile indeed.
Both Trick: Greater Infusion and Trick: Ebony & Ivory require a CAD with an Assembly of this caliber or higher to cast.

The Ebony Psimetal CAD Assembly is a top-tier type of Assembly.
It's slightly less efficient, but can handle more Potency, than its Ivory counterpart.

The Ivory Psimetal CAD Assembly is a top-tier type of Assembly.
It's slightly less potent, but has a greater Efficiency, than its Ebony counterpart.


Cores
A CAD's Core is essentially its CPU-- it's responsible for reading a Spell from the Socket, running calculations, and using Psi energy to create the effects of Tricks in the world.
CAD Cores are crafted with four of a Psi-conductive material placed around a central piece of dust (as a processor).

Every CAD Core has a Complexity value, which is the maximum number of computations (Selectors, Operators, non-debug Tricks) the Core can perform per-Spell.
A Core also has a Projection, which is simply the total number of non-debug Tricks it can perform at once.

Crafted from an Iron shell around a piece of Psidust, the Basic CAD Core is often the first CAD Core a mage crafts.
It's not fantastic (in particular, it can only cast one Trick at a time), but it's quite sufficient for a beginner's needs.

Substituting Psimetal for Iron around a CAD Core allows us to use a different dust component in the Core's center.
If Redstone Dust is used for the dust, we get a Overclocked CAD Core, which boasts twice the Complexity of its Basic predecessor, and thrice the Projection.

If, instead, we place a piece of Glowstone Dust within a Psimetal shell, we create a Conductive CAD Core.
This Core handles less Complexity than its Redstone Dust-based counterpart, but can handle four Tricks at once, over the Overclocked's three.

Embedding two Psigems into the recipe for a CAD Core creates serious performance benefits.
The Hyperclocked CAD Core, with Redstone Dust at its center, has double the Complexity of a Conductive core and double the Projection of an Overclocked one.

If we use Psigems in a CAD Core with Glowstone Dust at its center, we get a Radiative CAD Core.
This Core has a lesser Projection than the Hyperclocked one, but has the capability to execute a staggering seven Tricks per-cast.


Sockets
A CAD's Socket is basically its bullet clip.
It's what Spell Bullets are loaded into, and it's responsible for transferring the compiled Spells contained within the Bullets to the Core for processing.
Sockets are crafted with a piece of dust, which interfaces with the Bullets, on a metallic substrate.

A Socket has a Bandwidth, which is the maximum size (in grid spaces) of a Spell that it can transfer to a Core, all at once-- for example, a Socket with bandwidth 5 could transfer a Spell up to 5x5 in dimension.
It also has, well, a number of Sockets, which are compartments that can hold one Spell Bullet each.

The Basic CAD Socket is the simplest of Sockets, crafted from Psidust on a substrate of Iron.
It holds up to four Spell Bullets at a time, and can transfer Spells up to 5x5 in size.

Replacing the Iron substrate in a Socket with a metal that's more conductive to Psi energy (i.e. Psimetal) allows us to choose a different dust to interface with the Spell Bullets.
Using Redstone Dust gets us a Signaling CAD Socket, which holds up to six Bullets, each with a Spell up to 7x7 in size.

Placing Glowstone Dust on a Psimetal substrate creates a Large CAD Socket.
This Socket can't handle Spells as large as its Signaling counterpart can, only managing those up to 6x6 in size, but can hold up to eight Bullets at a time.

Augmenting a Socket in its recipe with a Psigem makes it transfer a lot more data, a lot faster.
A Signaling CAD Socket with such an augmentation becomes a Transmissive CAD Socket, which can hold up to ten Bullets, and can in fact handle any Spell that fits in a Spell Programmer.

A Large CAD Socket, augmented with a Psigem, becomes the imaginatively-named Huge CAD Socket.
One of these doesn't have the Bandwidth of its Transmissive counterpart (only Spells that are 8x8 or smaller), but can store up to a full dozen Spell Bullets.


Batteries
A CAD Battery is an optional attachment to a CAD, allowing it to indefinitely store a small amount of its user's Psi energy-- its Overflow represents how much.
A Battery discharges after its user's main supply of Psi energy runs out, but before the CAD taps into its user's health.

In effect, a Battery is meant to be a small safety net of stored Psi energy.
It's there so that you can overdraw a bit, without taking damage or having to wait for your Psi energy to refill.
All Batteries are crafted with a Psi energy-conductive material enclosed between an Iron and a Gold Ingot.
A Battery's current charge can be accessed from a Spell with Selector: Caster Battery.


Colorizers
A CAD Colorizer is an optional attachment to a CAD that modifies the color of its user's Psi energy as it manifests in the physical world.
All Colorizers are crafted with a base of an Iron Ingot, a piece of Psidust on top, two pieces of Glass (one on either side), and of course a color item to apply in the center.

A Colorizer can be crafted with any of the sixteen vanilla Dyes for their respective colors.
If Prismarine Crystals are used in place of a dye, the resulting Colorizer will shift through the colors of the rainbow.
If, on the other hand, no color item is used, the resulting Colorizer will draw color out of the user's Psi energy, and the resulting particles will be nigh-invisible.

Using a piece of Psidust as the color item in the Colorizer seems to have no known effect for most people, though certain individuals have reported differently.
A Colorizer in a CAD affects: • particles emitted by the CAD; • projectiles and Spell Circles cast; • blocks and lights conjured by the conjuration tricks.


Spell Bullet Types
A Spell Bullet is a simple device-- when inserted into a CAD's Socket, it simply provides its contained Spell's data (and metadata) to the CAD.
But Bullets come in several types, each with their own merits.
Each entry linked on the next page has more detailed information on that type of Bullet.

If you want a specific type of Spell Bullet, here you go.

Every type of Spell Bullet is crafted with an Iron Ingot and a piece of Psidust, horizontally placed in a crafting grid.
If nothing else is added to the recipe, this yields the most basic type of Spell Bullet, (somewhat confusingly) just called the Spell Bullet.
Other types of Spell Bullet require one more ingredient, placed horizontally adjacent to the Iron Ingot.

The ingredients for other types of Spell Bullets are as follows: • a Projectile Spell Bullet needs some kind of Arrow, • a Loopcast Spell Bullet needs a piece of String, • a Circle Spell Bullet needs, well, something circular (a Snowball or a Slimeball), • a Grenade Spell Bullet needs a piece of Gunpowder, • a Charge Spell Bullet needs a piece of Redstone Dust, and • a Mine Spell Bullet needs some kind of Button.

Before a Spell Bullet can be loaded into a CAD, it needs to have a Spell stored on it.
To store a Spell on a Spell Programmer in a Bullet, just swipe the Spell Bullet over the Programmer (Right Button).
A Spell stored in a Spell Bullet can be copied into an empty Spell Drive in a crafting grid for storage purposes.

A Spell Programmer displays a Cost for any Spell it compiles successfully-- yet for different types of Bullets, this Cost can be different.
The Programmer's value is calibrated to the most basic type of Spell Bullet, (somewhat confusingly) just called the Spell Bullet.

All other types of Spell Bullet display a Cost Multiplier in percentage, which can simply be multiplied by the cost displayed on the Programmer to determine the Spell's true Cost for that Bullet type.
For example, if a Spell displays a final cost of 300 in a Programmer, when copied into a Projectile Spell Bullet (with a Cost Multiplier of 102%) it would have a true Cost of
300 × 102% = 306 Psi energy per cast.

Many Spell Bullet types introduce a delay between when the Spell is cast, and when it actually gets executed.
Thus, it's important to note that the Cost of a Spell being cast is paid upfront in full, and is non-refundable-- even if the Tricks in the Spell don't actually get cast.

Every Spell, when cast, has a Focal Point.
A Focal Point is where the caster's Psi energy is projected into the world (as one or more Tricks).
Of course, a Focal Point can't execute any Tricks or evaluate any Selectors from further than 32 blocks away (excepting those that affect its caster).
A Spell can access its Focal Point using Selector: Focal Point.

The location of a Focal Point depends on the type of Spell Bullet it's cast from.
The basic Spell Bullet's Focal Point is simply the caster of the Spell, but other types of Spell Bullet can create different Focal Points.
For example, a Projectile Spell Bullet's Focal Point is the projectile itself.
For more info on each Bullet type's Focal Points and quirks, consult individual entries.


Spell Bullet
The simplest type of Spell Bullet (and the namesake of the line of items), the humble Spell Bullet stores a Spell that's ready for execution.
When loaded into a CAD by way of a CAD Assembler, it allows the CAD to cast the Spell stored within.

Selecting the Spell Bullet from the CAD and pressing Right Button will immediately execute the Spell stored within. The Focal Point for this type of Bullet is just the caster.
Other, more advanced Spell Bullets can do interesting things, though! Check out the list for more info.


Projectile Spell Bullet
A Spell cast from a Projectile Spell Bullet doesn't execute immediately.
Instead, a fast-moving Spell Projectile containing it is fired out the end of the CAD from which it's cast.
This projectile acts as the Focal Point for its Spell, executing it when the projectile collides with something.

A Spell Projectile isn't physical; instead, it's a thin wrapper of Psi energy around its contained Spell (hence the extra cost in the Bullet).
As such, it can last for up to thirty seconds before dissipating.
A Spell Projectile moves quite swiftly, and can travel more than 200 blocks' distance without assistance in its lifespan.

The projectile's stored Spell will activate if it collides with any blocks or entities.
In the case of the latter, Selector: Attack Target can be used to identify the entity that was hit.
On the other hand, if the projectile hits nothing in that time, the Spell will fizzle, wasting the Psi energy invested into it-- so aim carefully!


Loopcast Spell Bullet
A Spell cast from a Loopcast Spell Bullet is executed as if from a plain Spell Bullet.
Repeatedly.
A Spell cast from one of these Bullets is executed over and over nonstop, four times a second, until the CAD it was cast from stops being held in the same hand, or a different Spell is selected.

The Focal Point for a Spell cast from a Loopcast Spell Bullet is just the caster, and the full Psi energy cost is incurred on each execution.
The major advantage of using one of these Bullets over just casting repeatedly really fast lies in the regeneration of your Psi energy.

When you cast a Spell (or when you take damage), your Psi energy is momentarily left in a state of disequilibrium; it can't regenerate until you can focus inward and restabilize it.
While not difficult, this restabilization takes a bit of time to achieve.
But when you cast from a Loopcast Spell Bullet, this delay only occurs initially-- afterwards, the Bullet makes no disruptions in your Psi energy, allowing it to regenerate as normal.

A Spell cast from one of these Bullets can do different things on each invocation.
Specifically, Selector: Loopcast Index returns the number of times the Spell has been executed since you first cast it.
Thus, it returns 1 the first time the Spell executes, 2 the second time, and so on.

When used with Operator: Integer Divide and Operator: Modulus, these Bullets can perform operations en masse over wide areas with ease.


Circle Spell Bullet
A Spell cast from a Circle Spell Bullet is executed consecutively exactly twenty times.
When the Spell is first cast, a Spell Circle is conjured at the point the caster is looking at, which acts as the Focal Point for the Spell. This circle executes the Spell four times a second until it runs out of Psi energy, five seconds later.

A Spell Circle, when first cast, is conjured up to 32 blocks away from the caster's position or at the nearest block they look at (whichever is closer).
Similarly to a Loopcast Spell Bullet, a Spell cast from a Spell Circle can know which iteration it's on using Selector: Loopcast Index (which will return a number from 1 to 20, inclusive).

A Spell Circle drains all the Psi energy it needs when it's first cast, hence its Cost Multiplier of a whopping 1500%.
However, its voracious Cost is not without benefit; its compact, self-contained design makes it extremely efficient, allowing it to execute a Spell 20 times for the cost of 15.
For those of you keeping track, that's a full 25% discount per-execution.

Circle Spell Bullets are popular among spellslingers new and experienced both for their versatility and their conservation of Psi energy.
As such, there are several relatively common Tricks used with Circle Spell Bullets in particular that aren't seen elsewhere.

The Circlesync idiom, relatively simple to build, allows all twenty executions of the Spell to happen at once, allowing them to accumulate into a much grander effect than a single execution would alone.
The 20-Bit Tower idiom has a slightly more difficult setup involving a Vector Ruler; but allows a Spell to only do something on a subset of its twenty executions.

The Circlesync idiom (pictured at right) uses Trick: Sleep at its core.
When placed in the Spell, it delays each execution corresponding exactly to the time left until the final Trick activates.
Any Tricks placed after the Trick: Sleep, then, execute simultaneously.

The 20-Bit Tower idiom is a rather advanced technique, rather technical in design.
To use it, select a block with a Vector Ruler, then place some blocks (it doesn't matter what kind) in the twenty-block-high vertical space directly above the location you selected, then copy the code on the following page to the top of your Spell.

Each block position in that vertical space represents one execution of the Spell; the bottommost location of the tower represents the first execution, the next location the second, and so on.
An empty space in a tower represents "DO execute on that iteration," and a block in that position tells the Spell "DON'T."
Finally, copy the code on the next page to the top of your Spell.


Grenade Spell Bullet
A Spell cast from a Grenade Spell Bullet, instead of executing immediately, is fired out the end of the CAD it was cast as a Spell Grenade.
Unlike a Spell Projectile, though, a grenade is affected by gravity.
It executes its contained Spell after exactly three seconds, no sooner and no later.

A Spell Grenade is an intangible thin wrapper of Psi energy, created from the excess drawn by the Grenade Spell Bullet.
The conjured grenade also acts as the Focal Point for the Spell when it executes.
While its uses appear rather limited at first, a Spell Grenade can reach places a Spell Projectile can't (e.g. over a wall, or inside a hole).

A Spell Grenade will record the last entity it comes into contact with.
When its contained Spell executes, this entity can be accessed from Selector: Attack Target, if applicable.


Charge Spell Bullet
A Spell cast from a Charge Spell Bullet, rather than executing immediately, is fired out the end of the CAD it's cast from in a Spell Charge, which obeys gravity just like a Spell Grenade.
However, unlike a Spell Grenade, a Spell Charge can last up to five minutes, and only executes its Spell when specially told to do so by a Spell Detonator.

A Spell Charge is a stable shell of Psi energy around its contained Spell, acting as the Spell's Focal Point when executed.
If the Spell Charge is never activated within its lifetime, it simply dissipates, fizzling the Spell within and wasting the invested Psi energy.

However, many Spell Charges in close proximity can all be activated at once by a single Spell Detonator (or Trick: Detonate), making them quite useful for mass effect.
A Spell Charge will record the last entity it bumps into (or, as may occur, the last entity to step on it).
When its contained Spell executes, this entity can be accessed from Selector: Attack Target, if applicable.


Mine Spell Bullet
A Spell cast from a Mine Spell Bullet is fired out of the CAD it was cast in a Spell Mine.
A Spell Mine obeys gravity and has a five-minute lifespan. It only executes its stored Spell once stepped on by someone (or something).

A Spell Mine's conditions for execution are rather finicky; a mine begins by staying on the ground and waiting to be stepped on.
When one or more entities step on it, the mine doesn't trigger right away; instead it merely primes itself.
When it's primed and there are no longer any entities atop it, then and only then will it execute its contained Spell.

The entity that triggered the Spell (i.e. the last entity to step off the Spell Mine) is accessible from Selector: Attack Target.
However, if a Spell Mine's activation conditions are never met within its lifetime, the mine will simply dissipate, fizzling its stored energy.
So if you end up landing on a Spell Mine, waiting it out might just be preferable to knowing what the caster has in store for you.


Spell Detonator
A Spell Detonator is crafted from two Iron Ingots, Psidust, and a Button.
It serves exactly one function: when it's actuated (Right Button), it activates every single Spell Charge (and Exosuit Detonation Sensor) cast by you in a 32-block radius, instructing them to simultaneously execute their contained Spells.


Psimetal Exosuit
A Psimetal Exosuit is a suit of armor allowing you to seamlessly integrate Spell-casting into your everyday adventuring!
Each piece of the Exosuit is crafted from two Psigems and some Psimetal, and is capable of casting a Spell when its respective trigger is activated.

The suits' Spells are cast with your CAD as a focus, so the usual CAD limits apply.
Each piece of the Psimetal Exosuit can be loaded with up to three Spell Bullets in a CAD Assembler, though sadly, some Spell Bullet variants don't play well with the suit.
A suit piece remembers the number of times it's successfully cast a Spell; this count can be accessed from Selector: Success Counter.

To select which Spell to use for a suit piece, craft an Exosuit Controller from Redstone Dust, Glass, and Psimetal. To use the Controller, hold it and press the Psi master keybind (c).
Use the right and left-mouse buttons to cycle through suit pieces.

Once you've selected the suit piece you want to configure, choose one of the Spell Bullets that's displayed the same way you would with your CAD.
Selecting the empty fourth slot disables that suit piece completely-- no Spells will be cast even if its activation criteria are met.

A Psimetal Exosuit is slightly better than Iron Armor in strength and durability.
All pieces of a suit will draw from their wearer's excess Psi energy to repair damage to themselves, a feat made possible by the Psigems used in their construction.

The Psimetal Exosuit Helmet is the most configurable of the bunch, casting its designated Spell whenever its contained Exosuit Sensor triggers.
A Sensor attaches to and detaches from a Helmet in a crafting grid; a Helmet can only have one Exosuit Sensor attached at a time.

The Psimetal Exosuit Chestplate casts its selected Spell whenever its user takes any form of damage.
Selector: Attacker and Selector: Damage Taken can be used to identify the source and amount of damage, respectively.

Psimetal Exosuit Leggings never stop casting their selected Spell.
In fact, they do so once per CAD tick, which is a unit of time equal to 0.05 seconds.
They're quite popular as "better Loopcast Spell Bullets."

Psimetal Exosuit Boots simply cast their designated Spell when their wearer jumps off the ground.
No more, no less.


Exosuit Sensors
Exosuit Sensors are small devices designed to be embedded into larger pieces of armor (e.g. the Psimetal Exosuit Helmet), and to signal their containing armor when triggered.
Each Sensor has a different condition for what triggers it.

All Sensors are crafted from two Iron Ingots and two of Psimetal around a reagent; the reagent used determines the resulting Sensor's effect: • the Light Sensor uses Glowstone Dust; • the Heat Sensor uses a Fire Charge; • the Stress Sensor uses a slice of Glistering Melon; • the Water Sensor uses Prismarine Crystals; • the Detonation Sensor uses Gunpowder.

The Exosuit Light Sensor triggers once whenever its wearer moves into a dark area (i.e. an area that's dark enough to spawn monsters) from a non-dark area.
It can be manually triggered in a dark area with a Trick: Conjure Light on a timer.

The Exosuit Heat Sensor triggers whenever its wearer catches fire.
Trick: Fire Resistance or Trick: Torrent are good responses to this Sensor triggering, unless you really know what you're doing.

The Exosuit Stress Sensor triggers when its wearer is low on health (specifically, if the wearer is at three hearts or less).
Trick: Regeneration might be a good response to this issue.

The Exosuit Water Sensor triggers when its wearer touches water.
With a bit of ingenuity, it can be triggered manually via Trick: Torrent.

The Exosuit Detonation Sensor triggers whenever a Spell Detonator is actuated within a 32-block radius, or when a Trick: Detonate is cast in the same area.


Psimetal Tools
The Psimetal Tools are a set of tools, comparable to Diamond-tier in quality, each of which can cast a Spell each time it performs its intended action.
All Psimetal Tools are crafted with Iron Ingots in place of Sticks, one Psigem, and some Psimetal.

A Psimetal Tool can be loaded with up to three Spell Bullets in a CAD Assembler (though some Spell Bullets don't play well with the tools).
To select the Spell Bullet to use for a tool, hold the Psi master keybind (c) and select from the menu as usual.
Picking an empty slot from the menu disables the tool from casting entirely.

All Psimetal Tools except the Psimetal Sword cast their selected Spell once each time they break a block.
The Sword instead casts each time it hits a living being (though it should be noted for strategic purposes that once damaged, a living thing is invulnerable for half a second).
Psimetal Tools will draw from their wielder's excess Psi energy to repair themselves.

Psimetal Tools also get some convenient integration with Spell Pieces.
When the Psimetal Sword casts a Spell, Selector: Attack Target returns the mob you whacked to do so.
When one of the other Tools breaks a block, Selector: Block Broken returns the position of the broken block, and Selector: Block Broken Side returns the axial vector corresponding to the direction the block was broken from.


Vector Ruler
A Vector Ruler can store an arbitrary vector, which can then be accessed from within a Spell at your convenience.
It's made from Iron Ingots and a tip of Psidust.

Tapping a Ruler on a block (Right Button) while crouching stores that block's position in the Ruler as a vector.
Once a block's position is stored, tapping the Ruler without crouching on another block will store the offset between the two blocks.
A Ruler's stored vector can be accessed with Selector: Vector Ruler.

If you happen to be carrying several Rulers at a time, Selector: Vector Ruler will return the stored value of the leftmost Ruler in your hotbar, or the highest Ruler in your inventory if your hotbar has none.


Spell Drive
A Spell Drive, crafted from two ingots of Psimetal and a piece of Redstone Dust, can store a single Spell for later use.
To store a Spell in a Spell Programmer onto a Drive, crouch and swipe (Right Button) an empty Drive over it.
To copy a Spell back, crouch-swipe a Drive with a Spell stored over the Programmer.

To clear a stored Spell, crouch-swipe the Drive over any other block.
A Drive with a stored Spell can be placed in a crafting grid with an empty Drive or Spell Bullet to copy its Spell onto the latter.


Vectors 101
The manipulation of vectors is an essential component to Spell programming. Most vector operations are outlined here; the only missing piece is Operator: Vector Cross Product.

The cross product of two vectors is a vector that is perpendicular to both. You can make use of this to get a vector that points to your side, by taking the cross product of the player's look vector and [0, 1, 0] (which you can create with Operator: Vector Construct).


Entities 101
The manipulation of entities is an essential component to Spell programming. The most obvious entity to manipulate is you, the caster, via Selector: Caster. Other pieces, however, allow you to target other entities in the world.
You can make use of those pieces to create Spells that affect other entities. Try using them with Trick: Add Motion to fling around others.


Blockworks
Working with blocks is an essential skill for a mage. You can, of course, refer to a block's position via a vector, so knowledge of vectors is important to understand how to work with blocks.
Two of the most basic block pieces in this group are Trick: Place Block and Trick: Break Block.

These both take a position vector, and respectively place and break a block at that position. Trick: Place Block uses the block to the right of your CAD in your hotbar for placing. Knowing the block position to break is easy; Operator: Vector Raycast suffices.

However, placing a block is trickier: Operator: Vector Raycast gives us the block the player is looking at. We can't place a block there-- there already is one! To remedy that, we can combine our Operator: Vector Raycast with the Operator: Vector Axis Raycast piece, which gives us a vector representing the side of the block we're looking at.

For example, if we're looking at the top of the block, it'll give us the axial vector [0, 1, 0]. We can use Operator: Vector Sum to add it to our plain Raycast to tell us where our block will go!
Operator: Entity Axial Look is similar to Operator: Entity Look, but returns a value snapped to one of the six axial vectors (e.g. if you're looking east, it returns [1, 0, 0]). Think of the "Facing" value in your F3 menu.

The other two Tricks available here are Trick: Place Block Sequence and Trick: Break Block Sequence. These Tricks break or place a line of blocks. Similarly to the standard break and place Tricks, they require a position to start off, but they also require another Vector, "Target", that defines the direction to operate in. So if "Target" is [0, 1, 0], it'll place or break blocks starting from the value of "Position" upwards.

The last component to these Tricks is "Max", this is a number constant for the maximum amount of blocks the Trick is allowed to break or place. Since the vector requirements aren't constant, this works as means of calculating the Potency and Cost of the Trick. The higher you set it, the more the Spell will cost.
The last piece in this group is Operator: Vector Project.

Vector Projection is a somewhat complex topic, so we'll only explain a potential uses for it below.
Say you want to make a Spell that places blocks from your position in the world to the position you're looking at, but in a straight line aligned to the side of the block you're looking at (using Operator: Vector Axis Raycast).

You start off by finding the vector that you want to place blocks along, so you can plug it into Trick: Place Block Sequence. If you're diagonal to the block, though, you may get something like [3, 2, 4]. That's not a straight line! We can use Operator: Vector Project to project that into the axis of the side you're looking at, say, [0, 0, 1].

So our "Vector A" is [3, 2, 4] and our "Vector B" is [0, 0, 1]. Applying the projection leaves us with [0, 0, 4]. If our "Vector B", was, for example, [1, 0, 0], we'd get [3, 0, 0]. In general, when an axial vector is used for "Vector B", Operator: Vector Project strips any components of A that are 0 in B, leaving you with a straight line.
To put it all together, try making a Spell that brings down an 8 block high column, so you can "treecapitate"!


Movement Advances
The basics of movement Tricks were covered when we talked about Trick: Add Motion. This group has pieces that improve on that idea.
Trick: Blink simply teleports the target entity forwards in the direction they're looking in. A negative value will teleport the entity backwards.

Trick: Mass Blink does the same as Trick: Blink, but accepts an Entity List instead; each entity in the list is individually affected by the Trick.
Trick: Mass Add Motion is similar; it's the Entity List version of Trick: Add Motion.
Finally, Trick: Mass Exodus pulls every entity in an Entity List towards a given position, at the given speed. A negative speed will push them away instead.


Block Movement
The ability to move blocks isn't as important as the ability to break and place them, but happens to be quite useful nonetheless.
Trick: Move Block takes a position for a block in the world and moves it in the target vector's direction, as if it were pushed by a piston. The target vector must be axial; if it isn't, the Trick will fail.

On the other hand, Trick: Collapse Block causes a block to fall as if it were sand or gravel.
Both these Tricks will fail to execute on complex blocks (those known as Tile Entities) and blocks that can't be harvested with Silk Touch.


Elemental Arts
What's a magic system without the ability to cast elemental Spells?
This group contains Tricks for the four elements; for example, Trick: Smite summons a lightning bolt at the position it's told to.

The group also contains Operator: Random, a piece that will generate a random number between 0 (inclusive) and the number passed in (exclusive). This can be used alongside Loopcast or Spell Circle Spells in many ways. For example, one can create a Spell that would use Trick: Overgrow to mass bone meal a plantation.


Positive Effects
The ability to apply magical effects to things and people is a must-have feature of any magical lexicon worth its weight. We're not writing Spells from a spellbook, but you can apply effects to entities anyway.
All of the pieces in this group will apply their respective potion effect to the target entity, for the given time (in seconds).

If the piece also has a Power parameter, it represents the level of the effect to apply.
For example, Trick: Speed with Time 20 and Power 2 would apply a Speed II effect for 20 seconds to the target entity.


Negative Effects
As one might expect, with Positive Effects come Negative Effects.
There isn't much to say here, really. All tricks in this group do exactly what they say on the tin.
Have fun.


Trigonometry
This group includes Operators relevant to trigonometric functions. Constant: Pi is exactly what it says on the tin, a constant that gives you the value of π=3.1415….
This group includes elementary trigonometric operations as well: the sine and cosine functions, as well as their inverses (arcsine and arccosine).

Additionally, Operator: Vector Dot Product returns the dot product of two vectors: the product of the two vectors' magnitudes times the cosine of the angle between them. Using Operator: Arc Cosine on the result will allow you to get the angle between two vectors.


Smeltery
The pieces in this group are function quite simply; they all smelt things into other things as if they had been put in a furnace.
Trick: Smelt Item will cook a single dropped item in the world into its smelted counterpart.

Trick: Smelt Block will smelt a block in the world into its smelted version, provided that that smelted form's also a block.
So Cobblestone can be smelted into Stone, and then into Smooth Stone, but a log won't smelt into Charcoal.


Flow Control
Flow Control is a somewhat complex subject. All the pieces here included allow a Spell to function in wildly different ways. However, understanding how to properly use these pieces requires knowledge of the very internals of the spellcasting system-- have a read through this article for more information.

With that info under your belt, let's start off with Trick: Sleep. This piece causes the Spell from which it's cast to delay its execution for the number of ticks it receives. (A tick is a span of 0.05 seconds.) So if you wish to delay further processing of a Spell by half a second, you would use 10 as the "Time" parameter. Trick: Sleep does not add any Projection to your Spell, but does cost Potency.

Trick: Evaluate is a Trick that does absolutely nothing.
Yes, you heard that right. This Trick does nothing. It doesn't add to any stats on your Spell, either.
Its only practical use is to evaluate a value before a Trick: Sleep executes, allowing you to, for example, get the place an entity was before the Trick: Sleep triggered, for use later in the Spell.

Trick: Die, on the other hand, is a Flow Control piece in the proper sense of the term.
It takes a Number parameter, and if that number's absolute value lies strictly below 1 (also exclusive), it fizzles the Spell right then and there. Any other values passed to the Trick will allow the Spell to continue on as usual.
This piece doesn't cost Projection.

A very simple way to put Trick: Die to use is to couple it to Selector: Sneak Status, which conveniently returns 0 if the caster is sneaking and 1 if they're not.
Why, it's almost as if they were made to be used together!

Constant: Wrapper allows you to use pieces that return Numbers for Tricks that would otherwise require Number Constants.
As you should know by now, Number Constants fed to Tricks are used to calculate a Spell's stats (including Cost) before the Spellit's ever cast.
Since these Constants are required at compile-time, simple Numbers that get evaluated at execution-time are clearly unusable here.

Constant: Wrapper gets around this by accepting two Numbers, a Constant and a non-Constant.
The Constant passed to the piece will be the one used for Spell compilation calculations; but the non-Constant number will be the one used when the Spell is actually executed.
The non-Constant Number's value will be capped at the value of the Constant during Spell execution, to prevent tomfoolery.

The execution-time Number has its sign changed to the sign of the Number Constant, so that the signs of both numbers match. If the Constant Number is 0, Constant: Wrapper always returns 0, regardless of input.


Block Conjuration
This group includes pieces that do exactly as advertised: they conjure blocks.
Trick: Conjure Block creates a Conjured Block, a semi-transparent solid block, at the given position. Conjured Blocks, if conjured with a "Time" parameter, can quietly break themselves after the specified time has elapsed.

If the "Time" parameter is used, it's specified in ticks (units of 0.05 seconds). Thus, if you want to make a block that disappears after half a second, set the "Time" parameter to 10 ticks.
Trick: Conjure Light conjures a light source instead, one that can't be collided against.

Trick: Conjure Block Sequence functions much like Trick: Place Block Sequence, but creates Conjured Blocks instead. Both these pieces also include a "Time" parameter.
Conjured Blocks are fragile, and will break instantly to any tool a player cares to swing at them.


Eidos Manpulation
Eidos Tricks allow their caster to manipulate the space-time continuum in their favor.
Trick: Eidos Reversal causes its caster to retrace their steps in reverse, at double speed, for the amount of time (in seconds) specified.

Only one Eidos Reversal may be active at a time, and after a Reversal is cast, any subsequent Reversals can only reverse to the place where the last one ended. Sneaking will stop an ongoing Reversal.
The other Trick piece of the group, Trick: Eidos Anchor creates an "anchor" for the caster.

After the specified amount of time (in seconds), the caster will be warped back to their anchor's location. Multiple executions of Trick: Eidos Anchor can happen in quick succession, but only the last created anchor will activate.

Finally, Selector: Eidos Changelog takes a single number parameter (let's call it n), and gives you the position in the n'th index of the Eidos Changelog starting from the end. In other words, it gives you a position vector to where you were n ticks ago.
Trick: Eidos Reversal takes you backwards in the changelog, wiping out any locations that occur "afterward." Trick: Eidos Anchor does not modify the changelog.


Detection & Focus
This group includes two types of pieces, as the title says: detection, and focus. To understand this, the concept of Slot Focus must be introduced.

An already known example of Slot Focus is the family of Place Block style Tricks. These make use of the block directly to the right of your CAD. Slot Focus is the slot which Tricks like these will use. It can be relative (to the position of your CAD) or absolute, can only be in the hotbar and goes from 1 to 9.

By default, whenever a Spell is cast, its value is "Relative 1", so it's 1 slot to the right of your CAD. If it was "Relative -1" it would be 1 slot to the left of your CAD. "Absolute 3" would be the third slot in your hotbar. It also loops around, so if you have your CAD on your last slot and the value is "Relative 1", it'll be your first slot.

To set the focused slot, you can use Trick: Switch Focus Slot. This takes one of 2 parameters. Both are optional and mutually exclusive, and if you don't define any, it'll set the focus to the default of "Relative 1". If you choose to set the "Position" parameter, it'll set an Absolute value, whereas the "Shift" parameter will set a Relative value.

This allows you to, for example, build things with different blocks based on the circumstance. This Trick only works for the current Spell cast, and the focus will reset the next time a Spell is cast (even if it's the same Spell).
The other two pieces in the group are set in the "detection" area.

First, Selector: Item Presence takes an optional slot number (if not set it'll default to your Focused Slot), and returns the amount of items in that slot, 0 if it's empty, of course.

Lastly, Selector: Block Presence takes a vector, to be used as coordinates in the world, and finds the block there, the value returned is 0 if there's no block or a replaceable block (like tall grass), 1 if it's a non-solid block and 2 if it's a solid block.


Memory Management
This group introduces the ability for a Spell to store information persistently inside a CAD. A CAD can save vectors to be retrieved in future Spell executions. A CAD can store one vector for every three Socket slots it has.

The number of vectors a CAD can store is known as the number of Memory Slots it has.
This piece group includes two Spell Pieces, which can save and load vectors to and from a CAD's Memory Slots.
Trick: Save Vector saves a vector to a designated Memory Slot, whereas Selector: Saved Vector retrieves the vector saved in the designated Memory Slot.

A CAD's Memory Slots are numbered starting from 1, so a CAD with 3 memory slots can save to slots 1, 2, and 3.
Both Tricks in this group add Potency to Spells they're used in equal to the number of the slot used.
For example, saving to or loading from slot 2 costs two Potency.

Trick: Save Vector has an imperfection: it "locks" the Memory Slot it saves to.
This prevents either of the two pieces from interacting with that same Memory Slot later in the Spell.
So if you need to load the value saved in a slot before you save something new to it, remember the rules of Flow Control to ensure the load happens before the save.


Secondary Operators
As its name implies, this group is composed of mathematical Operators that aren't quite as important as the "primary" ones, like addition or subtraction. This group's just a mixed bag of all sorts of math or logic relates pieces that can be used to help with Spell creation. We'll separate the pieces in two sets to make them easier to explain.

The first set is related to raising numbers to power, including pieces like Operator: Square, Operator: Power, Operator: Square Root and even Operator: Logarithm. Most of these operate exactly how you'd expect them to.
Note that Operator: Logarithm takes an optional Base argument; if no base is passed in, it'll default to base 10.
Constant: e can also be used to get a natural logarithm.

The second set of Operators are related to logic. They're pieces that do rounding (to an integer).
Operator: Ceiling, Operator: Floor and Operator: Round round up, down, and to the closest integer, respectively.
This group also includes Operator: Min and Operator: Max. These get the smallest and largest, respectively, of their parameters.