Send a command through console

Discussion in 'Plugin Development' started by FreakyPear5, Mar 13, 2019.

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

    FreakyPear5

    Hi everyone!

    I am making a plugin in MC 1.12.2 and need to know how I can send a command through console. Everything I can find on the internet is outdated by years and does not work. Please help!

    Thanks,

    Lawrence
     
  2. Offline

    KarimAKL

    @FreakyPear5
    Code:Java
    1. getServer().dispatchCommand(CommandSender sender, String command);
     
  3. Offline

    FreakyPear5

    Jeez that was quick... thanks! :D

    EDIT: I just put into my IDE and it says that everything after dispatchCommand is either a syntax error or cannot be resolved to a variable @KarimAKL
     
  4. Offline

    KarimAKL

  5. Offline

    Shqep

    Does the
    Code:Java
    1. String command

    need to have a “/“ in it? Just asking... (I have never used this method.)

    Also “cannot be resolved to a variable”, doesn’t it mean that the variable was never declared?

    And pls upload the code like @KarimAKL said if not solved.
     
  6. Offline

    KarimAKL

    @Shqep I don't use it very often so i'm not sure but i don't think it requires the '/'.
     
  7. Offline

    Shqep

    Thanks lol so it's like normal commands.
     
  8. Online

    timtower Ninja on the waves Moderator

    It is
     
Thread Status:
Not open for further replies.

Share This Page