Sueta
NB

NBTPad

1.0

Command-Line Java program for printing and editing NBT files in the Mojangson format.

·Plugin

NBTPad

This resource is a simple command line tool which allows you to print and edit NBT-files via the Mojangson format in a text editor and even your command line.

Use Cases

While on Windows there has been tools for NBT-editing for a long time now such as NBTExplorer, there is no option for Linux users.

Note that if you use a console-based editor such as nano or vim in combination with this program, you can edit NBT files over ssh.

One rather popular alternative for Linux is nbt2yaml, however I found this tool to be very hard to work with due to its overly complex and strictly typed version of YAML. It also repeatedly failed to decode some of the files I have been working with.

Usage

The general usage of the program is:
java -jar nbtpad.jar [options] <NBT-file>

Options:

  • -e <editor> Edits the NBT-file using the given editor (for example -e nano on Linux)
  • -p Prints the NBT-file into the console
  • -r <file> Reads a Mojangson file and writes it into the given NBT-file
  • -u Enable uncompressed mode, meaning that NBT files will be read and written without compression

Examples

java -jar nbtpad.jar -p my_nbt_file.nbt > my_file.mson

Reads "my_nbt_file.nbt" and saves it in Mojangson format as "my_file.mson".

java -jar nbtpad.jar -e nano my_nbt_file.nbt

Edits an NBT-file using the console text editor "nano"

Trivia

This resource uses the public source NBT-library eisen-nbt.

Both the library and this tool have an MIT-license, meaning they can be used in commercial projects.

The latest version of NBT which includes the TAG_Long_Array is also supported.

License

License

MIT License
Copyright (c) 2017 Jan Schultke
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Similar projects

Plugin →