Started by
AMD_1105
on
Topic category: Help with MCreator software
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!
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.
make a procedure name it whatever then for the global trigger set it to: on player tick update.
Put this exactly:
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?
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.
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?
Okay yea you did do something wrong.
The second image was for on player tick update trigger NOT on key release.
So then I shouldn't have anything on key release and it should be its own procedure?
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.
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.
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?
oh, ill try that
Yes you can allow it to be only allowed if you have unlocked it.
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!
https://mcreator.net/comment/100949/#comment-100949 this is the only way I found. Hope it helps 🙏
Thank you!