Reference: Relics

The relic system spans four registry types, all SyncTime.ON_LOGIN.


RelicType

Registry type: LibDatabase.RELIC_TYPE (library_of_exile_relic_type, order 1)

Serialized fields

Field Type Default Description
id String GUID
item_id String "" ResourceLocation of the Forge-registered Item
weight int 1000 Selection weight
max_equipped int 3 Max number of this type a player can equip simultaneously

Transient fields (not in JSON)

Field Set by
name Translation system
modid Registration

Key method

Item getItem()   // resolves item_id against ForgeRegistries.ITEMS

Datapack folder: data/<namespace>/library_of_exile_relic_type/


RelicRarity

Registry type: LibDatabase.RELIC_RARITY (library_of_exile_relic_rarity, order 3)

Serialized fields

Field Type Default Description
base_data BaseRarityData see below Core rarity properties
affixes int 0 Number of affixes rolled onto relics of this rarity
min_affix_percent int 0 Minimum roll percentage for each affix
max_affix_percent int 100 Maximum roll percentage for each affix

BaseRarityData fields

Field Type Description
id String GUID
text_format String ChatFormatting name (e.g. "GRAY", "GOLD", "AQUA")
tier int Numeric tier for sorting/comparison
weight int Selection weight

Built-in rarities

Key id tier weight affixes min% max%
COMMON common 0 5000 1 0 25
UNCOMMON uncommon 1 2500 1 5 50
RARE rare 2 1000 1 10 65
EPIC epic 3 750 2 15 80
LEGENDARY legendary 4 250 2 20 100
MYTHIC mythic 5 100 3 25 100

Datapack folder: data/<namespace>/library_of_exile_relic_rarity/


RelicStat

Registry type: LibDatabase.RELIC_STAT (library_of_exile_relic_stat, order 0)

Abstract. Uses a custom-serializer (GsonCustomSer) pattern.

Common serialized fields

Field Type Default Description
id String GUID
serializer String Type discriminator
is_percent boolean true Whether the value is a percentage
min float 0 Minimum possible value
max float 1000 Maximum possible value
base float 0 Default value when no affix provides this stat

Subclasses

ManualRelicStatserializer: "manual_stat"

Generic stat. No extra fields.

ContentWeightRSserializer: "content_weight"

Extra field Type Description
map_content_id String GUID of the map_content entry whose weight is boosted

ExtraContentRSserializer: "extra_content"

Extra field Type Description
map_content_id String GUID of the map_content entry to add extra rolls of
data.type "ADDITION" | "MULTIPLY" How extra rolls are applied
data.extra int Number of extra rolls per stat point

Datapack folder: data/<namespace>/library_of_exile_relic_stat/


RelicAffix

Registry type: LibDatabase.RELIC_AFFIX (library_of_exile_relic_affix, order 2)

Serialized fields

Field Type Default Description
id String GUID
weight int 1000 Selection weight
relic_type String "" GUID of the RelicType this affix applies to
mods List<RelicMod> [] List of stat modifications

RelicMod fields

Field Type Description
stat String GUID of the RelicStat
min float Minimum stat value for this roll
max float Maximum stat value for this roll

Runtime API

// Roll a specific mod at a given percentage:
ExactRelicStat exact = relicMod.toExact(int perc);   // linear interpolation

// Aggregate all rolled mods into a container for lookup:
RelicStatsContainer container = RelicStatsContainer.calculate(List<ExactRelicStat> mods);

float value = container.get(RelicStat statInstance);
float value = container.get(ExileKey<RelicStat, ?> key);

Datapack folder: data/<namespace>/library_of_exile_relic_affix/


RelicItem

com.robertx22.library_of_exile.database.relic.relic_type.RelicItem

Minimal Item subclass for use as relic items.

public RelicItem() {
    super(new Properties().stacksTo(1));
}

Subclass it to add custom tooltips, use behaviour, or renderer hooks.