(SOLVED) How to Detect when Keybind is Held Down?

Started by MamaLuigi on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(SOLVED) How to Detect when Keybind is Held Down?
Thu, 02/15/2024 - 16:27 (edited)

I have a Keybind that changes a variable by 1 whenever it is pressed, but I want the Kebind to also work when held down, not just pressed.

 

Is this possible, and if so how do i so it?

 

Any help would be greatly appreciated!

Edited by MamaLuigi on Thu, 02/15/2024 - 16:27
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'll be honest I was pretty…
Wed, 01/24/2024 - 22:56

I'll be honest I was pretty sure that it already had a procedure to hold down, but after checking its not there. And now my mod needs a revision, but without a plugin then its not possible with base Mcreator atm.

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I firgured how to do it. I…
Thu, 02/15/2024 - 16:27

I firgured how to do it. I made it so when you press the kebind, it sets a variable to true, and when you release the kebind, it sets the variable to false. Then i made a procedure that runs every tick, and it checks if the variable is true, and if it is the procedure then does something.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What is the procedure block…
Fri, 11/15/2024 - 02:56

What is the procedure block to check if a variable is true or false?

And how do I change the value of the variable when the key is pressed/released?