Rarity System & Slot Presentation

Rarity System & Slot Presentation

Opt-in rarity, metadata override and current levels.

Applies to: Nord Inventory v2.0.0

Item Rarities

Nord Inventory includes an opt-in rarity presentation system for item definitions and individual item instances.

Important: rarity is disabled by default

An item only has rarity when its definition explicitly contains a valid rarity value, or when an individual instance provides metadata.rarity and metadata overrides are enabled.

This item has no rarity:

['water'] = {
    label = 'Water',
    weight = 500
}

This item has rarity enabled:

['special_key'] = {
    label = 'Special Key',
    weight = 5,
    rarity = 'rare'
}

Config.Rarities.Default is only the level selected when rarity is enabled in Admin Studio. It is not automatically applied to all items.

Slot presentation

When rarity is enabled on an item:

Creating rarity levels, icons and colors

Edit config/rarities.lua:

Config.Rarities.Levels = {
    rare = {
        label = 'Rare',
        color = '#4f8cff',
        icon = 'fa-gem',
        order = 3
    },

    mythic = {
        label = 'Mythic',
        color = '#ff4fd8',
        icon = 'fa-star',
        order = 6
    }
}

icon uses a Font Awesome Free Solid icon class. Examples:

fa-circle
fa-leaf
fa-gem
fa-star
fa-crown
fa-diamond
fa-wand-magic-sparkles

New configured levels automatically appear in Admin Studio → Item Management → Rarity.

Admin Studio

Rarity now has its own page in the item editor.

The page contains:

New items start with rarity disabled.

Runtime registration

exports.nord_inventory:RegisterItem('special_key', {
    label = 'Special Key',
    weight = 5,
    rarity = 'legendary'
})

To register an item without rarity, simply omit the field.

Instance rarity override

When Config.Rarities.AllowMetadataOverride = true, a specific item instance may provide its own rarity:

exports.nord_inventory:AddItem(source, 'special_key', 1, {
    rarity = 'legendary'
})

This lets one physical instance have a rarity identity without requiring another item definition.

Rarity remains presentation-first

Rarity does not automatically change:

Other resources may read the rarity value and build gameplay rules on top of it if desired.

Slot background behavior

When rarity is enabled on an item, the slot background itself uses the configured rarity color.

Rarity does not control:

Those remain controlled by the player's normal inventory customization.

The implementation intentionally avoids CSS color-mix() for the slot background so the result remains reliable in FiveM CEF builds.

Slot opacity integration

When a rarity is enabled on an item, the slot uses the same transparency/opacity system as the player inventory editor.

This means:

In practice, the normal slot background:

rgb(8 8 13 / var(--user-slot-opacity))

is replaced by the rarity color equivalent:

rgb(R G B / var(--user-slot-opacity))

So the opacity behavior remains the same and only the base color comes from the rarity definition.

Slot opacity behavior with rarity

The rarity slot background keeps its rarity color/tint, but all of its background layers now obey the same player Slot opacity slider used by normal slots.

This means:

Current configured levels


Revision #1
Created 2026-09-30 01:04:35 UTC by Riguita
Updated 2026-09-30 01:04:36 UTC by Riguita