Wizards of Lua

The Art of Spell Crafting


Blocks - The Building Blocks Directory

The Blocks module provides access to all block types known in Minecraft.

Here is an overview of the Blocks functions:

Function Parameters Results
 get  name Block

Functions

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


get (name) -> Block

The ‘get’ function returns the block with the given name.

Example

Creating a stone block and placing it at the spell’s position.

spell.block = Blocks.get( "stone")

Example

Creating a smooth diorite block and placing it at the spell’s position.

spell.block = Blocks.get( "stone"):withData( { variant = "smooth_diorite"})

Example

Creating a standing sign with the name of the current spell’s owner written onto it and placing it at the spell’s position.

spell.block = Blocks.get("standing_sign"):withNbt( {
  Text1='{"text":"'..spell.owner.name..'"}'
})