Reading NBT Files

Reading a NBT file couldn't be simpler. Call the NbtReader.Deserialize method with as parameter the stream to the NBT file you want to read.

    using( Stream fileStream =
            File.OpenRead( @"C:\Users\UserName\AppData\Roaming\.minecraft\saves\WorldName\level.dat" ) )
    {
        dynamic levelDat = NbtReader.Deserialize( fileStream );

        long seed = levelDat.RandomSeed;   // get the seed for the level
        string name = levelDat.LevelName;  // get the name of the level
    }

Classes

Last edited Feb 8, 2013 at 6:32 PM by Beaker73, version 7

Comments

No comments yet.