1. I was trying to create a website that needs to show inventories of pit players.
    I found where the inventory is stored and there are a bunch of numbers that I don't understand.
    Can someone link me to a website or tell me how to make sense of the numbers?
    Thanks!

    Edit: I know about pit.blue, I need to figure out how to make sense of the inventory in the API, not see my inventory.
     
    #1
    Last edited: Jul 26, 2019
  2. pit.blue ?!?!?!?
     
    #2
    • Useful Useful x 1
  3. I looked in the code for pit.blue and I couldn't find how the stats were interpreted.

    Edit: I looked at the source with ctrl+u
     
    #3
  4. F2A

    F2A

    F2A New Member

    e3h
    MVP+
    Xaige XAIGE
    Member
    Messages:
    26
    Yeah, just use pit.blue
    upload_2019-7-27_2-9-12.png
     
    #4
  5. Pit.blue doesn't help me; I need to make sense of this:
    upload_2019-7-26_20-14-45.png
    in the API.
     
    #5
  6. Posting parts of my reply to the PM conversation I had with this user here, so those who stumble across it have an answer. I've also moved this thread to the Code Help forum, which is more fitting for questions about programming and the Hypixel API.

    -----------

    Player inventory data is stored in player.stats.Pit.profile.inv_contents as gzipped NBT data. Here's a gist on how to unzip the NBT data in Javascript:
    https://gist.github.com/robere2/f04132c52ea79db089fc214b67c81885

    I did not include how to parse this data, as it's very possible that there's a library out there that will do the parsing for you. If not, you can use the Minecraft wiki and protocol wiki to read up on the structure of player inventory data:
    https://minecraft.gamepedia.com/Player.dat_format#Item_structure
    https://wiki.vg/Data_types

    If you are using Node.js/Javascript, here's an example on how to parse the data using the prismarine-nbt package:
    https://gist.github.com/robere2/1fe6b104ed974571b17eb8efe12e073f
    Decompression is handled by the package automatically, so no need to do it yourself.

    Do note that numeral IDs are used for items, despite the wiki stating strings. This is because the server still runs on 1.8 code, before everything was converted to strings. As a result, if you use the wiki pages, you might find it helpful to go back in the history to pre-1.9, if possible.

    I'll also see if I can get the documentation updated to provide more information. Let me know if you have any other questions!
     
    #7
    • Useful Useful x 3
  7. Sorry for the necro.

    For anyone wondering how to do this in Java, the 'net.minecraft.nbt.CompressedStreamTools' class is what you are looking for. It has various methods that will handle decompression & parsing.

    Enjoy.
     
    #8
  8. Xizz3l

    Xizz3l New Member

    Xizz3l
    VIP
    Messages:
    10
    Where can I find it or extract it from?
     
    #9

Share This Page