plugin.yml using two classes?

Discussion in 'Plugin Development' started by RedstoneForDayz, Dec 15, 2014.

Thread Status:
Not open for further replies.
  1. Offline


    So I have a Java Project that has two classes, and I was wondering, in the YML file, how would you add the second class in the YML? Example:

    main: me.plugin.Ladder.KingV2
    KingV2 is the first class, and how would you add the second class to the main?
  2. Offline


    There's no need, you only need to add the class that extends JavaPlugin.
  3. Offline


    @RedstoneForDayz To use another class you would have to sort of communicate with it by creating a new instance, or object of that class which is necessary when registering a listener or a command executor. To actually pass data through it you need to specify the classes parameter types. An easy way to pass data to your second class is by sending an instance of your main class and using getters to grab objects. Note that if you create multiple instances of your main class an exception will be thrown.
    ChipDev likes this.
  4. Offline


    Make your plugin.yml look like this:

    name: <name of your plugin>
    main: me.<user>.<MainJavaFile>
    version: <any version here>
    description: <description>
    usage: /<Command>

    Hope this helps. :D
Thread Status:
Not open for further replies.

Share This Page