def __getitem__(self, key):
        """ Let's be magic. If we get a string, return the first block whose
            name matches exactly. If we get a (id, data) pair or an id, return
            that block. for example:

                level.materials[0]  # returns Air
                level.materials["Air"]  # also returns Air
                level.materials["Powered Rail"]  # returns Powered Rail
                level.materials["Lapis Lazuli Block"]  # in Classic

           """
        if isinstance(key, basestring):
            key = key.replace("minecraft:", "")
            key = key.lower()
            lowest_block = None
            for b in self.allBlocks:
                if b.name.lower() == key:
                    return b
                if b.idStr.lower() == key:
                    if b.blockData == 0:
                        return b
                    elif not lowest_block:
                        lowest_block = b
                    elif lowest_block.blockData > b.blockData:
                            lowest_block = b
            if lowest_block:
                return lowest_block

            if '[' in key and self.blockstate_api:
                name, properties = self.blockstate_api.deStringifyBlockstate(key)
                return self[self.blockstate_api.blockstateToID(name, properties)]
            raise KeyError("No blocks named: " + key)
        if isinstance(key, (tuple, list)):
            block_id, blockData = key
            return self.blockWithID(block_id, blockData)
        return self.blockWithID(key)
 Let's be magic. If we get a string, return the first block whose
            name matches exactly. If we get a (id, data) pair or an id, return
            that block. for example:

                level.materials[0]  # returns Air
                level.materials["Air"]  # also returns Air
                level.materials["Powered Rail"]  # returns Powered Rail
                level.materials["Lapis Lazuli Block"]  # in Classic

           
pymclevel/materials.py