Item Commander

Item Commander

A simple Serverside Fabric mod that allows you to assign commands to Item(Stacks)

by
6.7K Downloads
fabricquiltcursedmanagementutility
Rent Server with this Mod

Screenshots

Commander Item displayed w/NBTToolt
A nice sky

About this Mod

Item Commander

Shiny item do stuff

A simple Serverside Fabric mod that allows you to assign commands to Item(Stacks).
It works by adding NBT data to the item, then when a player uses an item the NBT data for that item is checked, if it contains the ItemCommander tag tree it executes the specified command.

To embed a command in an item, hold it in your main hand and run /commander create "<command>" [CONSUME_ACTION] [COMMAND_SOURCE] [cooldownTicks] [CustomItemNBT]

consume actions:

Action Description
CONSUME Consumes the item
KEEP Keeps the item

command sources:

Action Description
SERVER Command executed by the server
PLAYER Command executed by the player
OP Command executed by the player with OP
SERVER_AS_PLAYER Command executed by the server as the player (like OP)
DANGEROUSLY_OP Command executed by the player whilst being OP ⚠️

defaults in bold*

Command placeholders

when creating a command you can use the following vanilla-like placeholders:

Placeholder Action
@itemname Item Name
@pich Player pitch
@yaw Player yaw
@ix Item use X coordinate
@iy Item use Y coordinate
@iz Item use Z coordinate
@x Player use X coordinate
@y Player use Y coordinate
@z Player use Z coordinate
@p and @s The player using the Commander Item

To append more commands to one item, hold a Commander Item in your main hand and run /commander append "<command>"
To save a Commander Item, hold it in your main hand and run /commander save <fileName>
To load/give a Commander Item, run /commander give <fileName> [quantity] [player(s)]

This mod supports Patbox' Text Placeholders API.

  • You can use %modid:type% or %modid:type/data% inside a Commander Item to make use of a custom placeholder
  • Example: commander create

This mod supports LuckPerms' Fabric Permission API.

  • commander.command.create allows a player to use this mod to embed commands in items
  • commander.command.append allows a player to use this mod to append commands to Commander Items
  • commander.command.give allows a player to use this mod to give itself Commander Items
  • commander.command.save allows a player to use this mod to save Commander Items to a file on the server

Examples

Creating a Commander Item

/commander create "say Hello myself (@s), you clicked at @ix, @iy, @iz!" KEEP OP 20 paper{display:{Name:'[{"text":"Commander Test Item!","italic":false}]'}}

Appending an extra command to a Commander Item

/commander append "If you have Text Placeholder API, this will be your name: %player:name%"

Saving a Commander Item

/commander save commander_test_item 

Giving/loading a saved item to a player

/commander give commander_test_item 1 @p

Bleeding edge builds

Upstream builds are available via GitHub Actions.


Setup

For setup instructions please see the fabric wiki page that relates to the IDE that you are using.

License

This template is available under the CC0 license. Feel free to learn from it and incorporate it in your own projects.

Available Versions

v1.6.2 - Fix Text Placeholders API supportrelease
MC 1.20.3, 1.20.4fabric, quilt
January 23, 2024
v1.6.2 - Fix Text Placeholders API supportrelease
MC 1.20, 1.20.1, 1.20.2fabric, quilt
January 23, 2024
v1.6.1 - Two new command context for better compatabilityrelease
MC 1.20.3, 1.20.4fabric
January 13, 2024
v1.6.1 - Two new command context for better compatabilityrelease
MC 1.20, 1.20.1, 1.20.2fabric, quilt
January 13, 2024
v1.6.0 - 1.20.x, OP context, PlaceholderAPI-free + QoL/Fixes!release
MC 1.20.3, 1.20.4fabric, quilt
January 12, 2024

How to Install Item Commander 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.21.1).

3

Install Mod

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

Compatibility

Mod Loaders

fabricquilt

Minecraft Versions

1.21.1, 1.21, 1.20.6 (+9 more)

Server-side

Required

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

Item Commander 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.21.1). You can switch loaders with one click in the panel.

Is Item Commander compatible with fabric and quilt?

Item Commander officially supports fabric, quilt for Minecraft 1.21.1, 1.21, 1.20.6. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with Item Commander – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if Item Commander 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 Item Commander 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
Creative Commons Zero v1.0 Universal
Server-side
Required

Supported Versions

1.21.11.211.20.61.20.51.20.41.20.31.20.21.20.11.201.18.2+2 more