[Tutorial] [Video] How to make your commands!

Discussion in 'Resources' started by Peter25715, Oct 1, 2014.

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

    Peter25715

    Hey everyone, Today I will just show you mt video on how to make your own command.
    If you need help just go to the YouTube video and just comment there what's your problem, or reply on this thread with what is your problem...
    Have fun watching..

     
  2. Offline

    MineStein

    Code:java
    1. @Override
    2. public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    3. if (sender instanceof Player) {
    4. sender.sendMessage("You are a player!");
    5. return true;
    6. } else {
    7. sender.sendMessage("You are not a player!");
    8. }
    9. return true;
    10. }
     
  3. Offline

    teej107

    MineStein
    Code:java
    1. @Override
    2. public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    3. if (sender instanceof Player) {
    4. sender.sendMessage("You are a player!");
    5. return true;
    6. } else {
    7. sender.sendMessage("You are not a player!");
    8. }
    9. return false;
    10. }
     
    Monkey_Swag likes this.
  4. Offline

    MineStein

    teej107 Whoops lol, didn't write that in an IDE :p

    EDIT: Or you could skip that last return statement and have it after telling them you are not a player.
     
Thread Status:
Not open for further replies.

Share This Page