Compass Rose

Introduction

This tutorial shows you how to create words and letters (text) from blocks. The text is placed in the Minecraft world at a position where you print them at. The object you will make is called a compass rose. This is a 2D marker showing the North, South, East, and West directions. In the last step, you will add another dimension to the compass rose to show the Up and Down directions.

Print the letter E in the west direction at the player’s current location. This is a direction label for the East direction.

# @highlight
blocks.print("E", GLOWSTONE,
    pos(0, 0, 0),
    WEST)

Try it!

Run the program now.

Printing the direction label will place a big “E” in the Minecraft world at your current position.

Set the East direction

Change the printing position to (20, 0, 0) so that the letter “E” is placed 20 blocks east of your current position.

With positions, the first number, x, of a position coordinate represents the East/West direction. A positive value goes East, negative goes West.

The position of (20, 0, 0) is relative to the player’s position rather than to a world position. So, (20, 0, 0) means 20 blocks East of the player’s position.

blocks.print("E",GLOWSTONE,
    # @highlight
    pos(20, 0, 0),
    WEST)

Try it again

Run the program again to see the new print position.

The “E” letter is now printed 20 blocks away.

Print another label to show a “W” at 20 blocks West. Run the program to test it.

West goes in the negative direction so the position is set as (-20, 0, 0). Don’t move until all letters are printed!.

blocks.print("E",GLOWSTONE,
    pos(20, 0, 0),
    WEST)
# @highlight
blocks.print("W",GLOWSTONE,
    # @highlight
    pos(-20, 0, 0),
    # @highlight
    WEST)

Print two more direction labels to show “N” 20 blocks North, “S” 20 blocks South. Try it in Minecraft.

The 3rd number, z, of the position is the South/North coordinate. A positive value goes South, a negative value goes North.

blocks.print("N",GLOWSTONE,
    # @highlight
    pos(0, 0, -20),
    WEST)
blocks.print("S",GLOWSTONE,
    # @highlight
    pos(0, 0, 20),
    WEST)

Add direction labels to show “U” 20 blocks Up, “D” 20 blocks Down. Try it in Minecraft.

The 2nd number, y, of the position is the Up/Down direction for elevation. A positive value goes Up, a negative value goes Down.

blocks.print("U",GLOWSTONE,
    # @highlight
    pos(0, 20, 0),
    WEST)
blocks.print("D",GLOWSTONE,
    # @highlight
    pos(0, -20, 0),
    WEST)