Solved execute mc commands

Discussion in 'Plugin Development' started by drillzy, May 14, 2017.

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

    drillzy

    Hello guys! i need some help with a plugin that i want to make. So i want to make it when someone does an event such as PlayerInteractEvent and when they do that event it executes a command from the server's commands such as /mangaddp from groupmanager or /fly from essentials. Please help with this for me please. Thanks!
     
  2. Offline

    yPedx

    @drillzy
    getServer().dispatchCommand(getServer().getConsoleSender(), "yourCommand");
     
  3. Offline

    drillzy

    @yPedx thank you :)

    Ok since that is figured out, how would i make it so i can run all commands from a list or is that not possible?

    EDIT: wait nevermind the code didnt work. It says its not a correct thing from the console. here is my code.

    Code:
          getServer().dispatchCommand(getServer().getConsoleSender(), "kill" + p);
    
    EDIT#2: nvm i got it to work but how would i make it so it doesnt say this:
    CONSOLE issued server command: /kill CraftPlayer{name=drillzy}

    and instead say:
    CONSOLE issued server command: /kill drillzy
     
    Last edited: May 15, 2017
  4. What type does the variable 'p' have? It isn't just 'String' - it's 'Player', right? If yes, you probably want
    Code:
    "kill " + p.getName()
     
    Sulphate and ipodtouch0218 like this.
  5. Offline

    drillzy

    @Coww
    Yup! Thanks for your help :) even tho is was simple but still, Thanks.
     
Thread Status:
Not open for further replies.

Share This Page