Solved GameMode Creative not working?

Discussion in 'Bukkit Help' started by Jayyy, Aug 11, 2015.

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

    Jayyy

    Ok so I'm making this /Admin Plugin where basically when you perform the command it puts you in creative mode and invisibility mode but I cant seem to get the GameMode statement to work here is my code and yes I have the import
    Code:
    if(cmd.getName().equalsIgnoreCase("admin")) {
                        Player p = (Player)sender;
                        if(!admin.contains(p));
                            for (Player pl : Bukkit.getServer().getOnlinePlayers()) {
                                pl.hidePlayer(p);
                            }
                            admin.add(p);
                            p.setGameMode(GAMEMODE.CREATIVE);
     
    Last edited: Aug 18, 2015
  2. Offline

    scrollbar

    For setting armor, you have to get the PlayerInventory and then use the following methods to set armor contents.
    setLeggings(ItemStack leggings)
    setHelmet(ItemStack helmet)
    setChestplate(ItemStack chestplate)
    setBoots(ItemStack boots)
     
  3. Offline

    Jayyy

    ahh thanks man, know anything about the getting time of the cooldown?
     
  4. @Jayyy There's two ways.

    1. Add to a HashMap the UUID and System time with there cooldown time
    or
    2. Add to a list and remove in a scheduled task

    Then check times or check if they're in the list when they do the command
     
  5. Offline

    Jayyy

    Any suggestions as to what I could replace it with? *Also there is this thing I've been having "trouble" with its really bothering me http://prntscr.com/83b6u6 how would I get rid of the listing of the command after I perform the command, for instance

    /cc *clearschat*
    /cc *<-----------* that shows up after i perform the command, It really bothers me and I can't figure it out
     
    Last edited: Aug 11, 2015
  6. Offline

    oceantheskatr

    Put a return true; at the end of the command in your code ;)
     
  7. Offline

    Jayyy

    THANK YOU LOL
     
  8. Offline

    oceantheskatr

    Haha no problem, I think I asked that exact question a few months ago when I was starting out :p
     
    Jayyy likes this.
  9. Offline

    Jayyy

    Actually the problem is the "Bukkit.getPlayer()" statement it draws a line through the statement, So I was wondering what other statement I would input to replace it? Thanks :D
     
  10. Offline

    oceantheskatr

    If something is depreciated then it should still work. Crossed out with some sort of yellow underline or lightbulb? That's fine. If it has a red underline or red X then it isn't.
     
    Jayyy likes this.
  11. Offline

    Jayyy

    Thanks I'm just fairly new learning alot lately from the bukkit community glad to have everyone here helping me become better :)
     
Thread Status:
Not open for further replies.

Share This Page