Tools for working with raw data.
Only usable in the mod data stage.
local Data = require('stdlib/data/data')
select (pattern) | Selects all data values where the key matches the selector pattern. |
Selects all data values where the key matches the selector pattern.
The selector pattern is divided into groups. The pattern should have a colon character :
to denote the selection for each group.
The first group is for the class of the data type (item, recipe, entity-type, etc).
The second group is for the name of the data element, and is optional. If missing, all elements matching prior groups are returned.
For more granular selectors, see other modules, such as Recipe.select.
Parameters:Data.select('recipe') -- returns an array with all recipes
Data.select('recipe:steel.*') -- returns an array with all recipes whose name matches 'steel.*'