Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from mcpi.minecraft import Minecraft
- # Connect to the Minecraft server (replace 'localhost' and '4711' with your server's IP and port)
- mc = Minecraft.create("localhost", 4711)
- # Define the region you want to scan (replace these coordinates with your desired region)
- min_x, min_y, min_z = -10, 0, -10
- max_x, max_y, max_z = 10, 10, 10
- # Function to check if a block is visible
- def is_block_visible(x, y, z):
- player_x, player_y, player_z = mc.player.getPos()
- max_distance = 10 # Adjust this value as needed for your use case
- distance = ((x - player_x) ** 2 + (y - player_y) ** 2 + (z - player_z) ** 2) ** 0.5
- return distance <= max_distance
- # Function to scan blocks and print block data for visible blocks
- def scan_visible_blocks():
- for x in range(min_x, max_x + 1):
- for y in range(min_y, max_y + 1):
- for z in range(min_z, max_z + 1):
- if is_block_visible(x, y, z):
- block_data = mc.getBlockWithData(x, y, z)
- print(f"Visible Block at ({x}, {y}, {z}): ID={block_data.id}, Data={block_data.data}")
- if __name__ == "__main__":
- scan_visible_blocks()
Advertisement
Add Comment
Please, Sign In to add comment