A slot-based inventory for Godot 4 with stacking, drag and drop, item tooltips, using items, and save data. The data and the UI are separate, so you can keep the logic and restyle the window.
Features
Itemresources. One.tresfile per item, with a name, icon, description, stack limit, rarity, value, type and optional equipment stats.- Stacking. Items stack up to their
max_stack, then spill into the next free slot. Non-stackable gear takes one slot each. - Overflow reporting.
add_item()returns how many did not fit, so you can leave the rest on the ground or show "bag full". - Drag and drop with Godot's built-in GUI drag system: drop on an empty slot to move, on the same item to stack, on a different item to swap.
- Tooltips that open next to the mouse and stay on screen, with the item name in its rarity colour and equipment stats listed.
- Using items. Right click uses an item; consumables are used up and the UI
emits
item_usedso your game can react. - Save and load.
save_data()returns a plain dictionary that refers to items by resource path, andload_data()puts it back. - Data and UI are separate.
Inventoryis a plain node with signals.InventoryUIlistens and redraws, so any number of windows can show one bag.
Requirements
- Godot 4.7 or later, standard build (GDScript only, no .NET needed).
- Tested on Godot 4.7.2 stable on Windows. Earlier 4.x versions are untested.
- Uses the Compatibility renderer, so it runs on older GPUs too.
Quick Start
- Press F5.
- Left click an item to see its details.
- Right click a potion to use it.
- Drag an item onto another slot. Drop potions on potions to stack them.
- Press 1 a few times to add loot, 2 to empty the bag, S to save the contents and L to load them back. I opens and closes the bag.
Known Limitations
- Equipment stats are shown in the tooltip but nothing equips them. Hook
item_usedup to your own equipment or stats system. - Splitting a stack (taking half) is not built in.
use()only removes one of an item when its type is Consumable. Other types are left in the bag for your game to handle.- Saves store items by resource path. Moving or renaming an item's
.tresfile breaks old saves unless you migrate them. - The demo is a UI on a plain background, not a game scene.
- Tested on Godot 4.7.2 on Windows only.
License
MIT for the code. See LICENSE.
Third-Party Assets
The item icons are from Tiny Dungeon by
Kenney, released under CC0 1.0. Details in
THIRD_PARTY_ASSETS.md, and the pack's original license is
in assets/kenney_tiny-dungeon/License.txt.
Learn How It Works
Want to understand how this works instead of just copying it?
CodingQuests teaches you how to build systems like this step by step in Godot, with interactive lessons and real projects.
- Inventory System builds this inventory from the data model up: items, slots, the UI and using items. Free, 10 lessons.
- Advanced Inventory UI carries on with an equipment paper doll, a hotbar, sorting and tooltips that compare gear. It is part of the paid Guild Hall membership.
Source code, integration instructions and issue tracker: https://github.com/CodingQuests/godot-inventory-system
Changelog for version 1.0.0
2026-10-17 01:29:09
No changelog provided for this version.