Skip to content

Instantly share code, notes, and snippets.

@sli
Created July 16, 2011 21:31
Show Gist options
  • Save sli/1086813 to your computer and use it in GitHub Desktop.
Save sli/1086813 to your computer and use it in GitHub Desktop.
Minecraft seed grabber.
#!/usr/bin/python
import nbt
def mcseed(filename):
nbtf = nbt.NBTFile(filename, 'rb')
return nbtf[0]['RandomSeed']
if __name__ == '__main__':
import sys, os.path
if os.path.isdir(sys.argv[1]):
path = os.path.join(sys.argv[1], 'level.dat')
s = mcseed(path)
else:
s = mcseed(sys.argv[1])
print 'Seed: %s' % s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment