Started by
zorualeloupsolitaire
on
Topic category: Help with Minecraft modding (Java Edition)
Hello,
I have searched on Mcreator and on the internet, without success, for a tutorial that explains how to check if a player has pressed a button.
I'd like to make a power boost, which activates when the player presses a button, for example K.
The player would receive enhanced strength, speed and jumping boosts. But I don't want him to have to hold down the K button constantly.
Does anyone know how to make it so that the player only needs to press once to activate the power boost and a second time to deactivate it?
Thank you!
You could have the power boost be active when a player_lifetime logic variable is true for them?
Detect when K is pressed using a Key Binding element, then assign a procedure to the On key pressed trigger.
Inside the procedure, you would set your variable to true if it is currently false, and false if it is currently true.
Thank you for your help, I simply have a problem. Now my launcher won't launch at all.
Do you have a solution? Here's what I did.
Hey, so my game's going really well now. It was PlayerAnimator, which made me crash.
Now I've got another problem: the command doesn't work.
So my fault, I've just realized that I'd set the wrong variable on one of the commands. Now it's working fine!
Thanks again!