October 2014
Beginner to intermediate
285 pages
6h 24m
English
Here’s the simplest code for a task that just sends a broadcast message. It may not do much, but you can use this piece of code as a starting template when making your own tasks.
Just add the code you want down in the body of the run function, change the package name, and add any imports you may need. (Remember, the common ones are listed in Appendix 7, Common Imports , and you can find others in the Canary or Java docs.)
| ① | package examplepackage; |
| | import net.canarymod.Canary; |
| | import net.canarymod.tasks.ServerTask; |
| | import com.pragprog.ahmine.ez.EZPlugin; |
| | |
| ② | public class ExampleTask extends ServerTask { |
| | |
| | private final EZPlugin plugin; |
| | |
| ③ | public ExampleTask(EZPlugin plugin) { |
| | super(Canary.getServer(), ... |
Read now
Unlock full access