def registerhook(hookCls, execfunc): # Use like this: # >>> from net.canarymod.hook.player import BlockDestroyHook # >>> def hookfunc(listener, hook): # ... yell(str(hook.getBlock().getType())) # >>> registerhook(BlockDestroyHook,hookfunc) Canary.hooks().registerHook(PluginEventListener(), Canary.manager().getPlugin('CanaryConsole'), hookCls, EventDispatcher(execfunc), Priority.NORMAL)
def registerhook(hookCls, execfunc): # Use like this: # >>> from net.canarymod.hook.player import BlockDestroyHook # >>> def hookfunc(listener, hook): # ... yell(str(hook.getBlock().getType())) # >>> registerhook(BlockDestroyHook,hookfunc) Canary.hooks().registerHook(PluginEventListener(), Canary.manager().getPlugin('CanaryConsole'), hookCls, EventDispatcher(execfunc), Priority.NORMAL)