Solved How can i check PersistentDataContainer data in optifine?

Lexize

New member
Feb 4, 2022
11
1
0
1
15
Hi guys.
I make an RPG server with a lot of items
And assign a texture with custom model data is little uncomfortable.

I know that PersistentDataContainer paste tags in "tag.PublicBukkitValues"
For example, i creating "settingsMenu" tag
Java:
menuMeta.getPersistentDataContainer().
    set(NamespacedKey.fromString("settingsMenu"), PersistentDataType.STRING, "yep");
And when i trying to check this in optifine
Code:
nbt.tag.PublicBukkitValues.minecraft:settingsMenu = yep
Texture does not work.
What am i doing wrong?
 
Version Output
This server is running Paper version git-Paper-181 (MC: 1.18.1) (Implementing API version 1.18.1-R0.1-SNAPSHOT) (Git: 2121aed)

ryantheleach

New member
Jan 23, 2022
8
2
3
This is probably a bad idea for a few reasons...

1. I'm not sure if the client ever receives PDC data, or whether it's filtered.
2. Also it forces all your users to use optifine...
3. You shouldn't use the Minecraft namespace, when one based on your plugin name can be used.

You can check whether the NBT is being sent to the client, using this mod: https://modrinth.com/mod/nbttooltip
 
Last edited:

Lexize

New member
Feb 4, 2022
11
1
0
1
15
Yes, tag is sent to the client. But as i saw, persistent data stores not in just PublicBukkitValues, not in the tag.PublicBukkitValues.
Thank you for the help!
 

Lexize

New member
Feb 4, 2022
11
1
0
1
15
Well... I tried to do something like that in optifine
Code:
nbt.PublicBukkitValues.ultraviolence:settingsMenu = yep
But this doesn't work.
I think this is caused by ":", but i dont know how to remove that...
 

ryantheleach

New member
Jan 23, 2022
8
2
3
It's probably an escaping issue in whatever file this is. if it's a json key, it should be wrapped in quotes, but I don't know what you are even editing, so :clueless: