Jump to content

Recommended Posts

Posted (edited)

So im trying to read a map_whatever.dat to get the information about the map but i don't know how to read it, i have tried for the last 2 days messing around with nbt and really got no wear, got any tips or code?

 

sorry this probably made no sense, i don't know how to describe what im trying to do

Edited by IKnowImEZ
Posted (edited)
19 minutes ago, jabelar said:

Yes, i know but how would i edit it from a mod? or get the data from a mod, i can't get to the map_whatever.dat file to get the info in it

 

and i cant get nbt data from the item the player is holding because the data i am looking for is not stored there its stored in the map_whatever.dat

Edited by IKnowImEZ
Posted

Step 1: Get the map's item stack

Step 2: Read the stack's NBT

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
17 minutes ago, Draco18s said:

Step 1: Get the map's item stack

Step 2: Read the stack's NBT

im not 100% sure how to do it, like this? player.getHeldItemMainhand().getTagCompound().getTagList("what would i put hear", 10)

 

or somthing like, i dont think it will work because a maps only nbt is only display and decorations

Posted
1 hour ago, IKnowImEZ said:

player.getHeldItemMainhand().getTagCompound().getTagList("what would i put hear", 10)

getTagList is just one of the many types of tag that an NBT can contain.

 

As for "what you put here" (which is spelled "H-E-R-E" because "hear" is what you do with your ears)...

 

nbt.PNG

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
36 minutes ago, Draco18s said:

getTagList is just one of the many types of tag that an NBT can contain.

 

As for "what you put here" (which is spelled "H-E-R-E" because "hear" is what you do with your ears)...

 

nbt.PNG

Sorry my bad, i got this little bit of code, it doesn't work, i dident expect it to work because of getTagCompound().getTagList("scale", 10);, do you know how i would get the "scale" tag value?

 

NBTTagList nbttaglist = player.getHeldItemMainhand().getTagCompound().getTagList("scale", 10);
       
        for (int j = 0; j < nbttaglist.tagCount(); ++j)
        {
            NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(j);
                        
            System.out.println(nbttagcompound.getDouble("scale"));
        }

 

Posted

Tag "scale" isn't of type List is it?

Lets go back to that same bit of documentation...

nbt2.png

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted (edited)

so i got this image of what the player would be holding but of the nbt data, from the last picture you showed me i would think 5 entries is the root tag, but that would make sense, and this code just doesnt look right, and i cant get the map item format code from the nbts tags i showed you in the picture so i dont understand that.

 

NBTTagList nbttaglist = player.getHeldItemMainhand().getTagCompound().getTagList("5 entries", 10);
        
        
        for (int j = 0; j < nbttaglist.tagCount(); ++j)
        {
            NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(j);
                        
            System.out.printIn(nbttagcompound.getByte("Scale"));
        }

 

Capture.PNG

Edited by IKnowImEZ
Posted (edited)

Capture.PNG

 

No, that's the item itself. As evidenced by:
 - a tag called "tag"

 - a byte called "slot"

 - a byte called "count"

 - a child entry in a list called "Inventory"

And most blatantly obvious of all:

 - a string called "id" with a value of "minecraft:filled_map"

 

The tag "tag" is the data you're after, and that NBT visualizer cannot for some reason show you the data you want.

 

Also:

13 minutes ago, IKnowImEZ said:

.getTagList("5 entries", 10)

Holy shit, you actually thought "5 entries" was the name of the tag.

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
6 minutes ago, Draco18s said:

Capture.PNG

 

No, that's the item itself. As evidenced by:
 - a tag called "tag"

 - a byte called "slot"

 - a byte called "count"

 - a child entry in a list called "Inventory"

And most blatantly obvious of all:

 - a string called "id" with a value of "minecraft:filled_map"

 

The tag "tag" is the data you're after, and that NBT visualizer cannot for some reason show you the data you want.

 

Also:

Holy shit, you actually thought "5 entries" was the name of the tag.

So im not going be able to get the map data like Scale, xCenter, zCenter? and no tbh lol just the picture u send made me think for a sec but not really

Posted

The data exists, but you're using an external program to examine the player's inventory and can't see it.

You need to write the code to extract it.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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