Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Function Experience Capsule

Recursive G edited this page Nov 30, 2017 · 4 revisions

Experience Capsule

Experience capsule allow players to store their experience into items and retrieve the exp later.

Configuration

In main config file, specify what item can be used to store exp

expCapsuleType: 'EXP_BOTTLE'

Commands

Show how much exp you have:

/nu expcap store

Store exp into item (while holding one item of specified capsule type):

/nu expcap store <amount>

Retrieve stored exp (while holding a valid capsule):

/nu expcap restore <amount>

You can also use ALL to store/restore all experience:

/nu expcap store ALL
/nu expcap restore ALL

OPs can force set stored exp amount, bypassing type & stack check:

/nu expcap set <amount>

Note that experience capsules are not "protected". If you throw the experience bottle capsule or feed the fish capsule to your cat, the experience stored will vanish.

Exp capsules can be stacked, but you cannot store/restore stacked capsules.

Permissions

nu.expcap.store
nu.expcap.restore
nu.expcap.set

Mechanism

Experience data is stored completely in lore. If your server allows lore customization, your players can create capsules with arbitrary amount of exp. The amount of exp is stored at the end of a lore line, prefixed with &e&c&a&r and any other text. So a valid line should be [arbitrary_text]&e&c&a&r[amount_integer][no_more_char_after_amount]. Never put two lines containing &e&c&a&r on one item (see source code for details.) You can create any items with such line and they will be a valid experience capsule. The restore command doesn't check item type (store will, though.)