Changing gamemode

Discussion in 'Plugin Development' started by TCWilliford, Aug 11, 2012.

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

    TCWilliford

    Here is how far I am now, please note I am learning java and do not know the syntax quite yet so please provide the full code.(I am not a leacher, I can understand and read the code; just gotta learn syntax)

    http://gyazo.com/10c6faa1e91c5688809143defce9689e

    I have a couple errors I need fixing and also when /tgm toggle <gamemode> it will change there gamemode to the one they say
    Adventure
    Survival
    Creative


    ++++++++++++++++++++++++++
    Edit, I Implemented permissions so heres where I am at now and what commands I have set up to change the gamemode

    Class: http://gyazo.com/2600064269250a466470d80236f98084
    Plugin.YML: http://gyazo.com/801efc502658d28994704665f45fb7a4
     
  2. Offline

    ZeusAllMighty11 Retired Staff

    if args[0].equalsIgnoreCase("survival"){
    player.setGameMode(Gamemode.SURVIVAL);
    }
    else if args[0].equalsIgnoreCase("creative"){
    player.setGameMode(Gamemode.CREATIVE);
    }
    else if args[0].equalsIgnoreCase("adventure"){
    player.setGameMode(Gamemode.adventure);
    }

    something like that

    Also, you are not checking arg length after the very first check...
     
  3. Offline

    TCWilliford

    Thank you, I figured out my issues
     
Thread Status:
Not open for further replies.

Share This Page