Guest User

Untitled

a guest
Jan 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. import nbt, sys
  4.  
  5. if len(sys.argv) == 2:
  6. nf = nbt.NBTFile(sys.argv[1],"rb")
  7. v = nf["Data"]["GameType"].value
  8. print "Current: " + ("Creative" if v else "Survival")
  9. nf["Data"]["GameType"].value = not v
  10. nf.write_file(sys.argv[1])
  11. print "Changed to: " + ("Creative" if not v else "Survival")
  12. else:
  13. print "Error: incorrect amount of arguments supplied."
  14. print "Usage: ./change_map_type.py /path/to/level.dat"
Add Comment
Please, Sign In to add comment