Wizards of Lua

The Art of Spell Crafting


BlockHit - What is in Sight

The BlockHit class contains the results of a call to the entity’s scanView() function.

The BlockHit class is a subtype of the Object class and inherits all its properties and functions.

Here is an overview of the BlockHit properties:

Property Type read / write
hitVec Vec3 r
pos Vec3 r
sideHit string r

Properties

Below you find short descriptions about each of the properties and some examples about how to use them in your spells.


hitVec : Vec3

This is the exact position where the scan hit the block.


pos : Vec3

This is the position of the block that was hit by the scan.


sideHit : string

This is the name of the block’s side where the scan hit the block. This can be one of ‘down’, ‘up’, ‘south’, ‘west’, ‘north’, and ‘east’.