HomeJavaModsPlayer Carpet Extension
Player Carpet Extension
ModsJava

Player Carpet Extension

by nielsplayz · on Modrinth

A complementary mod to the "Carpet Mod" that allows you to manage the player's inventory with an interface and activate the switcher between items so you…

Which Minecraft do you have?

Every version of the game needs its own build. Pick yours, then download — the wrong build installs fine and then does nothing in the game. This mod is built for Fabric only.

⬇ Download for 1.21.1–1.21.11⬇ Download for 1.20.4–1.20.6
I don't know my version or loader
Open the Minecraft launcher and look at the profile you play on — it names both, like fabric-loader-1.21.4. The version also shows in the bottom-right corner of the game's main menu.
No loader in the profile name? Then it's plain Minecraft, and these mods won't run — you need Fabric or NeoForge installed first.

🎮 Player Carpet Extension (PlayerCarpetEx)

A powerful Carpet Mod extension for Minecraft that gives server operators full control over player inventories.

banner

Minecraft 1.20.4 Fabric Carpet Mod License


📖 Overview

Player Carpet Extension is a server-side Fabric mod that extends the capabilities of Carpet Mod with advanced player inventory management tools. Designed for server administrators, SMP operators, and mapmakers, this mod provides two core features that revolutionize how you interact with player inventories on your server.

Features

What does this mod do?

This mod adds two major systems to your Minecraft server:

  1. Remote Inventory Viewing & Management — Open any player's inventory as a full GUI screen, with bidirectional synchronization. Any changes you make in the viewer are instantly applied to the target player's inventory, and vice versa. You can also use commands to give, remove, swap, set, count, compact, and drop items in any player's inventory slots.

  2. Auto-Switch Hotbar System — Automatically refills a player's hotbar when the selected slot runs out. The system pulls items from the next available hotbar slot, and if the entire hotbar is empty, it pulls from the main inventory. When everything is depleted, the main inventory locks to prevent external modifications until new items are provided.


✨ Features

🎯 Inventory GUI Viewer

Open a visual representation of any player's inventory directly in your game client. The viewer displays a 54-slot (9×6) container with a carefully organized layout that mirrors the player's actual inventory structure.

GUI Layout Structure:

The container view is divided into clearly marked sections using decorative glass panes:

Row Slots Content Description
Row 0 0–8 Offhand + Armor + Glass Slot 0 = Offhand, Slot 2 = Helmet, Slot 3 = Chestplate, Slot 4 = Leggings, Slot 5 = Boots. Blue glass panes fill the decorative positions (slots 1, 6, 7, 8).
Row 1 9–17 Hotbar The player's hotbar slots 1 through 9, displayed in order.
Row 2 18–26 Separator Gray glass panes create a visual separation between the hotbar/armor area and the main inventory.
Row 3 27–35 Main Inventory (first row) Main inventory slots 9–17.
Row 4 36–44 Main Inventory (second row) Main inventory slots 18–26.
Row 5 45–53 Main Inventory (third row) Main inventory slots 27–35.

Bidirectional Synchronization:

🔄 Auto-Switch Hotbar

The auto-switch system continuously monitors a player's selected hotbar slot and automatically refills it when it becomes empty. This is perfect for scenarios like automated farms, PvP servers, or any situation where players need continuous item supply.

Auto Switch

How the auto-switch logic works:

  1. Hotbar Check — When the selected hotbar slot is empty, the system scans the remaining hotbar slots (wrapping around) for the nearest available item. If found, it moves that item to the selected slot and notifies the player.
  2. Inventory Pull — If the entire hotbar is empty, the system searches the main inventory (slots 9–35) for any item and pulls it to the currently selected hotbar slot.
  3. Inventory Lock — When all hotbar AND main inventory slots are completely empty, the system locks the main inventory. While locked, external attempts to add items to the main inventory (from dispensers, hoppers, or other mechanisms) are blocked. Items can only be added to the hotbar.
  4. Auto-Unlock — If items are somehow detected in the locked inventory, the lock automatically releases and normal operation resumes.

📦 Installation

Requirements

Dependency Minimum Version Purpose
Minecraft 1.20.4 Target game version
Fabric Loader 0.15.0+ Mod loader
Fabric API Latest for 1.20.4 API framework
Carpet Mod 1.4.128+ Required parent mod
Java 17+ Runtime environment

Steps

  1. Install Fabric Loader — Download and install Fabric Loader for Minecraft 1.20.4.
  2. Install Fabric API — Download the Fabric API for Minecraft 1.20.4 and place it in your mods/ folder.
  3. Install Carpet Mod — Download Carpet Mod version 1.4.128 or newer and place it in your mods/ folder.
  4. Install PlayerCarpetEx — Download the PlayerCarpetEx-1.3.0.jar file and place it in your server's mods/ folder.
  5. Restart Server — Restart your Minecraft server to load all mods.

Verifying Installation

Once the server starts, you should see the following log messages:

[PlayerCarpetEx] Player Carpet Extension initialized!
[PlayerCarpetEx] Player Carpet Extension: game started.
[PlayerCarpetEx] Player Carpet Extension: server loaded.

You can also run /version or check the Carpet Mod rules list — PlayerCarpetEx will appear as a registered Carpet Extension with version 1.3.0.


🛠️ Commands

All commands require permission level 2 (operator status). The base command is /playerex.

Note: Replace <player> with the actual player name in all commands below.

Inventory Management

/playerex <player> inventory (or /playerex <player> inventory view)

Opens a visual GUI viewer displaying the target player's complete inventory (offhand, armor, hotbar, and main inventory). The GUI uses a 9×6 container with glass pane separators for clear organization.

/playerex Steve inventory

/playerex <player> inventory list

Prints a detailed text listing of the target player's inventory contents directly in chat. Shows each slot index, item name, and count, organized by hotbar and main inventory sections.

/playerex Steve inventory list

Example output:

[CarpetEx] Inventory of: Steve
[CarpetEx]  --- Hotbar (Slots 0-8) ---
[CarpetEx]    [0] Diamond Sword x1
[CarpetEx]    [1] empty
[CarpetEx]    [2] Golden Apple x16
[CarpetEx]  --- Main Inventory (Slots 9-35) ---
[CarpetEx]    [9] Oak Planks x64
[CarpetEx]    [10] Cobblestone x32

/playerex <player> inventory info <slot>

Displays detailed information about a specific inventory slot, including the item name, current count, and maximum stack size.

/playerex Steve inventory info 5

/playerex <player> inventory give <slot> <item> [count]

Places a specified item into the target player's inventory at the given slot number. If no count is specified, defaults to 1. The count can range from 1 to 64.

/playerex Steve inventory give 0 minecraft:diamond_sword 1
/playerex Steve inventory give 9 minecraft:golden_apple 64

/playerex <player> inventory remove <slot> [count]

Removes items from the target player's inventory at the specified slot. If the count matches or exceeds the current stack size, the slot is cleared entirely. Defaults to removing 1 item.

/playerex Steve inventory remove 9 32
/playerex Steve inventory remove 0

/playerex <player> inventory clear

Completely clears the target player's entire inventory (hotbar, main inventory, armor, and offhand). Use with caution.

/playerex Steve inventory clear

/playerex <player> inventory swap <slot1> <slot2>

Swaps the contents of two inventory slots in the target player's inventory. Both slot numbers must be between 0 and 40 (slot 40 = offhand).

/playerex Steve inventory swap 0 9
/playerex Steve inventory swap 36 37

/playerex <player> inventory set <slot> <item> [count]

Sets the contents of a specific slot to the specified item and count, replacing whatever was there before. Similar to give but overwrites the existing stack.

/playerex Steve inventory set 0 minecraft:netherite_sword 1

/playerex <player> inventory count <item>

Counts the total number of a specific item across all slots in the target player's inventory. Useful for quickly checking resource amounts.

/playerex Steve inventory count minecraft:diamond

Example output:

[CarpetEx] 47x Diamond

/playerex <player> inventory compact

Consolidates all stackable items in the target player's inventory by merging partial stacks into complete ones. This frees up inventory space by combining items of the same type.

/playerex Steve inventory compact

/playerex <player> inventory drop <slot>

Drops the item from the specified slot on the ground near the target player. The item is physically ejected from the inventory into the world.

/playerex Steve inventory drop 36

Auto-Switch System

/playerex <player> use switch

Toggles the auto-switch hotbar system for the target player on or off. When first enabled, the system will begin monitoring and refilling the player's selected hotbar slot automatically.

/playerex Steve use switch

/playerex <player> use switch true

Explicitly enables auto-switch for the target player.

/playerex Steve use switch true

/playerex <player> use switch false

Explicitly disables auto-switch for the target player. This also releases the inventory lock if it was active.

/playerex Steve use switch false

Slot Reference Guide

Slot Range Description
0–8 Hotbar (left to right)
9–35 Main Inventory
36 Boots
37 Leggings
38 Chestplate
39 Helmet
40 Offhand

🔧 Technical Details

Architecture

The mod is built with a clean, modular architecture consisting of four main components:

1. Commands Module (commands/)

2. Handler Module (handler/)

3. Mixin Module (mixin/)

4. Core Module

Synchronization System

The bidirectional sync system is one of the most critical parts of the mod. It ensures that both the viewing operator and the target player see a consistent inventory state at all times.

View → Target Sync:

Target → View Sync:

Initialization Guards:

Slot Mapping

The slot mapping system translates between the 54-slot view container and the 41-slot Minecraft player inventory using two lookup arrays:

This bidirectional mapping enables efficient synchronization in both directions.


🖼️ Gallery

Image Description
Banner Mod banner artwork
Inventory Layout GUI layout diagram showing the organized inventory view
Features Feature overview illustration
Auto Switch Auto-switch hotbar mechanic diagram
Screenshot In-game inventory viewer screenshot

🤝 Compatibility

Mod Compatible Notes
Carpet Mod 1.4.128+ ✅ Yes Required dependency
Fabric API ✅ Yes Required dependency
Lithium ✅ Yes Fully compatible
Sodium ✅ Yes Client-side only, no conflicts
Indium ✅ Yes Client-side only, no conflicts
ModMenu ✅ Yes Will appear in the mod list

📋 Changelog

v1.3.0 — Inventory GUI Overhaul

v1.2.0 — Auto-Switch System

v1.1.0 — Initial Inventory Commands

v1.0.0 — First Release


📄 License

This mod is released under the MIT License. You are free to use, modify, and distribute this mod in any project, provided that the original license notice is included.

MIT License

Copyright (c) 2026 PlayerCarpetEx

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

🔗 Links


Made with ❤️ for the Minecraft server administration community.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more