"Sputnik" help  
Sputnik Help
NbtCompoundClear(<nbtCompound>)

Description

Clears all elements from an NBT compound.

Parameters

<nbtCompound> The NBT compound from which to clear all elements.

Return Value

Success: Returns if the NBT compound was successfully cleared.
Failure: Returns false if the provided nbtCompound parameter is not a valid NBT compound.

Remarks

The NbtCompoundClear function allows you to remove all elements from an NBT compound, effectively clearing its contents. It verifies that the nbtCompound parameter is a valid NBT compound and removes all elements within it.

Related

Example

Example of usage:

my $nbt = NbtNew(@NbtCompound);
NbtCompoundSet($nbt, "Cat", "Meow");
NbtCompoundSet($nbt, "Dog", "Woof");

say $nbt;

foreach(my $key => my $value in NbtCompoundGetMap($nbt))
    say "[$key] = $value";

NbtCompoundClear($nbt);

say $nbt;

// PRINTS
// {NBTTag;Compound::[Cat:Meow,Dog:Woof]}
// [Cat] = Meow
// [Dog] = Woof
// {NBTTag;Compound::[]}

 


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