How to make a wind charge like effect(SOLVED)

Started by -dragonwalker- on

Topic category: Help with modding (Java Edition)

Last seen on 12:21, 26. Jun 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a wind charge like effect(SOLVED)
Sun, 06/23/2024 - 00:37 (edited)

Hey! I'm currently making a dash to my mod. And when I dash up into the air by looking up, I want to make it where if I land where I originally dashed from, I take no damage. But, if land a block below that I take damage sorta like how the wind charge works. Can anyone help me? I've spent 4 hours trying to figure out how to do it.

Edited by -dragonwalker- on Sun, 06/23/2024 - 00:37
Last seen on 12:28, 26. Jun 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There is a procedure block…
Mon, 06/17/2024 - 17:53

There is a procedure block that allows you to override the fall distance of an entity, and if you set it to 0, 1, or 2 every tick, the entity will take no fall damage, and begin accumulating it after you stop overriding the fall distance. You could possibly pair that with an effect that is applied when you dash, and a variable to record your initial Y level.

To put all of it together, you would need to create a player persistent or player lifetime number variable, and a potion effect(not item) with all display settings disabled so it is present, but not visible.

Next you would need to apply the potion effect(probably only for a few seconds) when you dash, and set the variable to your current Y level.

Under the potion effect, have it run a procedure every tick it is active(there is a procedure trigger for potion effects that does this, but I can't remember the name right now), the procedure will check if your current Y level is higher than your starting Y level, and if so, override your fall distance to probably 1 or 2. If you are below the starting Y level, you could have it end the potion effect early.

A few notes, this system should work, but it might not work perfectly, and it could possibly be used to cancel fall damage for a short duration after the dash, but only above the starting Y level. In addition, there can sometimes be a bug where potion effects set for a short duration seem to be infinite, but it can be fixed by putting the part of the procedure that applies the potion effect in an if block that's condition is [not][is provided world client-side]

I hope this helps

Last seen on 12:21, 26. Jun 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You are a life saver, thank…
Tue, 06/18/2024 - 01:03

You are a life saver, thank you!

Last seen on 12:28, 26. Jun 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
your welcome
Tue, 06/18/2024 - 12:06

your welcome