loop %key:EXPR% %val:EXPR% in %map:MAP% for %scope:EXPR% — Blocks

loop %key:EXPR% %val:EXPR% in %map:MAP% for %scope:EXPR%
Map1.0.0

Description

Iterates over each entry of a scoped global map, binding the key and value to separate variables.

Allowed Contexts

Root LevelInside Block

Block Variables

key
string
NullableNo

The current map key, named by the user (e.g. 'k' in 'loop k v in stats for player'). The type depends on the map being looped over and is accurate at runtime.

val
string
NullableNo

The current map value, named by the user (e.g. 'v' in 'loop k v in stats for player'). The type depends on the map being looped over and is accurate at runtime.

Examples

loop k v in stats for player:

All Possible Usages (1)

Every distinct way you can write this pattern, with optional groups and choice groups expanded. Placeholders are shown as <name>.

loop <key> <val> in <map> for <scope>

Related (Map)