First of all, thank you for your time and help in reading my post.
To give you some context, I created a custom item, a “teleportation potion”. So far, nothing to report, I created the event allowing the command to be executed when using it and the one allowing it to disappear from the inventory.
As mentioned in the post title, I also used the "events_settings" option to set a 5 second cooldown and display it.
Here is the potion's event configuration:
---------------------------------------
events_settings:
cooldown:
indicator: TITLE
ticks: 120
events:
interact:
right:
execute_commands:
cmd1:
command: 'spawn {player}'
as_console: true
delay: 0
cmd2:
command: 'iaremove {player} custom_potions:tp_potion_5 1 silent'
as_console: true
delay: 0
---------------------------------------
What I would like to know is: is there a way to ensure that the cooldown configured in the "events_settings" option can be "canceled"?
Let me explain, I would like to ensure that when the potion is used, as soon as the player moves or is hit that the cooldown is canceled. This would therefore have the effect of not applying the commands configured in the "events" section to the player.
Here is what a typical configuration might look like:
---------------------------------------
events_settings:
cooldown:
indicator: TITLE
ticks: 120
**canceled_on_moove: true**
**canceled_on_hit: true**
events:
interact:
right:
execute_commands:
cmd1:
command: 'spawn {player}'
as_console: true
delay: 0
cmd2:
command: 'iaremove {player} custom_potions:tp_potion_5 1 silent'
as_console: true
delay: 0
---------------------------------------
➡️Is there an option for something similar?
I couldn't find anything about this on the forum, on the wiki or in the VS code extension.
Thank you in advance for your help and clarification!
Have a good day,
Baba7874