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 |
Below you find short descriptions about each of the functions and some examples about how to use them in your spells.
The ‘get’ function returns the block with the given name.
Creating a stone block and placing it at the spell’s position.
spell.block = Blocks.get( "stone")
Creating a smooth diorite block and placing it at the spell’s position.
spell.block = Blocks.get( "stone"):withData( { variant = "smooth_diorite"})
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..'"}'
})