Compatibility
Minecraft: Java Edition
Platforms
Supported environments
Links
Tags
Creators
Details
🎒 Shared Inventory — Cross-Server Inventory, Ender Chest & XP Sync
Share your inventory, ender chest, and experience points across multiple Fabric servers in real time.
💾 Powered by PostgreSQL — data is permanently written to disk. Even if the server crashes, your items are safe.
✨ Features
- 🔄 Real-time sync — Changes are detected within 1 tick (50ms) and instantly saved
- 🌐 Cross-server — Works across servers running on completely different PCs
- 💾 Persistent storage — PostgreSQL writes to disk immediately. No data loss on power failure
- 📴 Offline sync — Players automatically receive the latest data when logging into a server that was offline
- 🛡️ Startup protection — Server refuses to start if the database is unreachable, with a detailed error log
- ⚙️ Per-feature toggle — Inventory / Ender Chest / XP can each be enabled or disabled individually per server
📋 Requirements
- Minecraft 1.20.1
- Fabric Loader 0.15.0+
- Fabric API
- PostgreSQL (free, self-hosted — setup guide below)
🚀 Installation
📦 Step 1 — Install PostgreSQL (click to expand)
PostgreSQL is a free, open-source database that runs as a background service and saves data safely to disk.
Windows
-
Download the installer from https://www.postgresql.org/download/windows/ → Click "Download the installer" → Select the latest Windows x86-64
-
Run the installer
- Keep all defaults
- Set a password — you will need this later
- Leave the port as
5432 - After installation, PostgreSQL starts automatically as a Windows service ✅
- pgAdmin 4 (a GUI tool) is also installed automatically
-
Open pgAdmin 4 from the Start Menu
-
In the left sidebar, click the terminal icon (PSQL Tool)
-
Enter your password to log in → you will see the
postgres=#prompt -
Run the following command:
CREATE DATABASE sharedinventory;→ If you see
CREATE DATABASE, you are done! ✅
Linux (Ubuntu/Debian)
sudo apt update
sudo apt install postgresql postgresql-contrib
sudo systemctl enable postgresql
sudo systemctl start postgresql
sudo -u postgres psql -c "CREATE DATABASE sharedinventory;"
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'yourpassword';"
🗂️ Step 2 — Install the Mod (click to expand)
- Download
shared-inventory-2.0.0.jar - Place it in your server's
mods/folder - Make sure Fabric API is also in your
mods/folder - The PostgreSQL JDBC driver is bundled inside the mod — no extra files needed ✅
⚙️ Step 3 — Configure (click to expand)
Start the server once — the config file will be auto-generated at:
config/shared-inventory.json
Edit it with your PostgreSQL connection info:
{
"database": {
"host": "localhost",
"port": 5432,
"name": "sharedinventory",
"user": "postgres",
"password": "YOUR_PASSWORD_HERE"
},
"sync": {
"inventory": true,
"ender_chest": true,
"experience": true
},
"behavior": {
"save_interval_ticks": 200
}
}
Restart the server. If you see this in the log, everything is working:
[SharedInventory] PostgreSQL connection successful!
[SharedInventory] Initialization complete! Ready to sync.
🖥️ Multi-PC Setup — Different Computers (click to expand)
If your servers run on different PCs, all of them must point to the same single PostgreSQL instance.
On the PC running PostgreSQL:
-
Edit
postgresql.conf:listen_addresses = '*'Location:
C:\Program Files\PostgreSQL\18\data\postgresql.conf -
Edit
pg_hba.confand add at the bottom:host all all 0.0.0.0/0 md5 -
Restart PostgreSQL and open port
5432in your firewall- Windows Firewall → allow inbound on port 5432
On each Minecraft server's config:
Minecraftserver/config/shared-inventory.json
Set host to the IP address of the PC running PostgreSQL:
"host": "PostgreSQL IP"
📊 Config Reference (click to expand)
| Key | Default | Description |
|---|---|---|
database.host |
localhost |
PostgreSQL server address |
database.port |
5432 |
PostgreSQL port |
database.name |
sharedinventory |
Database name |
database.user |
postgres |
Username |
database.password |
password |
Password |
sync.inventory |
true |
Sync main inventory |
sync.ender_chest |
true |
Sync ender chest |
sync.experience |
true |
Sync experience (level & XP bar) |
behavior.save_interval_ticks |
200 |
Periodic save interval (20 ticks = 1 sec) |
Changes are detected every tick.
save_interval_ticksonly controls the forced periodic save for players with no recent changes.
❗ Troubleshooting (click to expand)
Server won't start — "Cannot connect to PostgreSQL"
- Check that PostgreSQL is running
- Windows:
services.msc→postgresql-x64-18should show "Running" - Linux:
sudo systemctl status postgresql
- Windows:
- Check the password in
config/shared-inventory.json - Make sure the database
sharedinventoryhas been created
Password authentication failed
- The
passwordfield in your config does not match your PostgreSQL password - Open
config/shared-inventory.jsonand correct thepasswordfield
📄 License — MIT
🎒 Shared Inventory — 複数サーバー間インベントリ・エンダーチェスト・経験値リアルタイム同期
複数のFabricサーバー間で、インベントリ・エンダーチェスト・経験値をリアルタイムに共有します。
💾 PostgreSQL を使用しているため、データはディスクに永続保存されます。サーバーがクラッシュしてもアイテムは失われません。
✨ 特徴
- 🔄 リアルタイム同期 — 変化を1tick(50ms)以内に検出し、即座にDBへ保存
- 🌐 クロスサーバー対応 — 別々のPCで動作している複数サーバー間でも同期可能
- 💾 永続ストレージ — PostgreSQL は書き込みを即座にディスクに記録。突然の電源断でもデータは安全
- 📴 オフライン同期 — サーバーがオフラインだった間の変化も、次回ログイン時に自動で最新データを適用
- 🛡️ 起動時保護 — DBへの接続に失敗した場合、サーバーの起動を拒否して詳細なエラーをログに出力
- ⚙️ 機能ごとのON/OFF — インベントリ・エンダーチェスト・経験値をサーバーごとに個別に有効/無効化可能
📋 動作要件
- Minecraft 1.20.1
- Fabric Loader 0.15.0+
- Fabric API
- PostgreSQL(無料・自己ホスト型DB、下記セットアップ参照)
🚀 導入方法
📦 STEP 1 — PostgreSQL のインストール(クリックで展開)
PostgreSQL は無料のオープンソースDBです。バックグラウンドサービスとして動作し、データをディスクに安全に保管します。
Windows の場合
-
インストーラーをダウンロード https://www.postgresql.org/download/windows/ → 「Download the installer」 → 最新版の Windows x86-64 を選択
-
インストーラーを実行
- 全ての項目はデフォルトのままでOK
- パスワードは必ず設定する(後でコンフィグに入力します)
- ポートは
5432のまま - インストール完了後、PostgreSQL はWindowsサービスとして自動起動します ✅
- pgAdmin 4(GUI管理ツール)も同時に自動インストールされます
-
スタートメニューから pgAdmin 4 を起動
-
左側のサイドバーにあるターミナルアイコン(PSQL Tool)をクリック
-
パスワードを入力してログイン →
postgres=#が表示される -
以下を入力して Enter を押す
CREATE DATABASE sharedinventory;→
CREATE DATABASEと表示されれば成功 ✅
Linux(Ubuntu/Debian)の場合
# インストール
sudo apt update
sudo apt install postgresql postgresql-contrib
# 自動起動の設定
sudo systemctl enable postgresql
sudo systemctl start postgresql
# データベースの作成
sudo -u postgres psql -c "CREATE DATABASE sharedinventory;"
# パスワードの設定(yourpassword を変更してください)
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'yourpassword';"
🗂️ STEP 2 — Mod のインストール(クリックで展開)
shared-inventory-2.0.0.jarをダウンロード- サーバーの
mods/フォルダに入れる - Fabric API も
mods/フォルダに入っていることを確認 - PostgreSQL の JDBC ドライバは Mod内にバンドル済み のため、追加ファイルは不要 ✅
⚙️ STEP 3 — コンフィグの設定(クリックで展開)
サーバーを一度起動すると、以下のパスにコンフィグファイルが自動生成されます:
config/shared-inventory.json
テキストエディタで開き、PostgreSQLの接続情報を入力します:
{
"database": {
"host": "localhost",
"port": 5432,
"name": "sharedinventory",
"user": "postgres",
"password": "STEP1で設定したパスワード"
},
"sync": {
"inventory": true,
"ender_chest": true,
"experience": true
},
"behavior": {
"save_interval_ticks": 200
}
}
保存してサーバーを再起動します。ログに以下が表示されれば成功です:
[SharedInventory] PostgreSQL への接続成功!
[SharedInventory] 初期化完了! 同期の準備ができました。
🖥️ 複数PCでサーバーを動かす場合の追加設定(クリックで展開)
異なるPCでサーバーを動かす場合、すべてのサーバーが同じ1台のPostgreSQLを参照するよう設定します。
PostgreSQL がインストールされているPC側の設定:
-
postgresql.confを編集:listen_addresses = '*'ファイルの場所(Windows):
C:\Program Files\PostgreSQL\18\data\postgresql.confファイルの場所(Linux):/etc/postgresql/*/main/postgresql.conf -
pg_hba.confの末尾に以下を追加:host all all 0.0.0.0/0 md5 -
PostgreSQL を再起動し、ファイアウォールでポート
5432を開放- Windows: Windowsファイアウォール → ポート5432を受信許可
各Minecraftサーバーのコンフィグ:
Minecraftserver/config/shared-inventory.json
host を PostgreSQL が動いているPCのIPアドレスに変更:
"host": "PostgreSQL IP"
📊 コンフィグ項目一覧(クリックで展開)
| 項目 | デフォルト値 | 説明 |
|---|---|---|
database.host |
localhost |
PostgreSQLサーバーのアドレス |
database.port |
5432 |
ポート番号 |
database.name |
sharedinventory |
データベース名 |
database.user |
postgres |
ユーザー名 |
database.password |
password |
パスワード |
sync.inventory |
true |
メインインベントリの同期 |
sync.ender_chest |
true |
エンダーチェストの同期 |
sync.experience |
true |
経験値(レベル・XPバー)の同期 |
behavior.save_interval_ticks |
200 |
定期保存の間隔(20tick = 1秒) |
変化の検出は毎tick行われます。
save_interval_ticksは変化がなかった場合の強制保存間隔です。
❗ トラブルシューティング(クリックで展開)
「PostgreSQL に接続できません」と出てサーバーが起動しない
- PostgreSQL が起動しているか確認
- Windows:
services.msc→postgresql-x64-18が「実行中」か確認 - Linux:
sudo systemctl status postgresql
- Windows:
config/shared-inventory.jsonのパスワードを確認- データベース
sharedinventoryが作成されているか確認
「パスワード認証に失敗しました」というエラーが出る
config/shared-inventory.jsonのpasswordが間違っています- PostgreSQL のインストール時に設定したパスワードを正確に入力してください


