Adding A Cooldown On Abilities

Started by 37Minutes on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Adding A Cooldown On Abilities

Hello, I'm trying to make a sword with abilities, like spawning fire out of thin air. I've managed to figure out how to do that, but It's extremely overpowered. To make it less powerful I need to add a cooldown on the abilities, except I have no clue how to do that. (The cooldown would be about 5-10 seconds) I also have another problem, the fire destroys the block It spawns on, because I made the fire replace the block, and I don't know how to spawn the fire on-top of the block the player is looking at. The procedure I used was "Place fire at x, y, z," If anyone knows how to do either of these it would be greatly appreciated. :)

Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I can help you out with both…
Wed, 09/08/2021 - 00:27

I can help you out with both things, i have 2 options for the cooldown of the weapon:
1 - Create a potion effect named "cooldown" or something like that (the name is optional), then in the procedure section when using your sword put a condition "If not has entity active potion [YourCooldownEffect], then it will execute the rest. And to add the cooldown, just use the give potion procedure block and give your potion for about 10 or 15 seconds if you want.

2 - Use custom variables for creating a custom timer using the global trigger "Player Update Tick", put this is more advanced and maybe if you don't know too much about variables and things like that it would maybe be too much. But you can create a counter and add +1 to it each tick passes, then when the counter is equal to 20, add another variable called "Cooldown Seconds" or something like that, then set a condition that checks if the variable number is equal or less than 15 (seconds). In this case, if you don't put the limit the number wil continue to raise

For the Fire replacing the block, just add a condition that checks "If block at y (x + 1) z is air" and then place your fire on x (y + 1) z. You need to add the plus one because if not the fire will spawn below the block selected. Hope it helped men

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I believe the cooldown thing…
Wed, 09/08/2021 - 01:00

I believe the cooldown thing worked, but how do I add the (x + 1)? Thank you for your help so far!

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Probably with a math…
Tue, 03/22/2022 - 21:14

Probably with a math function. The x + x.

I have a little problem with that. I have set a function that add bonemeal when a hoe with an especific enchantment is use, i have set the cooldown potion efect, but the bonemeal still aplies when not supose to, during the cooldown efect. Any help @Mariano Arguello, please?