Published on March 06, 2022 (Updated on June 12, 2022)

[1.19] Run Command on Item Use

With RCoTu (Run Command on Item use) you can run ANY Command if a Player use (right click/hold down/...) a specific Item.Example:If a Player uses a Compass then the Player is teleported to the Spawn.

Select version for changelog:

Changelog
  • Updated to 1.19, have fun with it and the 1.19 Items :)

Installation

Downloads

Supported Minecraft versions

1
Hey can i use this mod for my map please? I will provide credit for the use of it
1
Hello pack creator! I am making an addon that allows a player to use custom attacks and stuff and I need this API for it to function. If I credited you in the addon and MCPEDL page could I use the code from your addon to make mine possible? If so, how would you like to be credited. Thanks!
1
Is it possible for you to make a script just like this, but the only change is that removes the tag when you stop right clicking? I have so much ideas but I don't know a lot with scripting.
1
heres a question im interested in knowing the answer to, does this work on a compass named "Spawn" BUT not a normal compass?
I've been trying to do this with no luck so i came here to ask!
Regardless, great addon, got a lot of ideas for this!
1
Please update 1.19 compatible
1
it doesnt work in 1.19, also here are the errors when i download it in 1.19:
Provided '/modules/1/type' element has an invalid value in pack manifest.
Multiple conflicting modules detected in pack manifest.
1
This comment has been removed
1
if you want to use armor detection the command is /execute @e[hasitem={location=slot.armor.(which armor slot),item=(anyitem)}] ~ ~ ~ {command}
i think thats it, but it probably would be much simpler with a mod
1
There's this new selector filter called hasitem, this filter detects the specific item you want to detect from a player or entity.
1
I will create the tutorials

I won't forget to credit you :)
1
this is very high quality! I used to scan through mcpe dl for an addon like this all the time, but I never expected one that could work so well!
1
This is actually amazing, you're a legend for creating this, would it be possible for you to add 2 Things:
Armour Wearing Detection, so for example execute @a[tag=armour:minecraft:diamond_helmet] ~ ~ ~ effect @s speed 1 1 true (And would that work with custom armour if you could make that)
2nd is:
Named item detection same as this but with like "Item Name" in the command too, so it only detects items with that name.
If you're able to create those that'd be so helpful!
1
Is it possible to detect armour someone is wearing through commands/scripts without it using player.json or not?
1
You should definitely create that, armour detection combined with item click detection would make map making so much easier and open up tons of new possibilities!
1
Hm, wdym this comment has been removed lol ok, also does yes mean youll try make armour detection? :)
1
This comment has been removed
1
Can we customize it?
Only for personal use of course :D
1
Yes, you can, but don't say that you have created the script
1
Bro how did you did this its AMAZING!

Edit:it doesn't work how do i fix it
1
You can do a lot with Gametest :D
1
Thanks for this! I can test if i am able to create a fully rpg map!
Edit:1 question tho does it work on named items
1
It works on named items but I don't think it allows you to run a command on 2 items that are the same but named differently, it runs items based off the ID of that item not the name.
1
With Gametest you can't get the item name, but I try to do my best :)