1. I want to convert the nbt data i got from skyblock/profile inv_content from decoded base64 nbt file to json format, anyone knows whats the right tool for Python? Or any command line utility can be used, thanks!
     
    #1
  2. NoahvdAa

    NoahvdAa Member

    NoahvdAa
    Messages:
    244
    #2
  3. Well it do works but it became a little bit annoying after all cause you cant access them through ways such as int() which json do
    any other tools or methods you suggest?
     
    #3
  4. To convert a string to a number, run eval(STRINGHERE)
     
    #4
  5. NoahvdAa

    NoahvdAa Member

    NoahvdAa
    Messages:
    244
    Using int(string) is a much better and safer way.
     
    #5
  6. notnotmelon

    notnotmelon Active Member

    notnotmelon
    VIP
    Messages:
    792
    bump, the question wasn't really answered and I also need this information
     
    #6
  7. notnotmelon

    notnotmelon Active Member

    notnotmelon
    VIP
    Messages:
    792
    I managed to parse it:

    Code:
    def decode_inventory_data(raw):
       data = nbt.NBTFile(fileobj = BytesIO(base64.b64decode(raw)))
       print(data.pretty_tree())
    
     
    #7

Share This Page