Solved Trying to enable an event with Commands

Discussion in 'Spigot Plugin Development' started by NeverFlame42, Jun 25, 2021.

  1. Set the same object as both the commandExecutor and the listener.
    Code (Text):
    DarkEnable turnOn = new DarkEnable();
    getCommand("vampire").setExecutor(turnOn);
    getServer().getPluginManager().registerEvents(turnOn, this);
     
    • Like Like x 1
  2. Ohhhhhhhhhhhhhhhhhhhhhhh
    That makes so much more sense now, thank you
     
  3. Is it working now? Let me know if you have any more questions.
     
    • Like Like x 1
  4. Yes its working fine now. Now to do some deep research on how to get it to only affect the player who entered the command.
     
  5. If you would have learnt basic Java stuff beforehand, you would have saved a huge amount of time