Keybind doesnt keep abilities unless i continue to hold it down.

Started by AMD_1105 on

Topic category: Help with MCreator software

Last seen on 16:22, 11. Jul 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Keybind doesnt keep abilities unless i continue to hold it down.

Hey, I'm developing an underwater mod that with a key bind will give you water breathing, night vision, etc. and i would like it to work where i click it once and it tuns on, then i click it again and it turns off, but i can only make it work where i hold the key bind down to get said abilities. I don't know how to code so is there a way i can change the procedure to allow that? thank you!

Last seen on 00:03, 27. May 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Do this it will work. Have…
Wed, 07/08/2020 - 04:23

Do this it will work.

Have any problems i'm here to help.

P.S 

Remember that 2020.3 Mcreator version pulls the the wrong xcords but they fixed it in the new version so no worries.

but this will work if your head is in water.

for the procedure you have on key pressed put this exactly.

BttnProcedure

 

make a procedure name it whatever then for the global trigger set it to: on player tick update.

Put this exactly:

Entity_tick_Update

Last seen on 16:22, 11. Jul 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've put in everything down…
Wed, 07/08/2020 - 14:48

I've put in everything down to the detail, I put the first image in On Key Pressed and the second one On Key Released. So now what it does is instead of responding to the key bind it activates when I step in water. did I do something wrong?

 

Last seen on 00:03, 27. May 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So now what happens is it…
Wed, 07/08/2020 - 14:57

So now what happens is it only activates when you press it and you are also in water.

If you want it to be activated only by toggle then you 

Can remove the if get block water part (The yellow 

Procedure blocks) don't remove the add potions.

So if you remove the yellow procedure blocks put the add potions under the if get water activation =1

P.S sorry about the must be in water part I assumed you would want that to be a must.

Last seen on 16:22, 11. Jul 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok, I'm starting to like the…
Wed, 07/08/2020 - 14:59

Ok, I'm starting to like the sound of it only working when i'm in the water. So did you put in a way to turn off the potion affects when out of the water?

Last seen on 00:03, 27. May 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay yea you did do…
Wed, 07/08/2020 - 15:01

Okay yea you did do something wrong.

The second image was for on player tick update trigger NOT on key release.

Last seen on 16:22, 11. Jul 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So then I shouldn't have…
Wed, 07/08/2020 - 15:03

So then I shouldn't have anything on key release and it should be its own procedure?

Last seen on 00:03, 27. May 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So as of now I don't know…
Wed, 07/08/2020 - 15:04

So as of now I don't know any way to toggle off certain potion effects but the way this code works is it will not give anymore potion effects unless conditions are met.

Last seen on 00:03, 27. May 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes the first image is for…
Wed, 07/08/2020 - 15:06

Yes the first image is for on key press and the second is a separate procedure and set the global trigger to on player tick update. Should work then.

Last seen on 16:22, 11. Jul 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok, so in that case is there…
Wed, 07/08/2020 - 15:06

Ok, so in that case is there a way to only let the player use the keybind once they have unlocked it, with a gui or something?

Last seen on 16:22, 11. Jul 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
oh, ill try that
Wed, 07/08/2020 - 15:06

oh, ill try that

Last seen on 00:03, 27. May 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes you can allow it to be…
Wed, 07/08/2020 - 15:09

Yes you can allow it to be only allowed if you have unlocked it.

Last seen on 16:22, 11. Jul 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So I decided to get rid of…
Wed, 07/08/2020 - 15:16

So I decided to get rid of the key bind all together so that the abilities only work when your in water and they turn off as soon as you get out. Thank you for your help! I have another question... I created a trident that is a ranged weapon, and i built the texture for it but when i hold it in my hand its tiny, is there a way I can make it bigger when its in my hand so it actually looks like a trident? I checked youtube videos but none of them worked... Thank you!

Last seen on 16:22, 11. Jul 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you! 
Wed, 07/08/2020 - 15:39

Thank you!