October 2014
Beginner to intermediate
285 pages
6h 24m
English
Now back to your main plugin: once you have the task defined over in its own class, you can create an object of that class from your main plugin using new, and schedule it to be run in the future using addSynchronousTask().
| | ExampleTask task = new ExampleTask(plugin); |
| | Canary.getServer().addSynchronousTask(task); |
plugin should be a variable that’s set to your main plugin. If you’re putting this code in a non-static function in your plugin, you can use the Java keyword this, which means “this plugin object.” If you’re putting this code in a static function, you need a static variable (like plugin) that has previously been set to the plugin. For example, in an object function (a method) like your constructor or enable ...
Read now
Unlock full access