#.getTag() returning null (NMS)
1 messages · Page 1 of 1 (latest)
Can you check the type of the item that's causing the null?
I only had 1 item in my inventory, and it was wood planks
Is it possible that one of the empty slots that were checked against had air as their type?
Is it possible for an empty slot to not be null?
Not sure, I just always do both a null check and an air check, just in case
If that doesn't do it, try running hasTag before the result line, and at that point check what type of item is causing the problem
Just in case, is the piece of wood the one causing the problem?
I'd have to check, I mean who knows, maybe it really is the empty slots that are causing it
If you don't mind me asking, are you trying to save the string to somewhere else than a file so that you can get the player item stacks elsewhere?
no, I only need this to save a player's inventory to a file and then load it from the same file whenever I need to
it's a .yml file
basically containing players.[UUID].inventory entries
so my method just returns a string which is then saved to the file basically