Mechanic

forEachValue

since v5.10

Runs a given metaskill for each element of the specified list

Examples & Notes

Examples

# Skills file
ExampleForEachValue:
  Skills:
  - setvariable{var=skill.listnames;type=LIST;val="Steve,Alex"} @self
  - foreachvalue{skill=ExampleSkill;values=<skill.var.listnames>} @self # Can also directly use the entry1,entry2,entry3... syntax

ExampleSkill:
  Skills:
  - message{m="Found you:D"} @PlayerByName{name=<skill.value>}
# Skills file
ExampleForEachValueForMap:
  Skills:
  - setvariable{var=skill.mapnames;type=MAP;val="Steve=hello;Alex=1,2,3"} @self
  - foreachvalue{skill=ExampleSkill;values=<skill.var.mapnames>} @self # Can also directly use the key=value;key2=value2... syntax

ExampleSkill:
  Skills:
  - message{m="You have a value of <skill.value>"} @PlayerByName{name=<skill.key>}

Universal Mechanic Options

Author:
Lxlp
Community-maintained documentation for the Mythic plugin ecosystem.