Jump to content

How do I read the NBT Tag Data of a map on a server?


TheHook

Recommended Posts

As the title suggests, I am trying to gather NBT Tag data from a map that is in my inventory on a server. The map has an image on it that I am trying to convert into an external Base64 format, or PNG file. But that part is not really important. The main question is given a filled map item on a server, how would I acquire the information I need? Some starter code that I tried returned java.lang.NullPointerException obviously because maps don't store their data in the item, so the keys that I'm using as arguments don't exist.

 

minecraft.player.inventory.getStackInSlot(0).getTagCompund().getCompoundTag("data").getByteArray("colors");

 

I attached the NBT hierarchy of a map item if that helps.

Screen Shot 2020-10-24 at 11.15.43 PM.png

Link to comment
Share on other sites

I forgot to mention that this project is being in in version 1.12.2 of Minecraft. I'm not too sure how to use the class, how would I construct it? What is "mapName" in the game?

Edited by TheHook
more precise question
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.