Defining a power in JSON - apace100/origins-fabric GitHub Wiki
Powers can now be defined in JSON files (since v0.4.0)!
That means you can change and add powers via data packs.
In order for the game to load powers, they have to go in the correct path of the data pack. The full path of a power file should look like this: data/<namespace>/powers/<power_id>.json
.
By default, a power JSON only has a few fields:
type
, string: The most important field. ID of a power type, defining how this power behaves and which other fields are required. See List of power types for a list of which values this field may take.
hidden
, boolean, default = false: If set to true, this power will not show up in the list of powers an origin has.
loading_priority
, integer, default = 0: Powers with higher loading priority override powers registered under the same ID with a lower loading priority. Use a value greater than 0 if you want to override powers added by the mod itself.
name
, string, optional: When defined, this is the translation key (or literal text) that will be used as the name of the power, instead of the default generated one.
description
, string, optional: When defined, this is the translation key (or literal text) that will be used as the description of the power, instead of the default generated one.
condition
, Entity Condition, optional: Most power types (except those where stated otherwise) support an entity condition which the player needs to fulfill in order for the power to be active.
For all other fields which define more specific functionality of a power, you will have to look at the wiki page corresponding to the power type you want to use.