
Inventory
InventoryKit
scriptgo//inventory-kit
Slot and weight inventories with stacking, unique items, moves, use events and persistence.
Runs on · 1.0.2
Godot 4
VerifiedPassed in the real runtime (scriptgo verify).
- Release
- 1.0.2
- Tested
LÖVE
VerifiedPassed in the real runtime (scriptgo verify).
- Release
- 1.0.2
- Tested
Luanti
VerifiedPassed in the real runtime (scriptgo verify).
- Release
- 1.0.2
- Tested
Neovim
VerifiedPassed in the real runtime (scriptgo verify).
- Release
- 1.0.2
- Tested
OPEN//77
VerifiedPassed in the real runtime (scriptgo verify).
- Release
- 1.0.2
- Tested
Standalone Lua
VerifiedPassed in the real runtime (scriptgo verify).
- Release
- 1.0.2
- Tested
CC: Tweaked (Minecraft)
FailingThe last run failed.
- Release
- 1.0.2
- Tested
InventoryKit
Server-authoritative player inventories: slots, a weight limit, stacking, unique items, moves, use events and persistence. Clients get a mirror of their own inventory and send requests; the server validates every one of them.
- Slots and weight: 24 slots and 30 weight units by default, both configurable.
- Stacking up to each item's
stack; items given ametatable are unique and never stack. - Use events:
usableitems firesg_inventory:used;consumeitems lose one per use. - Persistence per player identifier, so an inventory survives reconnects and restarts.
- Rate limits on client requests (10 per second per player).
Install
scriptgo add scriptgo//inventory-kit-- scriptgo.lua of your resource
dependency "sg_inventory >=1.0.0"Example
A starter kit for every player who joins. This block is the README example that scriptgo verify
runs next to the package in every environment; hosts with a (simulated) player show the whole
exchange, hosts without one show only the item definition.
local inv = exports.sg_inventory
-- Items come from the config ("items") or are added at runtime, like this one. Exports are called
-- from a thread or a handler, never at file scope (resource_preparing).
CreateThread(function()
print(inv:defineItem({ name = "medkit", label = "Medkit", weight = 1.0, stack = 3, usable = true, consume = true }))
end)
AddEventHandler("sg_inventory:used", function(playerId, item)
print(("player %d used a %s"):format(playerId, item))
end)
AddEventHandler("playerJoining", function()
local playerId = source
print(inv:add(playerId, "medkit", 2)) -- true
print(inv:add(playerId, "medkit", 50)) -- false too_heavy
print(("player %d has %d medkits"):format(playerId, inv:count(playerId, "medkit")))
for _, it in ipairs(inv:getInventory(playerId).items) do
if it.name == "medkit" then print(inv:use(playerId, it.slot)) break end
end
end)Server API
Call these through exports.sg_inventory:<name>(...).
| Export | Returns |
|---|---|
defineItem(def) |
true, or false, reason |
items() |
every item definition, sorted by name |
getInventory(playerId) |
{ slots, maxWeight, weight, items = { { slot, name, label, count, meta, weight, usable } } } |
count(playerId, name) |
how many the player holds (0 for an unknown player) |
add(playerId, name, count?, meta?) |
true, or false, reason |
remove(playerId, name, count?) |
true, or false, reason |
move(playerId, from, to, count?) |
true, or false, reason |
use(playerId, slot) |
true, or false, reason |
clear(playerId) |
true, or false, reason |
An item definition: { name, label?, weight?, stack?, usable?, consume?, category?, description? }.
name matches ^[a-z0-9_]+$, up to 48 characters.
Reasons: unknown_player, unknown_item, invalid_count, too_heavy, no_space,
not_enough, empty_slot, not_usable, invalid_slot, stack_full, slot_occupied, and for
defineItem invalid_item, invalid_item_name, invalid_label, invalid_weight,
invalid_stack.
Events
| Event (server bus) | Arguments |
|---|---|
sg_inventory:changed |
playerId, { item, delta, reason? } (or { cleared = true }) |
sg_inventory:used |
playerId, name, slot, meta |
Command
giveitem <playerId> <item> [count], for players holding the privilege inventory.give
(through PermissionsKit when it runs, otherwise the host's own privileges). The console always may.
Client API
| Export | Does |
|---|---|
getState() |
the last snapshot the server sent |
count(name) |
count in that snapshot |
move(from, to, count?), use(slot), refresh() |
requests to the server |
lastRefusal() |
the last refused request and its reason |
Client events: sg_inventory:updated(state), sg_inventory:itemUsed(name).
Configuration
| Key | Default | Meaning |
|---|---|---|
slots |
24 |
slots per player |
maxWeight |
30 |
weight limit |
items |
water, bread, bandage, rope, scrap, coin, toolbox | the item list |
License
MIT.
With the CLI
scriptgo add scriptgo//inventory-kitManual download
Zip of 1.0.2 · 9.9 KiB. Check the SHA-256 before unpacking.
Download sg_inventory-1.0.2.zipsha256 db05ccd741613f9f598670361d7dd4d4de22cd3b3055e47b2aed9bc9b4f39440
Set it up
| Environment | Status | Tested | Details |
|---|---|---|---|
| Godot 4 | Verified | Godot 4 VerifiedPassed in the real runtime (scriptgo verify).
| |
| LÖVE | Verified | LÖVE VerifiedPassed in the real runtime (scriptgo verify).
| |
| Luanti | Verified | Luanti VerifiedPassed in the real runtime (scriptgo verify).
| |
| Neovim | Verified | Neovim VerifiedPassed in the real runtime (scriptgo verify).
| |
| OPEN//77 | Verified | OPEN//77 VerifiedPassed in the real runtime (scriptgo verify).
| |
| Standalone Lua | Verified | Standalone Lua VerifiedPassed in the real runtime (scriptgo verify).
| |
| CC: Tweaked (Minecraft) | Failing | CC: Tweaked (Minecraft) FailingThe last run failed.
|
This release
- Signature
- ed25519, registry key 95f9 01ba 64d0 898a · signed 10 Nov 2026It covers the package, the version and the SHA-256 of the file you download.
scriptgo addrefuses a file that does not match.
What your server gets, per environment
| Environment | Tier there | For this release |
|---|---|---|
| Lua Standalone | Licence + signingAvailable today. | Free package. No licence is needed. The registry's signature shows the release was not altered. |
| LÖVE | Licence + signingAvailable today. | Free package. No licence is needed. The registry's signature shows the release was not altered. |
| Godot 4 | Licence + signingPlanned, not available yet. | Free package. No licence is needed. The registry's signature shows the release was not altered. |
| Luanti | Licence + signingAvailable today. | Free package. No licence is needed. The registry's signature shows the release was not altered. |
| OPEN//77 | Code escrowAvailable as an opt-in server feature. | Free package. No licence is needed. The registry's signature shows the release was not altered. |
| Neovim | Licence + signingAvailable today. | Free package. No licence is needed. The registry's signature shows the release was not altered. |
| CC: Tweaked (Minecraft) | No licence check | No licence check. The adapter there has no licence check, so nothing verifies a licence at run time. The release is signed, so you can check it was not altered. |
The platforms’ own rules
For information: whoever runs a script there answers for the platform's own rules.
- OPEN//77: A script is your own code. CD PROJEKT RED's own rules cover the game's content.
- CC: Tweaked (Minecraft): The Minecraft EULA lets you do what you want with your mods "as long as you don't sell them for money" (minecraft.net/en-us/eula).
Deterrence, traceability and revocation: only server scripts are protected, and a copy stays traceable. What protection does and does not do
sha256 db05ccd741613f9f598670361d7dd4d4de22cd3b3055e47b2aed9bc9b4f39440
- Declares Neovim: verified inside Neovim 0.12 through the SCRIPT//GO plugin.
- Code license
- MIT
No offers. Use the package under its code license (MIT).
Sold by SCRIPT//GO. No payment provider connected. License issued by SCRIPT//GO.
A license is granted only on a verified payment event.Who does what
- Declared
- 10 Nov 2026
- Ownership
- The creator states they own this code or are authorized to distribute it.
- Third-party game
- Does not target or include proprietary third-party game content.
Third-party assets
No third-party assets declared.
Dependencies
No dependencies.
Think this package infringes your rights? Report it. No account needed.
Data from the SCRIPT//GO API. Only recorded runs count.

