Issue Command, nothing happens?

Discussion in 'Plugin Development' started by antondubek2, May 4, 2014.

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

    antondubek2

    I ahve been self teaching myself java for a while now and thought I would get all my notes out and a video to help me along and have a go at making something simple.

    Im trying to make a plugin that instead of using /spawn you can use /hub. The plugin exports perfectly, runs with no problems, issue /hub and just nothing happens, not error in the console just [INFO] antondubek2 issued server command: /hub this is followed by nothing.

    If anyone could just point out what im guessing is a small mistake that would be wonderful.

    Eclipse code : http://pastebin.com/qE4V7yPH

    Plugin YML : http://pastebin.com/9ycVa63Q
     
  2. Offline

    SaxSalute

    You need to add this line to your onEnable()

    Code:java
    1. this.getCommand("hub").setExecutor(this);


    Otherwise, your plugin won't know what to do with the command. If you plan on making a large plugin, it's definitely best to make a separate command executor class for each root command. In the plugin I'm currently working on the executor alone is 500 lines.
     
  3. Offline

    antondubek2

    http://pastebin.com/4s4dwk1S

    still nothing happening... can anyone shine any light? Just want to fix this so can move on and try start again on something else and get it to work.
     
Thread Status:
Not open for further replies.

Share This Page