How to Make an Item That Runs Commands on Right Click in Minecraft (2026)
Short answer: vanilla Minecraft cannot run a command when a player right-clicks an item without hacks, so you need a plugin. With ExecutableItems (free version available) you write one activator, option: PLAYER_RIGHT_CLICK, list your commands under playerCommands, and add a cooldown with cooldownFeatures and a permission with ifHasPermission. If you prefer writing scripts, Denizen and Skript are free; MMOItems has a Commands stat for RPG items.
We make ExecutableItems, so this guide uses it for the full example. The alternatives below are described from their own documentation, checked on 26 November 2026.
Why vanilla can't do it cleanly
Vanilla Java Edition has no item option that says "run this command when used". The usual data pack trick counts the minecraft.used statistic: the Minecraft Wiki lists the use key on a carrot on a stick or a warped fungus on a stick as a "use". A scoreboard objective on that statistic plus a function that checks it every tick lets you react to the click.
It works, but:
- only on the few items that count a use without placing or consuming anything;
- the function runs every tick, for every player;
- permissions, cooldowns, messages and "only when clicking a block" are yours to build in commands.
For one map or a minigame, a data pack is fine. For a survival or RPG server with many items, a plugin is simpler.
The options at a glance
| Tool | How you write it | Price | Cooldown | Permission check | Server software |
|---|---|---|---|---|---|
| ExecutableItems | YAML or in-game editor (/ei editor) | Free version; premium 19.99 EUR one-time | Built in (cooldownFeatures, global cooldown, bypass permission) | Built in (ei.item.<id>, ifHasPermission) | Spigot, Paper, Folia |
| Denizen | Scripts (player right clicks block with:<item>) | Free, MIT | You script it | You script it | Spigot 1.17.1 to 26.3 per its README |
| Skript | Scripts (on rightclick holding ...) | Free, GPL-3.0 | You script it | You script it | Modrinth lists Paper, up to 26.3 |
| MMOItems | Item config, commands stat | 19.99 EUR (SpigotMC) | cooldown and delay per command | Not covered here | Needs MythicLib |
| Data pack | Functions and scoreboard | Free | You build it | None | Vanilla |
Step by step with ExecutableItems
1. Install
Put SCore (free, required) and ExecutableItems in plugins/, then restart the server. The free version allows 500 items with 1 activator each, and PLAYER_RIGHT_CLICK is one of the activators it includes.
2. Create the item
Hold the item you want to use as a base (or nothing) and run:
/ei create spawn_scroll
The item file is created in plugins/ExecutableItems/items/. You can do everything below in the in-game editor (/ei editor), or edit the YAML directly.
3. Add a right-click activator
This example is a scroll that sends the player to spawn, with a 30 second cooldown and a permission check. Every key comes from the ExecutableItems and SCore documentation.
name: '&6Spawn Scroll'
lore:
- '&7Right-click to go back to spawn'
material: PAPER
cancelEventIfNoPermission: true
activators:
activator0:
name: '&eTeleport to spawn'
option: PLAYER_RIGHT_CLICK
typeTarget: NO_TYPE_TARGET
cancelEvent: true
cooldownFeatures:
cooldown: 30
isCooldownInTicks: false
cooldownMsg: '&cWait &e%time_S%s &cbefore using the scroll again.'
displayCooldownMessage: true
playerConditions:
ifHasPermission:
- myserver.scroll.spawn
ifHasPermissionMsg: '&cYou are not allowed to use this scroll.'
playerCommands:
- SEND_MESSAGE text:&aTeleporting to spawn...
- SUDO spawn
- execute at %player% run playsound minecraft:entity.enderman.teleport master %player% ~ ~ ~ 1 1
What each part does:
| Key | Role |
|---|---|
option: PLAYER_RIGHT_CLICK | Triggers when the player right-clicks with the item in hand. |
typeTarget | NO_TYPE_TARGET accepts clicks in the air and on blocks; ONLY_AIR or ONLY_BLOCK restrict it (with ONLY_BLOCK you also get blockCommands and block placeholders). |
cancelEvent: true | Cancels the vanilla click, so the paper does nothing else. |
cooldownFeatures | Per-player cooldown in seconds (or ticks), with its message. %time_H%, %time_M% and %time_S% show the time left. |
playerConditions / ifHasPermission | Runs the activator only for players with your permission, with an error message otherwise. |
playerCommands | The commands. They run from the console; SCore commands like SEND_MESSAGE apply to the player, and SUDO <command> makes the player run a command themselves. |
cancelEventIfNoPermission | Players without ei.item.spawn_scroll cannot use the item at all. |
Two details from the docs that save time:
- Vanilla commands that need a position (
playsound,summon,particle,setblock) run at 0,0,0 from the console. Prefix them withexecute at %player% run, as in the example. spawnis a command from another plugin (EssentialsX, for example). Use any command your server has.
4. Reload and give
/ei reload
/ei give YourName spawn_scroll 1
Players with ei.nocd.spawn_scroll (or ei.nocd.*) skip the cooldown, so test without operator rights.
Going further
- Left and right click on the same item: use
PLAYER_RIGHT_CLICKandPLAYER_LEFT_CLICKas two activators (premium, since the free version has one activator per item), orPLAYER_ALL_CLICKfor both clicks in one. - Limited uses: the
usageFeaturesandusageModificationfeatures turn the item into a consumable that disappears after N uses (usageModificationis premium). - A cooldown for everyone:
globalCooldownFeaturesblocks the activator for all players after one use. - Custom texture: set
itemModelorcustomModelData, including models made with ItemsAdder or Nexo.
Alternatives, honestly
Denizen
Denizen is a free scripting engine (MIT licence) for Spigot. Its event player (right|left) clicks <block> takes a with:<item> switch to react only when a specific item is held. It is very powerful, and you write everything as script: cooldowns, permission checks and messages are lines you add. Its README lists Spigot 1.17.1 up to 26.3 and notes that the SpigotMC page is slow to update, so downloads come from its CI server.
Pick it if you or your team are comfortable writing code-like scripts and want one tool for much more than items.
Skript
Skript is free and open source (GPL-3.0). Its click event covers this case, for example on rightclick holding a fishing rod:, followed by the effects you want. Modrinth lists Paper as its loader, up to 26.3. Same trade-off as Denizen: flexible, but every feature is a line of script you maintain.
Pick it if you already run Skript scripts on your server.
MMOItems
MMOItems (19.99 EUR on SpigotMC, needs MythicLib) has a commands stat: "the list of commands your item performs when right clicking it", each with a cooldown and a delay. It is a natural choice on an RPG server that already uses MMOItems for stats, tiers and sets. See ExecutableItems vs MMOItems.
Nexo
If the item mainly needs a custom texture and one command, Nexo's Custom Mechanic runs actions on a short list of events (including clicks) with conditions. Nexo is paid (19.99 EUR) and Paper or Folia 1.21.4+ only. Details in ExecutableItems vs Nexo.
Which one should you use?
- No coding, cooldowns and permissions built in, Spigot or Paper or Folia: ExecutableItems.
- You like scripting and want to control everything: Denizen or Skript.
- RPG server already on MMOItems: its Commands stat.
- Texture first, one simple click action, Paper 1.21.4+: Nexo, optionally with ExecutableItems on top for the behavior.
- A one-off map without plugins: a data pack with the
minecraft.usedstatistic.
Related guides
Sources
- ExecutableItems: List of the Activators (PLAYER_RIGHT_CLICK, PLAYER_ALL_CLICK)
- ExecutableItems: Activators features (cooldownFeatures, typeTarget, playerCommands, cancelEvent)
- ExecutableItems: Item Features (material, name, lore, cancelEventIfNoPermission)
- ExecutableItems: Commands & Permissions (ei.item.<id>, ei.nocd.<id>, /ei create, /ei give)
- ExecutableItems: Free vs premium (500 items, 1 activator per item)
- ExecutableItems: How to use vanilla commands (execute at %player% run)
- SCore: Player and target commands (SEND_MESSAGE, SUDO)
- SCore: Player and target conditions (ifHasPermission)
- ExecutableItems product page (SPlugins): 19.99 EUR, checked 2026-11-26
- Minecraft Wiki: Statistics (minecraft.used counts the use key on carrots and warped fungus on a stick), checked 2026-11-26
- Denizen on GitHub: MIT, Spigot 1.17.1 to 26.3, checked 2026-11-26
- Denizen Meta: 'player (right|left) clicks <block>' event with the with:<item> switch, checked 2026-11-26
- Skript on Modrinth: GPL-3.0, Paper loader, up to 26.3, checked 2026-11-26
- Skript docs: Click event syntax, checked 2026-11-26
- MMOItems docs: Item Stats (Commands stat, cooldown and delay), checked 2026-11-26
- MMOItems on SpigotMC: 19.99 EUR (via the Spiget API), checked 2026-11-26
- Nexo docs: Custom Mechanic