"Sputnik" help  
Sputnik Help
NbtSetName(<nbt>, <name>)

Description

Sets the name of the specified NBT (Named Binary Tag) object to the provided name. The NbtSetName function allows you to assign a name to an existing NBT object.

Parameters

<nbt> The NBT object for which the name is to be set.
<name> The name to assign to the NBT object.

Return Value

Success: Returns true.
Failure: Returns false.

Remarks

The NbtSetName function sets the name of the specified NBT object to the provided name. This allows you to assign a meaningful name to the NBT object for better identification and organization.

The function modifies the provided NBT object in place and returns the modified object with the updated name.

Related

Example

Example of usage:

$a = NbtNew(@NbtString, "cat", "Hello");
$b = NbtNew(@NbtDouble, "dog", 777.42);

NbtSetName($a, "Meow");
NbtSetName($b, "Woof");

say $a . " | " . NbtGetName($a);
say $b . " | " . NbtGetName($b);

// PRINTS
// {NBTTag;String:Hello} | Meow
// {NBTTag;Double:777.42} | Woof

 


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