Energy Charge While Key Pressed?

Started by s_crowe31 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Energy Charge While Key Pressed?

I figured I could do this. Make a Energy Charge Start and Stop, but it doesnt work. Please Help!!! Thank you I <3 your Brain

https://www.dropbox.com/scl/fi/cy1ii2g8gl9ofzl7qr743/5.png?rlkey=16klgx0w5otsfygbal0wkbnm6&st=nqk5br1e&dl=0

But the infinite thing crashes the game, how can I make it infinitely increase so long as the key bind is being pressed. 

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You just need on key pressed…
Wed, 10/09/2024 - 23:24

You just need on key pressed turn logic on, on key released logic off. Then make your add energy on a tick. Because your logic variable is connected to a player it means you can do on player tick update:

If logic = true

   set energy to get energy + 35