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


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


No comments yet.