#initializing a WriteView

8 messages · Page 1 of 1 (latest)

frank granite
#
WriteView nbt2 = new WriteView();
client.player.writeData(nbt2);
MyMod.LOGGER.info("======Start======");
MyMod.LOGGER.info(nbt2.get("XpTotal").toString());
MyMod.LOGGER.info("======Stop======");```

how can I initialize nbt2? cuz this doesn't work in 1.21.6.
still zealot
#

are you doing this just to get the xp amount?

frank granite
#

nah it's juste an exemple, I need the player's nbt datas

still zealot
#

is there any reason you cant just grab it from the player directly rather than serialising it to nbt first

frank granite
#

well I need to be able to acces modded nbts on the player

#

and not with an api

#

or any specific mod

#

for exemple I need to acces cardinal_components.travelersbackpack:travelersbackpack.Wearable