IKnowImEZ Posted April 16, 2018 Posted April 16, 2018 (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 April 16, 2018 by IKnowImEZ Quote
jabelar Posted April 16, 2018 Posted April 16, 2018 https://minecraft.gamepedia.com/Map_item_format Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
IKnowImEZ Posted April 16, 2018 Author Posted April 16, 2018 (edited) On 4/16/2018 at 1:47 AM, jabelar said: https://minecraft.gamepedia.com/Map_item_format Expand 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 April 16, 2018 by IKnowImEZ Quote
Draco18s Posted April 16, 2018 Posted April 16, 2018 Step 1: Get the map's item stack Step 2: Read the stack's NBT Quote 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.
IKnowImEZ Posted April 16, 2018 Author Posted April 16, 2018 On 4/16/2018 at 2:21 AM, Draco18s said: Step 1: Get the map's item stack Step 2: Read the stack's NBT Expand 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 Quote
Draco18s Posted April 16, 2018 Posted April 16, 2018 On 4/16/2018 at 2:41 AM, IKnowImEZ said: player.getHeldItemMainhand().getTagCompound().getTagList("what would i put hear", 10) Expand 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)... Quote 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.
IKnowImEZ Posted April 16, 2018 Author Posted April 16, 2018 On 4/16/2018 at 4:06 AM, 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)... Expand 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")); } Quote
Draco18s Posted April 16, 2018 Posted April 16, 2018 Tag "scale" isn't of type List is it? Lets go back to that same bit of documentation... Quote 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.
IKnowImEZ Posted April 16, 2018 Author Posted April 16, 2018 (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")); } Edited April 16, 2018 by IKnowImEZ Quote
Draco18s Posted April 16, 2018 Posted April 16, 2018 (edited) 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: On 4/16/2018 at 5:22 AM, IKnowImEZ said: .getTagList("5 entries", 10) Expand Holy shit, you actually thought "5 entries" was the name of the tag. Edited April 16, 2018 by Draco18s Quote 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.
IKnowImEZ Posted April 16, 2018 Author Posted April 16, 2018 On 4/16/2018 at 5:34 AM, Draco18s said: 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. Expand 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 Quote
Draco18s Posted April 16, 2018 Posted April 16, 2018 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. Quote 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.
Recommended Posts
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.