Double jump problem

Started by BIGOOF on

Topic category: Help with modding (Java Edition)

Last seen on 20:41, 25. Mar 2021
Joined Oct 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Double jump problem

Hi, I'm working on a mod that adds some enchantments, including one that grants the player the ability to double jump. The problem is that I can't find a way to limit the amount of jumps. I've tried using local variables, but it doesn't seem to have any effect. Might there be a problem with the variables, or do you know a different solution?

 

The procedure

Last seen on 20:41, 25. Mar 2021
Joined Oct 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It looks like the image isn…
Thu, 03/25/2021 - 16:03

It looks like the image isn't loading. Here it is: https://imgur.com/a/HTTJVw7

Last seen on 19:10, 4. Aug 2023
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Why did you make a variable?…
Thu, 03/25/2021 - 16:50

Why did you make a variable? It's useless, you just have to check if certain item has that enchantment. And you have done it that every time you fall you will, supposedly, jump. And the part of the sound just doesn't make sense to me, because it will play the sound eery tick. I think that you need to make it on player's tick update, but try to think about what I've written here. If that¡s not the problem i don't know hao to fix it.

Last seen on 19:10, 4. Aug 2023
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
every*
Thu, 03/25/2021 - 16:50

every*

Last seen on 14:43, 2. Aug 2022
Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Local variables reset every…
Thu, 03/25/2021 - 18:35

Local variables reset every time the procedure is called. You will have to make an NBT variable for this to work properly.

Last seen on 20:41, 25. Mar 2021
Joined Oct 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thanks!    
Thu, 03/25/2021 - 20:24

thanks!