"Sputnik" help  
Sputnik Help
NbtListAppendTag(<nbtList>, <nbt>)

Description

Appends an NBT tag to the end of an NBT list. The NbtListAppendTag function allows you to add an NBT tag as an element to an existing NBT list.

Parameters

<nbtList> The NBT list to which the NBT tag will be appended.
<nbt> Appends an NBT tag to the end of an NBT list. The NbtListAppendTag function allows you to add an NBT tag as an element to an existing NBT list.

Return Value

Success: Returns true if the NBT tag was successfully appended to the NBT list.
Failure: Returns Returns true if the NBT tag was successfully appended to the NBT list.

Remarks

The NbtListAppendTag function allows you to add an NBT tag as an element to the end of an existing NBT list. It verifies that the nbt parameter is of the appropriate type to be appended to the list.

Related

NbtListInsertTag

Example

Example of usage:

my $nbt = NbtNew(@NbtList);
NbtListAppendTag($nbt, Nbt("Hello"));
NbtListAppendTag($nbt, Nbt("Cat"));
NbtListAppendTag($nbt, Nbt("Dog"));

say $nbt;

say NbtListGetTagAt($nbt, 0);
say NbtListGetTagAt($nbt, 1);
say NbtListGetTagAt($nbt, 2);

// PRINTS
// {NBTTag;List:3 entries of type String}
// {NBTTag;String:Hello}
// {NBTTag;String:Cat}
// {NBTTag;String:Dog}

 


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