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

Started by MamaLuigi on

Topic category: Help with modding (Java Edition)

Last seen on 16:47, 26. Apr 2024
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
Last seen on 11:32, 27. Apr 2024
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.

Last seen on 16:47, 26. Apr 2024
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.