Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import nbt, sys
- if len(sys.argv) == 2:
- nf = nbt.NBTFile(sys.argv[1],"rb")
- v = nf["Data"]["GameType"].value
- print "Current: " + ("Creative" if v else "Survival")
- nf["Data"]["GameType"].value = not v
- nf.write_file(sys.argv[1])
- print "Changed to: " + ("Creative" if not v else "Survival")
- else:
- print "Error: incorrect amount of arguments supplied."
- print "Usage: ./change_map_type.py /path/to/level.dat"
Add Comment
Please, Sign In to add comment