Exercise 02
Creating a Single Block
Before spawning blocks we first need to understand how they disposed in Minecraft world. These images are explicites :
Coordinates in Minecraft by MacFreek34570
and:
Coordinates in Minecraft
Using this coordinate system you can then spawn a block using the function mc.setBlock. You must give the coordinate and ID of the block. (you’ll find the list of Block ID here : TODO: Link to ressources)
Most of the time you’ll want to spawn the block near the position of the player. So you’ll need to get the Player coordinates and use it as origin.
Which should gives you :
A block of grass on the ground
In this example we’ll put it just below the player :
Which should gives you :
A block of diamond below you
And now above the ground a purple wool block
Which should gives you :
A block of violet wool above the ground
exercises
exercises mc.postToChat console