I would like to have an item (lets use a stick for example) to actiavte this command
/effect (player name) 24 1000000 255 true
upon right clicking. If anybody knows how to do that I'd be very thankful as I can't find the answer anywhere.
Arqade is a question and answer site for passionate videogamers on all platforms. It only takes a minute to sign up.Sign up to join this community
you can't just use any onld item to detect rightclick unfortunately.
there are multiple ways to detect rightclick, but the easiest one will probably be this:
you have to use a carrot on a stick to do that.
/scoreboard objectives add rightClick stat.useItem.minecraft.carrot_on_a_stick
then whenever a player rightclicks with a CoaS their score will increase. that way you can do this in a repeating commandblock followed by a chain:
/effect @a[score_rightClick_min=1] 24 1000000 255 true /scoreboard players set @a[score_rightClick_min=1] rightClick 0