Started by
FireElla5
on
Topic category: Help with Minecraft modding (Java Edition)
So I am making a mod, which includes an invisibility cloak. I want to make it so that holding the "I" key makes you invisible, and releasing it takes away your potion effects. So I made the procedures, and for whatever reason the invisibility only lasts 4 seconds when I press the key, no matter how much I change the potion effect time.
How do I make it so that holding the I key will make you invisible for however long, as long as you don't release the key?
Edited by FireElla5 on Sun, 09/13/2020 - 21:56
The version I am using is 2020.4
on key pressed give potion effect invisibility for 999999 seconds, on key release clear invisibility effect.
Thank you! It turns out I had the procedures in the triggers tab of the invisiblity cloak, I just removed the procedures from there and put them in keybinds, but I never thought about changing the duration to that. For those of you who have a similar problem:
Key pressed code:
Event trigger - No additional trigger
if Get item from armor slot 2 of Event/target entity = <choose your armor>
(armor slot 3 is helmet, 2 is chestplate, 1 is leggings, and 0 are boots)
do Add potion with level 1 and duration 999999 to Event/target entity type <whatever potion effect you want>
Key released code:
Event trigger - No additional trigger
Clear all potion effects of Event/target entity
--------------------------------------------------------------------------------------------------------------------------------------------------