Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompoundTag .get method returning null with valid key #93

Open
p1gyy opened this issue Jul 17, 2023 · 0 comments
Open

CompoundTag .get method returning null with valid key #93

p1gyy opened this issue Jul 17, 2023 · 0 comments

Comments

@p1gyy
Copy link

p1gyy commented Jul 17, 2023

i am trying to get the LevelName from a level.dat file but whenever I try to do that it always returns null

CompoundTag namedTag = (CompoundTag)NBTUtil.read(levelDat).getTag();
this.WORLD_NAME = namedTag.getStringTag("LevelName").getValue();

LOGGER.info(WORLD_NAME);

Caused by: java.lang.NullPointerException: Cannot invoke "net.querz.nbt.tag.StringTag.getValue()" because the return value of "net.querz.nbt.tag.CompoundTag.getStringTag(String)" is null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant