forEach

open fun forEach(action: BiConsumer<String, NBT>)
open fun forEach(action: (CompoundEntry) -> Unit)

Performs the given action on each entry.