Posted April 16, 20187 yr 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, 20187 yr by IKnowImEZ
April 16, 20187 yr https://minecraft.gamepedia.com/Map_item_format Check out my tutorials here: http://jabelarminecraft.blogspot.com/
April 16, 20187 yr Author 19 minutes ago, jabelar said: https://minecraft.gamepedia.com/Map_item_format 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, 20187 yr by IKnowImEZ
April 16, 20187 yr 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.
April 16, 20187 yr Author 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
April 16, 20187 yr 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)... 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.
April 16, 20187 yr Author 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)... 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")); }
April 16, 20187 yr Tag "scale" isn't of type List is it? Lets go back to that same bit of documentation... 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.
April 16, 20187 yr Author 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, 20187 yr by IKnowImEZ
April 16, 20187 yr 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 April 16, 20187 yr 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.
April 16, 20187 yr Author 6 minutes ago, 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. 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
April 16, 20187 yr 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.