MC-WIKI.net
Psi WikiGuides › Psi Trick Groups: Vectors, Entities, Blocks, Elements, and Effects

Psi Trick Groups: Vectors, Entities, Blocks, Elements, and Effects

guide

Psi organizes its spell pieces into trick groups, and understanding what each group covers is the first step toward building working spells. The groups are vectors, entities, blocks, elements, and effects, and each one handles a different kind of task inside a spell.

Vectors

Vector math sits at the core of spell programming. Nearly every vector operation you need is available here, with one exception: the cross product operator.

The cross product takes two vectors and produces a third that sits at a right angle to both. A practical use is finding a vector that points off to your side. Combine the caster's look vector with the vector [0, 1, 0], which you can build using the vector construct operator, and the result is that sideways-pointing vector.

Entities

Spells often need to touch creatures, not just the caster. The caster selector targets you directly, while other pieces let you reach out to entities elsewhere in the world.

With those pieces, you can build spells that act on other creatures. Pairing them with the add motion trick, for instance, lets you send others flying.

Blocks

Blocks are a mage's bread and butter, and since a block's location can be expressed as a vector, solid vector knowledge pays off here.

The two foundational pieces are the place block trick and the break block trick. Both accept a position vector and act on the block at that spot. Placing pulls from the block sitting to the right of your CAD in the hotbar. Finding the position to break is simple: a vector raycast gives it to you.

Placing is more involved. A vector raycast returns the block you are looking at, but that spot is already occupied, so you cannot put anything there. The fix is to combine the vector raycast with the vector axis raycast operator, which returns a vector for the face of the block you are looking at. Staring at a block's top, for example, yields [0, 1, 0]. Add that to the plain raycast with the vector sum operator, and you have the position where your new block belongs.

The entity axial look operator resembles the entity look operator but snaps its result to one of the six axial directions. Looking east returns [1, 0, 0]. It is comparable to the facing value shown on the debug screen.

Two more tricks exist here: place block sequence and break block sequence. Each works along a line of blocks. Like their single-block counterparts, they need a starting position, but they also take a target vector describing the direction of operation. A target of [0, 1, 0] means the trick works upward from the position. The final parameter is max, a number capping how many blocks the trick may affect. Because the vector inputs are not fixed, max also drives the trick's potency and cost, so raising it makes the spell more expensive.

The vector project operator rounds out this group. Projection is a complex subject, so consider one use case. Suppose you want to place blocks in a straight line from yourself toward what you are looking at, aligned with the face given by the vector axis raycast operator. The vector along which you want to place might come out diagonal, such as [3, 2, 4], which is not a straight line. Projecting that vector onto the axis of the face, say [0, 0, 1], straightens it out for use in the place block sequence trick.

Elements

No magic system feels complete without elemental spells. This group holds tricks for the four elements. The smite trick, for example, calls down lightning at whatever position it receives.

The group also includes the random operator, which produces a number from 0 up to, but not including, the value you supply. Combined with loopcast or spell circle spells, it opens up many possibilities, such as a spell that uses the overgrow trick to fertilize a whole plantation at once.

Effects

Applying magical effects to creatures and objects is a staple of any respectable magical lexicon. These spells are not cast from a book, yet they can still inflict effects on entities.

Every piece in this group applies its potion effect to the target entity for a duration measured in seconds. When a piece also carries a power parameter, that parameter sets the effect's level. The speed trick with a time of 20 and a power of 2, for instance, grants Speed II for 20 seconds.

Negative Effects

Negative effects naturally accompany positive ones. There is little to explain here; every trick in this group does precisely what its name suggests.

Covers the mod’s in-game guide topics: Vectors 101 Entities 101 Blockworks psi.book.entry.elementalArts psi.book.entry.positiveEffects psi.book.entry.negativeEffects