Option to cancel / clear all pending command delays if a player dies.
mibby opened this issue ยท 4 comments
I have a special item that players can consume upon entering a world to safely leave it.
Flare_Gun:
id: WOODEN_HOE
slot: Arbitrary
durability: 5
name: '&6Ordinary Flare Gun'
lore:
- '&8&m--------&f&l &nGeneral&8 &m--------'
- '&cGun'
- ''
- '&8&m-------------------------'
- ''
- '&7Clicking while holding this will call for extraction.'
- '&7Please wait 5 minutes for extraction.'
- ''
itemflags: death-drops, self-drops, item-store, unbreakable, hide-attributes, disposable
triggers: world-change, join
enabled-worlds: darkzone
commands:
right-click:
- 'message: &8[&5DarkZone&8] &bExtraction Inbound...'
- 'console: bar send %player% Extraction_Inbound... Blue 0 300'
- 'delay: 6000'
- 'console: mvtp %player% e:spawn:-935.5,60,-217.5'
- 'message: &8[&5DarkZone&8] &bYou have been extracted from the darkzone.'
commands-cooldown: 310
cooldown-message: '&8[&5DarkZone&8] &bYou have already fired your flare. Please wait for extraction.'
permission-node: 'itemjoin.darkzone.flare'
However if they use the item and then die - being brought back to spawn, the delayed command still ticks down in the background and runs even if they are no longer in the world.
Would it be possible to cancel all pending / delayed commands if the player dies or are no longer in the world?
This is something I can do, I will make it so automatically on death and world switch (if the item is disabled kn that world) that the commands will cancel.
I will work on this first as soon as I fly back home Sunday.
(Accidental closure sorry, poor wifi and cruddy phone haha)
Wonderful! I was also going to mention possibly cancelling it on disconnect or world chance to go with deaths. :)
Added, let me know if there needs to be any changes; http://ci.craftationgaming.com/job/ItemJoin/238/
EDIT: Also added the requested disconnect & world change cancelation. This has been updated in snapshot 239.