Rev - Schematic

Easy | 284 points

Description

Downloads

Solution

A quick google search revealed that .schematic files are in the NBT file format.

From Minecraft Wiki

Open the file using NBTExplorer.

NBTExplorer GUI

At the start I thought the dispenser will be one of the TileEntities so I tried to find it using the following python code:

from nbt import nbt

nbtfile = nbt.NBTFile("Ricardo3s_60AP_100C_200SB.schematic",'rb')

for tileentities in nbtfile['TileEntities']:
	try:
		for item in tileentities['Items']:
			print(item)
	except:
		print(tileentities)

As it turns out, TileEntities only contain either minecraft:tnt item or a Minecraft Comparator.

Python output

I then proceeded to search up on Minecraft dispenser to find out what exactly it is since it is not in TileEntities.

From Minecraft Wiki once again

It seems like a Dispenser is a block. I then edited the python script to print out all the blocks.

from nbt import nbt
nbtfile = nbt.NBTFile("Ricardo3s_60AP_100C_200SB.schematic",'rb')
print(nbtfile['Blocks'])

The output is as follows:

Python output

The output is an array of numbers which suggests that every block is stored as a unique number that determines which block type it is. Previously from the Minecraft wiki page, we can also see the number 23 under the dispenser's Numeric ID. Now we just need to count the number of dispensers with the following code:

from nbt import nbt
nbtfile = nbt.NBTFile("Ricardo3s_60AP_100C_200SB.schematic",'rb')

# Count number of blocks with 23 as Numeric ID
print(len([i for i in nbtfile['Blocks'] if i == 23]))

Flag: bucket{2238}

Last updated