FabricSharedInventory

FabricSharedInventory

Share inventory across multiple servers

by
77 Downloads
fabricgame-mechanicsstorageutility
Rent Server with this Mod

About this Mod

🎒 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

  1. Download the installer from https://www.postgresql.org/download/windows/
    → Click "Download the installer" → Select the latest Windows x86-64

  2. 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
  3. Open pgAdmin 4 from the Start Menu

  4. In the left sidebar, click the terminal icon (PSQL Tool)

  5. Enter your password to log in → you will see the postgres=# prompt

  6. 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)
  1. Download shared-inventory-2.0.0.jar
  2. Place it in your server's mods/ folder
  3. Make sure Fabric API is also in your mods/ folder
  4. 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:

  1. Edit postgresql.conf:

    listen_addresses = '*'
    

    Location: C:\Program Files\PostgreSQL\18\data\postgresql.conf

  2. Edit pg_hba.conf and add at the bottom:

    host    all    all    0.0.0.0/0    md5
    
  3. Restart PostgreSQL and open port 5432 in 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_ticks only 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.mscpostgresql-x64-18 should show "Running"
    • Linux: sudo systemctl status postgresql
  • Check the password in config/shared-inventory.json
  • Make sure the database sharedinventory has been created

Password authentication failed

  • The password field in your config does not match your PostgreSQL password
  • Open config/shared-inventory.json and correct the password field

📄 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 の場合

  1. インストーラーをダウンロード
    https://www.postgresql.org/download/windows/
    「Download the installer」 → 最新版の Windows x86-64 を選択

  2. インストーラーを実行

    • 全ての項目はデフォルトのままでOK
    • パスワードは必ず設定する(後でコンフィグに入力します)
    • ポートは 5432 のまま
    • インストール完了後、PostgreSQL はWindowsサービスとして自動起動します ✅
    • pgAdmin 4(GUI管理ツール)も同時に自動インストールされます
  3. スタートメニューから pgAdmin 4 を起動

  4. 左側のサイドバーにあるターミナルアイコン(PSQL Tool)をクリック

  5. パスワードを入力してログイン → postgres=# が表示される

  6. 以下を入力して 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 のインストール(クリックで展開)
  1. shared-inventory-2.0.0.jar をダウンロード
  2. サーバーの mods/ フォルダに入れる
  3. Fabric APImods/ フォルダに入っていることを確認
  4. 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側の設定:

  1. postgresql.conf を編集:

    listen_addresses = '*'
    

    ファイルの場所(Windows): C:\Program Files\PostgreSQL\18\data\postgresql.conf
    ファイルの場所(Linux): /etc/postgresql/*/main/postgresql.conf

  2. pg_hba.conf の末尾に以下を追加:

    host    all    all    0.0.0.0/0    md5
    
  3. 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.mscpostgresql-x64-18 が「実行中」か確認
    • Linux: sudo systemctl status postgresql
  • config/shared-inventory.json のパスワードを確認
  • データベース sharedinventory が作成されているか確認

「パスワード認証に失敗しました」というエラーが出る

  • config/shared-inventory.jsonpassword が間違っています
  • PostgreSQL のインストール時に設定したパスワードを正確に入力してください

📄 ライセンス — MIT

Available Versions

Fabric Shared Inventory 2.0.0release
MC 1.20.1fabric
February 19, 2026

How to Install FabricSharedInventory on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set fabric Loader

In the panel under "Egg", select the fabric loader and matching Minecraft version (1.20.1).

3

Install Mod

Open the mod browser in the dashboard and search for "FabricSharedInventory". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

fabric

Minecraft Versions

1.20.1

Server-side

Required

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

FabricSharedInventory server crashes on startup – what to do?

Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.20.1). You can switch loaders with one click in the panel.

Is FabricSharedInventory compatible with fabric?

FabricSharedInventory officially supports fabric for Minecraft 1.20.1. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with FabricSharedInventory – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if FabricSharedInventory consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install FabricSharedInventory with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
MIT License
Server-side
Required

Supported Versions

1.20.1