"Sputnik" help  
Sputnik Help
NbtListTagType(<nbtList>)

Description

Returns the type constant of the NBT tags within an NBT list.

Parameters

<nbtList> Returns the type constant of the NBT tags within an NBT list.

Return Value

Success: Returns the integer constant representing the type of the NBT tags within the NBT list.
Failure: Returns false.

Remarks

The NbtListTagType function allows you to retrieve the type constant of the NBT tags within an NBT list. It returns an integer constant, such as @NbtString, representing the common type of all the tags within the list. If the provided nbtList parameter is not a valid NBT list the function returns null.

Related

Example

Example of usage:

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

say $nbt;
say "TagCount = " . NbtListTagCount($nbt);
say "List type = " . NbtListTagType($nbt);
say "Is String list type ? " . (NbtListTagType($nbt) == @NbtString);

for (my $i = 0; $i < NbtListTagCount($nbt); $i++)
    say "[$i] " . NbtListGetAt($nbt, $i);

// PRINTS
// {NBTTag;List:2 entries of type String}
// TagCount = 2
// List type = 10
// Is String list type ? true
// [0] Hello
// [1] Cat

 


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