Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening servers.dat. #186

Open
taitep opened this issue Nov 2, 2023 · 1 comment
Open

Opening servers.dat. #186

taitep opened this issue Nov 2, 2023 · 1 comment

Comments

@taitep
Copy link

taitep commented Nov 2, 2023

I want to try adding some servers to the list using python, and seems this library would work. Testing it out does not go so well tho. I opened the .minecraft folder in a terminal, and in the python shell wrote the following:

>>> from nbt import nbt
>>> nbtfile = nbt.NBTFile('./servers.dat')

I get this error:
gzip.BadGzipFile: Not a gzipped file (b'\n\x00')
How do i fix this? Do i need to GZip it first?

@lynrayy
Copy link

lynrayy commented Sep 6, 2024

Same for

from nbt import nbt
og_servers_dat = "src_servers.dat"

with open(og_servers_dat, "rb") as input_file:
    nbtfile = nbt.NBTFile(fileobj=input_file)

gzip.BadGzipFile: Not a gzipped file (b'\n\x00')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants