how to make a cooldown system for my enchantment

Started by davidS on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how to make a cooldown system for my enchantment

 

Hello, do you know how I can make a cooldown system for my enchantment?

note I'm not very good with procedures so I would appreciate screenshots.

help me please

 

Joined Mar 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
enlarge the image by right…
Mon, 04/05/2021 - 21:11

enlarge the image by right clicking on open image in a new tab

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When you test the…
Sat, 03/19/2022 - 11:40

When you test the enchantment the cooldown afects only the item, Right? I have the same issue and would want a solution too.

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah im trying to figure out…
Sun, 10/02/2022 - 00:37

yeah im trying to figure out how to do this as well if anyone figures out how to do it please tell me

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You'll have to do a couple…
Mon, 10/03/2022 - 01:06

You'll have to do a couple of things first go to the tab on the left of mcreator called "Variables"

Create a 'Number' variable and name it accordingly (i.e. myItemCooldownTick) and make it 'Player Persistent' and change the default to your cooldown amount (200) (200 ticks equates to 10 seconds)

Also make a 'Logic' set to player persistent. (i.e. myItemCoolingDown)

in your procedure add a IF above 'Strike Lighting' block and then put all 3 blocks into the IF block.

It should be like this

IF : myItemCooldownTick <= 0

>Strike Lightning block

>Cooldown block

>Deal damage block

>set myItemCoolingDown = true

Now in a new procedure make the Global trigger "On player tick update"

put

IF : myItemCoolingDown = true

   set myItemCooldownTick (myItemCooldownTick - 1) //Subtract 1 from your cooldown every tick until it hits 0

   IF : myItemCooldownTick <= 0

      set myItemCooldownTick = ### (200) //Set the cooldown back so that it can be triggered again

      set myItemCoolingDown = false //change to false so that it can be triggered again

 

If done right your item will have the cooldown effect on the item from the built-in cooldown block and also will not be usable while on cooldown. just make sure your cooldown is the same amount on the built-in cooldown and your variable.

If you really need screenshots i'll make some.I'll check back on this post later.