CoreLib Actions
Once enabled, EmakiStorage appends 5 warehouse actions to the CoreLib action registry. They can be used in other modules' rewards, triggers, scripts or action templates to move items, grant slots or adjust the per-slot ceiling.
This page only documents the actions EmakiStorage registers; for CoreLib's own generic actions see CoreLib Action System.
Every Storage action uses the source emakistorage and the category storage.
Action Overview
| Action ID | Description |
|---|---|
storage-deposit | Stores items into the acting player's warehouse. |
storage-withdraw | Withdraws items from the acting player's warehouse. |
storage-grant-slot | Grants or reclaims granted slots. |
storage-unlock-slot | Adds purchased slots without charging. |
storage-set-stacklimit | Sets the player-level or entry-level per-slot ceiling. |
All five act on the action context player and have no target parameter. All of them require that player's storage to be loaded in memory; otherwise they fail with EXECUTION_EXCEPTION and the message Storage data is not loaded for this player..
storage-deposit
Stores items into the warehouse without touching any inventory.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
item | STRING | Yes | — | CoreLib ItemSource token. |
amount | INTEGER | No | 1 | Units to store; must be positive. |
Returned data keys:
| Key | Description |
|---|---|
stored | How many units were actually stored. May be less than requested (partial deposit). |
Failure cases:
- Storage data is not loaded.
itemcannot be resolved into an ItemSource (INVALID_ARGUMENT,Unknown item source: ...).amountis not positive (INVALID_ARGUMENT,amount must be positive).- The transaction was rejected:
EXECUTION_EXCEPTIONwith the messageDeposit rejected: <reasonKey>. CommonreasonKeyvalues arefiltered(rejected by the deposit filter),unique_rejected(unique-marked item whileallow_unique_items: false),no_free_slot(a new entry is needed but slots are full) andslot_full(the per-slot ceiling is reached).
actions:
- 'storage-deposit item=diamond amount=64'storage-withdraw
Withdraws items from the warehouse and hands them to the player. Entries are located by full ItemStack#equals.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
item | STRING | Yes | — | CoreLib ItemSource token. |
amount | INTEGER | No | 1 | Units to withdraw; must be positive. |
Returned data keys:
| Key | Description |
|---|---|
withdrawn | How many units were actually withdrawn. |
Failure cases:
- Storage data is not loaded.
itemcannot be resolved (INVALID_ARGUMENT).amountis not positive (INVALID_ARGUMENT).- The transaction was rejected, with the message
Withdrawal rejected: <reasonKey>. CommonreasonKeyvalues areentry_missing(no such entry in the warehouse) andinventory_full(the inventory refused the items and, withoverflow_on_withdraw: return, the remainder was credited back).
Withdrawal debits storage before handing anything out. The reverse order would allow a successful hand-out followed by a failed debit, which is item duplication; in this order the worst case is the player receiving less than requested, and that surplus is credited straight back.
actions:
- 'storage-withdraw item=diamond amount=16'storage-grant-slot
Adjusts the granted slot pool, intended for level and codex reward flows.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
amount | INTEGER | Yes | — | Slots to grant. Negative values reclaim slots. |
Returned data keys:
| Key | Description |
|---|---|
granted_slots | The granted slot total after the adjustment. |
Failure cases:
- Storage data is not loaded.
amountis0(INVALID_ARGUMENT,amount must be non-zero).
This action writes an ADMIN_GIVE flow record, which is always logged regardless of logging.enabled and logging.sources.
actions:
- 'storage-grant-slot amount=10'
- 'storage-grant-slot amount=-5'storage-unlock-slot
Adds purchased slots without charging, for reward flows. Unlike storage-grant-slot, it increases the purchasedSlots pool, which shifts the starting ordinal for later per-slot pricing.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
amount | INTEGER | Yes | — | Slots to unlock; must be positive. |
Returned data keys:
| Key | Description |
|---|---|
purchased_slots | The purchased slot total after the adjustment. |
Failure cases:
- Storage data is not loaded.
amountis not positive (INVALID_ARGUMENT,amount must be positive).
This action writes an UNLOCK flow record with the note cost=none.
actions:
- 'storage-unlock-slot amount=5'storage-set-stacklimit
Sets the player-level or entry-level per-slot ceiling.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
limit | INTEGER | Yes | — | The new ceiling; must be >= 0. 0 inherits the next level. |
slot | INTEGER | No | -1 | Logical slot index. -1 (or any negative value) sets the player-level default. |
Returned data keys:
| Case | Key | Description |
|---|---|---|
slot negative | default_stack_limit | The player-level ceiling after the change. |
slot non-negative | slot | The slot index that was changed. |
slot non-negative | stack_limit | The entry-level ceiling after the change. |
Failure cases:
- Storage data is not loaded.
limitis negative (INVALID_ARGUMENT,limit must be zero or positive).slotis non-negative but that slot holds no entry (INVALID_ARGUMENT,No entry at slot <n>).
The meaning of 0 depends on the level: at entry and player level it inherits the next level, while 0 at the config level (capacity.default_stack_limit) means unlimited. The three-level inheritance rules are in Configuration.
This action writes an ADMIN_SET flow record, which is always logged.
actions:
- 'storage-set-stacklimit limit=100000'
- 'storage-set-stacklimit limit=5000 slot=3'
- 'storage-set-stacklimit limit=0'Related Pages
- Configuration: three-level
stackLimit, the deposit filter and per-slot pricing. - API and Integration: the code integration entry point for the same capabilities plus
StorageResultstatuses.