"Sputnik" help  
Sputnik Help
NbtListExGetTagAt(<nbtListEx>, <index>)

Description

Returns the NBT tag at the specified index in the NBT list.

Parameters

<nbtList> The NBT list from which to retrieve the tag.
<index> The index of the tag to be retrieved.

Return Value

Success: Returns the NBT tag at the specified index.
Failure: Returns null if the provided nbtList parameter is not a valid NBT list or if the index is out of range.

Remarks

The NbtListGetTagAt function allows you to retrieve the NBT tag at a specific index within an NBT list. The function returns the NBT tag itself, not its value. If the provided nbtList parameter is not a valid NBT list or if the index is out of range, the function returns null.

Related

NbtListExGetAt

Example

Example of usage:

my $nbt = NbtNew(@NbtListEx);
NbtListExAppendTag($nbt, Nbt("Hello"));
NbtListExAppendTag($nbt, Nbt("Cat"));
NbtListExAppendTag($nbt, Nbt("Dog"));

say $nbt;

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

// PRINTS
// {NBTTag;ListEx:3 entries}
// {NBTTag;String:Hello}
// {NBTTag;String:Cat}
// {NBTTag;String:Dog}

 


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