Your plugin is using a very old function that doesn't exist any more in Moodle.
See https://docs.moodle.org/dev/Events_API (and almost any bit of Moodle for examples of how this is used).
See https://docs.moodle.org/dev/Events_API (and almost any bit of Moodle for examples of how this is used).