1.15.2 Getting NBT Json for the player's client version

Discussion in 'Spigot Plugin Development' started by LOOHP, Mar 19, 2020.

  1. I'm currently working on a plugin which allows you to show items as hover text on chat, Currently, I am using nms to get the nbt json of the server Minecraft version. As nbt json formats change from version to version, if somebody uses Viaversion of something like that to allow clients from other version to join the server, the nbt json in the hover messages would be invalid to their client causing item meta to be not displayed corrently.

    So the question is, is there a way to obtain item nbt json for the player's client version, or in other words, nbt json that is for another version which is not the server's native version? Thanks in advance.