2

Right click interaction

turtledev 1/11/22 10:15 pm
296
1/13/2022 2:17 am
i am planning on making a xp tomes datapack, and know how to make custom items, but i do not know how to make it interactable on demand.
does anyone here know how to make something so that when you right click with it, it will run a function for example? any help would be greatly appreciated!
Posted by
turtledev
Level 10 : Journeyman System
8

  Have something to say?

JoinSign in

4

Silabear
01/13/2022 2:17 am
He/Him • Level 70 : Legendary Guard Bear
If you use a carrot on a stick as your base item, you can detect with scoreboards and NBT when a player has right clicked while holding your custom item, then run some commands :D
1
Berezka
01/12/2022 1:09 am
Level 51 : Grandmaster Architect
history
If you need RCM, use carrot with stick, if you need LCM - use invisible mob which always near you eyes(hit him, and interact with scoreboard stats) - example in my chess datapack
1
YokaiS
01/12/2022 12:42 am
He/Him • Level 62 : High Grandmaster Senpai Peacock
That can be done by making the base item a carrot on a stick (or a warped fungus on a stick if you wanna be fancy). There's a scoreboard type that can detect when you right click with either, so you can make it so that if the value of the scoreboard changes while holding the item with a special tag, it runs a function, and it resets your score to 0
2
Coffee Gamer 360
01/11/2022 10:52 pm
Level 73 : Legendary Enderdragon Nether Knight
The easiest way is making an invisible achievement with a reward on right clicking something that you can actually interact with example crafting tables, furncaces etc
1

Welcome