Plugin is null?

Discussion in 'Plugin Development' started by Rprrr, Dec 24, 2012.

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

    Rprrr

    My plugin.yml:
    Code:
    name: PrettyWorks
    main: me.rprrr.prettyworks.PrettyWorks
    version: 1.0
    author: Rprrr
    commands:
      prettywork:
        permission: prettywork.create
        permission-message: You don't have permission 'prettywork.create'.
        usage: /prettywork <interval in seconds>
    Then I'm using this in the plugin:
    Code:
        Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin("PrettyWorks");
    And it justs keeps saying the plugin is null. I don't get it.. Am I blind and am I misspelling this the plugin's name or..?

    I even renamed it and it keeps saying it's null..

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  2. Offline

    Tirelessly

    When are you using that? Why are you using that?
     
  3. Offline

    gamerzap

    If it's in your main class you could just do Plugin plugin = this.
     
  4. Offline

    Rprrr

    Tirelessly gamerzap
    Yup, I was using it in the main class.
    I changed it to this in that class, it's working now.
     
  5. Offline

    fireblast709

    It probably was null because it was not loaded yet. (reading that you can use this, it was loading atm)
     
Thread Status:
Not open for further replies.

Share This Page