When I updated to alpha 11 old method of setting nbt tag did not work. How do I set a String tag to an item? Also how do I check that tag?
https://forums.pmmp.io/threads/how-do-you-properly-set-nbt.1182/ Was using that. Doesn't seem to work now
I'm trying to add a string tag and then check if that item has a string tag. After var_dump ing it I realized that it did not have the string tag. Also I assume that thread is outdated by now so need help with new api/methods
Getting a value from a key is similar (requires to know that it's a String value): PHP: $nbt->getString("key here"); To check if a key of the specified type exists and create it if not you can do: PHP: if(!$nbt->hasTag("key here", StringTag::class)) { $nbt->setString("key here", "value");}