Data types
Data types are the smaller values that powers, actions and conditions are built from, such as an attribute modifier, a status effect, a piece of text or an item stack. A data type has the same shape wherever a field uses it, so you only learn each one once.
What counts as a data type
A data type is any value a field expects that is more than a plain number or string. Some are objects, and some are strings with a special meaning:
| Data type | Looks like | Used by |
|---|---|---|
| Identifier | "apoli:heal" | every type, power IDs, tags |
| Attribute modifier | { operation, value, attribute } | apoli:attribute |
| Text component | "Fast" or a JSON text object | name, description |
| Status effect | { effect, duration, amplifier } | apoli:apply_effect |
| Item stack | { item, count, components } | item actions, give |
| HUD render | { should_render, bar_index } | resources and cooldowns |
| Shape and Space | "sphere", "local" | radius and velocity fields |
| Comparison | "<=" with compare_to | apoli:health, resources |
Identifier
An identifier names something in namespace:path form, such as apoli:attribute, minecraft:diamond or my_pack:mana. If you leave out the namespace, Minecraft assumes minecraft:. Identifiers are lowercase and case-sensitive.
Comparisons
Numeric conditions and resource checks share a comparison shape: a comparison operator and a compare_to value.
{ "comparison": ">=", "compare_to": 10 }The operators are <, <=, ==, >=, > and !=.
On apoli:resource, compare_to also accepts an Expression, so a resource can be compared with another resource or an entity stat instead of a fixed number:
{ "comparison": ">=", "compare_to": "example:spell_cost" }Single values or lists
Many fields accept either a single value or a list. apoli:attribute takes modifier for one modifier or modifiers for several, and apoli:apply_effect takes effect as one object or an array. When a page says "single or list", both forms work.
Next
- Attribute modifier covers every operation.
- Text component covers names for powers and origins.