Skip to content

CompoundTag .get method returning null with valid key #93

@pigxity

Description

@pigxity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions