Skip to content

KeyError: Tag Level does not exist when using Minecraft 1.18.1 worlds. #159

@ads103

Description

@ads103

I tried to use the block_finder example on a Mincraft 1.18.1 world. Upon doing so, this exception was thrown:

>python3 nbtTry.py . 1 1 10 water
Preparing to scan chunk from -9:-9 to chunk 11:11 for a water
Traceback (most recent call last):
  File "nbtTry.py", line 84, in <module>
    sys.exit(main(world_folder, chunkx, chunkz, chunkrange, block))
  File "nbtTry.py", line 33, in main
    chunk = world.get_chunk(chunkx, chunkz)
  File "C:\Users\ads103\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\nbt\world.py", line 183, in get_chunk
    return self.chunkclass(self.get_nbt(x, z))
  File "C:\Users\ads103\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\nbt\chunk.py", line 280, in __init__
    Chunk.__init__(self, nbt)
  File "C:\Users\ads103\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\nbt\chunk.py", line 103, in __init__
    self.chunk_data = nbt['Level']
  File "C:\Users\ads103\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\nbt\nbt.py", line 543, in __getitem__
    raise KeyError("Tag %s does not exist" % key)
KeyError: 'Tag Level does not exist'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions