I'm working on a plugin that is to work alongside a mod, and the person working on the mod wants to use NBT to store data such as the users race. while researching NBT and bukkit I discovered bukkit removed support for NBT, although I can't seem to find exactly why. there is an api I could use, but while skimming some stuff in a google search I read about it having something to do with security, are there any risks to using NBT with bukkit?
patey Bukkit will automatically wrap around NBT. If you really wanted to you could use NMS. However, you could just use ItemMeta/etc.. and store it like that.
sorry I don't know a lot about the internals of minecraft and bukkit, what do you mean by wrap around it? I should probably mention that the plugin would need to be able to get and change the race value stored in NBT
yea you have 2 type ItemStacks one is from the bukkit and the other from the minecraft package it self. What I think you could convert it by using: Code: ItemStack stack = new ItemStack(Material.WOOD, 1); net.minecraft.server.<version>.ItemStack item = ((CraftItemStack)stack).getHandle(); //makes it into the minecraft internals //to convert back there is a method which is called smiliar as asBukkitStack() but I forgot the method name however I'm not good with nms and nbt tags I only think a beginning looks a bit like this.
Nope, working on a plugin for a modded server I should have specified it's a player entity I'm trying to retrieve the race tag from(is it called a tag? I don't even know that much about it -.-).I don't see anything about a handle in the javadocs for "Player", is it even possible with an entity?
patey so? if its bukkit u can use messaging channels... if its not bukkit why are u asking on the bukkit forums?
sorry thought messaging channels was to do with chat, it is bukkit just using a modded bukkit server (when trying to edit the text in the edit popup disappears and I can't edit it :/ accidentally hit the post button) The mod will be storing the user's chosen class as an NBT tag, and the plugin will need to retrieve it to know what race they are when deciding if they are allowed to use certain recipes and blocks and stuff. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
I plan to once I retrieve it from the mod, I couldn't really find any info n the messging channel, got a link? what I'm trying to do is store a user defined variable for the player entity (the race, also possibly the gender ),which in the mod determines the user's skin, in a way that I can retrieve it in the plugin when needed. What's the best way to do that? sorry agian, can't edit my post. meant to quote you oscarshi1995 before asking for a link about messaging channel EDIT by Moderator: merged posts, please use the edit button instead of double posting.
patey Oh sorry, I misread your first post. I'm fairly new to client modding, but I read something about server-Forge being able to allow client connections without the mod itself. Use the server-Forge and message channeling from them. Correct me if I'm wrong please.
patey Since you are using a modded server software (I'm guessing MCPC+/Cauldron) to run mods, you'll have to ask how they handle the NBT there. There is a huge rule on the forums that builds not made by Bukkit aren't supported here (as its not very easy to support something they didn't make)
your guess is as good as mine then lol, I'm fairly new to client modding as well. still not very experienced with plugin development yet either though.
patey I don't know anything about NBT, so I looked it up: it's file format for data storage used by Minecraft. Here's some more info I found: http://wiki.vg/NBT https://github.com/Evil-Co/NBT-Lib
Locked. When developing plugins or mods for modded servers that are not CraftBukkit, look for help on the forums where you found your modded server. It is not possible to support software other than CraftBukkit/Bukkit.