Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Minescript Wiki › Guides › Read and Modify Blocks Around You

Read and Modify Blocks Around You

Accessing Block Data

Minescript provides functions to inspect and change blocks in your world without manual clicking or mining.

Reading Block Information

1. Use world.get_block(x, y, z) to check what block exists at specific coordinates

2. The function returns block data you can inspect

3. Combine with player.get_pos() to work relative to your location

Modifying Blocks

To place or change blocks:

1. Use world.set_block(x, y, z, block_name) to place a block

2. Replace block_name with the actual block type (e.g., "stone", "oak_log")

3. Coordinates must be integers

Practical Workflow

Create a loop to build structures automatically:

`python

for i in range(10):

world.set_block(100 + i, 64, 200, "oak_log")

`

This places 10 oak logs in a line. Adjust coordinates and block types for your project. Always verify coordinates before running large modifications.