Advertisement
Knager

Untitled

Mar 12th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.95 KB | None | 0 0
  1. /**
  2.  *
  3.  */
  4. package me.bukkit.knager;
  5.  
  6. import org.bukkit.ChatColor;
  7. import org.bukkit.GameMode;
  8. import org.bukkit.command.Command;
  9. import org.bukkit.command.CommandSender;
  10. import org.bukkit.entity.Player;
  11. import org.bukkit.plugin.java.JavaPlugin;
  12.  
  13. /**
  14.  * @author Daan
  15.  *
  16.  */
  17. public class Gamemode extends JavaPlugin
  18. {
  19.  
  20.     @Override
  21.     public void onEnable() {
  22.         this.getLogger().info("Plugin has been Enabled");
  23.        
  24.     }
  25.    
  26.     @Override
  27.     public void onDisable() {
  28.         this.getLogger().info("Plugin has been Disabled");
  29.        
  30.     }
  31.    
  32.     public boolean onCommand(CommandSender sender, Command cmd, String Label, String[] args) {
  33.         if (cmd.getName().equalsIgnoreCase("gmc")) {
  34.             Player player = (Player)sender;
  35.             if (player.hasPermission("gamemode.creative")) {
  36.                 player.setGameMode(GameMode.CREATIVE);
  37.                 player.sendMessage(ChatColor.GRAY + "Je gamemode is veranderd naar:" + ChatColor.YELLOW + "Creative");
  38.             }
  39.         }
  40.        
  41.         return false;
  42.        
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement