← Back to Treasure Hunt Scripts

Place Treasures Script

Customize your variables, then fill in the blanks!

Your Custom Settings

Block to place as treasure
Ground height level

Python Script (Code Builder)

This script places treasures at multiple locations using arrays and loops. Press C in Minecraft Education to open the Code Builder!

treasure_x = [5, 10, 15, 20, 25]
treasure_z = [3, 8, 12, 6, 18]
y_level = -60
def ():
    for i in ((treasure_x)):
        x =
        z = treasure_z[i]
        blocks.(GOLD_BLOCK, world(x, y_level, z))
player.on_chat("treasure", place_treasures)