How to make a key have to be pressed twice?

Started by Stoutscientist on Tue, 10/26/2021 - 23:39

Topic category: Help with modding (Java Edition)

Last seen on 18:19, 4. Dec 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to make a key have to be pressed twice?
Tue, 10/26/2021 - 23:39

Hello! I'm adding a double jump and I got that code but I can't figure out how to make sure space is pressed twice while your in the air, also is there a way I could not have to add a new keybind?

Thanks!

Last seen on 06:48, 4. Dec 2021
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
maybe by setting nbt tag of…
Wed, 10/27/2021 - 00:02

maybe by setting nbt tag of player

key is pressed trigger

if number entity nbt tag "name" =/ (not equal) 1

 do set number entity nbt tag "name" to get number entity nbt tag "name" + 1

if number entity nbt tag "name" = 1

do (whatever)

 

Last seen on 18:19, 4. Dec 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Could you attach a photo? I…
Wed, 10/27/2021 - 02:46

Could you attach a photo? I've only used MCreator for a few months and my brain did not process that

Thanks!

 

 

 

 

 

 

 

Last seen on 18:19, 4. Dec 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
It's okay. I've been quite…
Wed, 10/27/2021 - 14:18

It's okay. I've been quite busy myself. Thank you!

Last seen on 18:19, 4. Dec 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Woah! You sparked a idea in…
Wed, 10/27/2021 - 16:01

Woah! You sparked a idea in my head that works in a similar way! I made a player lifetime variable go up +1 when you hit space but after 10 ticks it goes back to 0 with a potion effect and if it gets up to 2 you double jump and the variable goes back to 0. Thank you so much!

Coding

Last seen on 06:48, 4. Dec 2021
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
nice, good luck on your mod
Wed, 10/27/2021 - 16:09

nice, good luck on your mod

Last seen on 18:19, 4. Dec 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Also do you know how to hide…
Wed, 10/27/2021 - 16:14

Also do you know how to hide a keybind from the keybind list? I managed to jerry rig the keybind's code to put it in a special section but I don't know how to hide it. When I just deleted the keybind sort code it just stopped compiling. I don't know how java works but I can understand bits of it

Last seen on 18:19, 4. Dec 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
(No subject)
Wed, 10/27/2021 - 16:16

Java code

What it looks like in MC

Last seen on 06:48, 4. Dec 2021
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
yeah not sure, but…
Wed, 10/27/2021 - 16:19

yeah not sure, but considering you can also change Minecraft Jump, you should leave it alone. 

Last seen on 18:19, 4. Dec 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Hmmm okay thanks for the…
Wed, 10/27/2021 - 16:27

Hmmm okay thanks for the help!