Started by
koyote
on
Topic category: Help with Minecraft modding (Java Edition)
How can I make it so that when I right click, the potion effect is activated and when I right click again, it is deactivated?
Topic category: Help with Minecraft modding (Java Edition)
How can I make it so that when I right click, the potion effect is activated and when I right click again, it is deactivated?
You need to use a player-persistant logic variable. When the player right clicks, if the variable is already true, set it to false; and if it's already false, set it to true. (Possibly with an additional number variable for a cooldown time, if you want to discourage spamming/keep track of how long the effect has been active.)
Then, using a procedure on player update tick, if the variable is true, apply 10 ticks or so of the potion effect. If it isn't, don't.