Started by
davidS
on
Topic category: Help with Minecraft modding (Java Edition)
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.
Topic category: Help with Minecraft modding (Java Edition)
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.
enlarge the image by right clicking on open image in a new tab
When you test the enchantment the cooldown afects only the item, Right? I have the same issue and would want a solution too.
yeah im trying to figure out how to do this as well if anyone figures out how to do it please tell me
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.