Download the PHP package aternos/nbt without Composer

On this page you can find all versions of the php package aternos/nbt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nbt

php-nbt

A full PHP implementation of Minecraft's Named Binary Tag (NBT) format.

In contrast to other implementations, this library provides full support for 64-bit types, including the relatively new TAG_Long_Array.

Additionally, all three flavors (Java Edition, Bedrock Edition/little endian, and Bedrock Edition/VarInt) of the NBT format are supported.

Installation

Usage

Reading NBT data

To read existing NBT data, a Reader object is required. This library implements different readers to read NBT data from strings.

Note that the reader object is also used to specify the NBT format flavor. Available are \Aternos\Nbt\NbtFormat::JAVA_EDITION, \Aternos\Nbt\NbtFormat::BEDROCK_EDITION, and \Aternos\Nbt\NbtFormat::BEDROCK_EDITION_NETWORK.

More advanced readers can be created by implementing the \Aternos\Nbt\IO\Reader\Reader interface or by extending the \Aternos\Nbt\IO\Reader\AbstractReader class.

A reader object can be used to load the NBT tag.

In theory, any type of NBT tag could be returned, but in reality all NBT files will start with either a compound tag or a list tag.

Manipulating NBT structures

Tag values of type TAG_Byte, TAG_Short, TAG_Int, TAG_Long, TAG_Float, TAG_Double, TAG_String can be accessed via their getValue() and setValue() functions.

On String tags, getValue() and setValue() use the UTF-8 encoding and convert strings based on the selected NBT flavor when being serialized.

Compound tags, list tags, and array tags implement the ArrayAccess, Countable, and Iterator interfaces and can therefore be accessed as arrays.

Alternatively, compound tags can be accessed using getter/setter functions. This is especially useful in combination with the new PHP null safe operator.

Serializing NBT structures

Similar to the reader object to read NBT data, a writer object is required to write NBT data.

The NBT flavor used by a writer object can differ from the one used by the reader object that was originally used to read the NBT structure. It is therefore possible to use this library to convert NBT structures between the different formats.

More advanced writers can be created by implementing the \Aternos\Nbt\IO\Writer\Writer interface or by extending the \Aternos\Nbt\IO\Writer\AbstractWriter class.

A writer object can be used to write/serialize an NBT structure.

Bedrock Edition level.dat

While the Bedrock Edition level.dat file is an uncompressed NBT file, its NBT data is prepended by two 32-bit little endian integers.

The first one seems to be the version of the Bedrock Edition Storage Tool, which is also stored in the StorageVersion tag of the NBT structure.

The second number is the size of the file's NBT structure (not including the two prepending integers).

A Bedrock Edition level.dat file could be read like this:


All versions of nbt with dependencies

PHP Build Version
Package Version
Requires pocketmine/binaryutils Version ^0.2.1
php Version >=8.1
php-64bit Version *
ext-zlib Version *
ext-json Version *
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aternos/nbt contains the following files

Loading the files please wait ....