[SOLVED] Creating multiple classes :: Reading the same Methods and Commands

Discussion in 'Spigot Plugin Development' started by fujiboy4, May 26, 2015.

Thread Status:
Not open for further replies.
  1. @fujiboy4 The base class, which should be the one the spider class is extending, normally doesn't need to know about either. The spider class doesn't need to know about the listener class as well, generally your listener class invokes methods from the base class, which then triggers behaviour in the spider class (if their kit is the spider kit).
     
  2. OK, but what about the plugin.yml:
    Code (Text):
    name: TestPlugin
    main: ultrapvp.ssm.Main
    version: 0.0.0
    commands:
    // Right here...  I tried putting a command in here with command s in a different class and the commands didnt work.
     
  3. You need to register the commands in onEnable
     
  4. @fujiboy4 to elaborate on this, you need to set the executor of the command. First get the command with JavaPlugin#getCommand(String), then set the executor using Command#setExecutor(CommandExecutor).
     
  5. Can you show me code? I'm confused with the "#"'s
     
  6. First you get the command.
    Then you set the executor.

    Code (Text):
    Try and google
     
  7. Nice code. I'll see if it works.

    Code (Text):
    Too many errors to explain.
     
  8. It is not difficult to google "Bukkit command in other class"
     
  9. Done googled it. Happy?
     
  10. Yes
     
  11. Omnivion

    Patron

  12. OK, I watched a tutorial earlier today. I think I have a better idea of how to register a command from a different class in the onEnable(). Thanks. (Please Lock)
     
  13. jflory7

    jflory7 Retired Moderator
    Retired Benefactor

    Thread locked per request
     
Thread Status:
Not open for further replies.