"Sputnik" help  
Sputnik Help
NbtNew(<type>, [<name>], [<value>])

Description

Creates a new NBT (Named Binary Tag) object of the specified type with an optional name and value. The NbtNew function allows you to easily create NBT objects with the desired type, name, and value.

Parameters

<type> The NBT type value for the new object.
<name> The name to assign to the new NBT object. If not provided, the resulting NBT object will have an empty name.
<value> The value to be assigned to the NBT object. If provided, it will be converted to the appropriate type based on the specified NBT type. If not provided, the NBT object will have a default value according to its type.

Return Value

Success: Returns true.
Failure: Returns false.

Remarks

The NbtNew function creates a new NBT object with the specified type, name, and value. The type parameter represents the NBT type value for the new object. Valid NBT type values can be found in the NBT specification.

If a name is provided, it will be assigned to the newly created NBT object. If no name is provided, the resulting NBT object will have an empty name.

If a value is provided, it will be assigned to the NBT object after being converted to the appropriate type based on the specified NBT type. If no value is provided, the NBT object will have a default value according to its type.

Please note that Sputnik's NBT system is not compatible with the Minecraft NBT system. Although Sputnik's NBT system is based on the Minecraft NBT system and shares some similarities, it is designed specifically for Sputnik and may not be directly interchangeable with Minecraft's NBT data.

Sputnik's NBT system was implemented to provide easy handling of binary data for saving and loading purposes, offering a convenient and efficient way to work with structured data. It is a separate and independent implementation, tailored to suit the needs of Sputnik and its programming environment.

While Sputnik's NBT system is capable and offers useful functionality, it is important to be aware of the distinctions between Sputnik's NBT system and the Minecraft NBT system. If you intend to use NBT data across both systems, it is recommended to account for the differences and implement any necessary conversions or adaptations to ensure compatibility.

Related

Nbt

Example

Example of usage:

say NbtNew(@NbtString, null, "Hello");
say NbtNew(@NbtDouble, null, 777.42);

// PRINTS
// {NBTTag;String:Hello}
// {NBTTag;Double:777.42}

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org