CommandHelper

CommandHelper

46.5k Downloads

is_cancelled always returns false

LadyCailinBot opened this issue ยท 4 comments

commented

CMDHELPER-3093 - Reported by phanaticd

I am trying to make a script that only runs if a block is successfully broken, I do not want this script to run if the block breakage is blocked by a plugin such as factions or worldguard. However it seems no matter what I do it always run as is_cancelled does not say it is.

This is my script http://pastebin.com/GjLBxeJ4 I have tried every other priority as well but still says false
even though these are the messages I get from worldguard or factions:

https://gyazo.com/54106051224d1793517bdfdd57642df5

commented

Comment by PseudoKnight

CommandHelper binds will always try to run first, before plugins. is_cancelled() is used to tell if another script cancelled the event.

Fortunately you can use sk_can_build() with the SKCompat extension to see if WorldGuard would cancel it. Unfortunately there is no such extension (that I know of) for Factions. For those situations, sometimes you can just wait a tick and check the state.

commented

Comment by PseudoKnight

I guess one could argue that CH should listen for events on at least a HIGHEST priority as well, with some kind of bind option for that.

commented

Comment by LadyCailin

I've considered adding that. The event system needs a lot of loving though.

For now though, closing this as won't fix, because it's just not on the roadmap right now.

commented

Comment by phanaticd

;-;