SHARE
TWEET

Untitled

a guest Feb 21st, 2020 136 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package me.LittleChami.ChamiTools;
  2.  
  3. import org.bukkit.GameMode;
  4. import org.bukkit.command.Command;
  5. import org.bukkit.command.CommandSender;
  6. import org.bukkit.entity.Player;
  7. import org.bukkit.plugin.java.JavaPlugin;
  8.  
  9. public class Main extends JavaPlugin {
  10.  
  11.     @Override
  12.     public void onEnable() {
  13.         //startup and reloads
  14.     }
  15.    
  16.     @Override
  17.     public void onDisable() {
  18.         //startup and reloads
  19.     }
  20.    
  21.    
  22.     public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  23.        
  24.        
  25.             //GAMEMODE SURVIVAL START
  26.             if (label.equalsIgnoreCase("gms")) {
  27.                 if (sender instanceof Player) {
  28.                     //Player
  29.                     Player player = (Player) sender;
  30.                     player.setGameMode(GameMode.SURVIVAL);
  31.                     player.sendMessage("Your gamemode has been set to survival.");
  32.                     return true;
  33.                 }
  34.                 else {
  35.                     //Console
  36.                 }                  
  37.             }
  38.             //GAMEMODE SURVIVAL END
  39.            
  40.  
  41.             //GAMEMODE CREATIVE START
  42.             if (label.equalsIgnoreCase("gmc")) {
  43.                 if (sender instanceof Player) {
  44.                     //Player
  45.                     Player player = (Player) sender;
  46.                     player.setGameMode(GameMode.CREATIVE);
  47.                     player.sendMessage("Your gamemode has been set to creative.");
  48.                     return true;
  49.                 }
  50.                 else {
  51.                     //Console
  52.                 }                  
  53.             }
  54.             //GAMEMODE CREATIVE END
  55.            
  56.            
  57.             //GAMEMODE SPECTATOR START
  58.             if (label.equalsIgnoreCase("gmsp")) {
  59.                 if (sender instanceof Player) {
  60.                     //Player
  61.                     Player player = (Player) sender;
  62.                     player.setGameMode(GameMode.SPECTATOR);
  63.                     player.sendMessage("Your gamemode has been set to spectator.");
  64.                     return true;
  65.                 }
  66.                 else {
  67.                     //Console
  68.                 }                  
  69.             }
  70.             //GAMEMODE SPECTATOR END       
  71.       return false;
  72.  
  73.     }
  74.    
  75. }
  76.  
  77.  
  78.  
  79. main: me.LittleChami.ChamiTools.Main
  80. name: ChamiTools
  81. version: 1.0
  82. author: LittleChami
  83. api-version: 1.15
  84. description: Essential tools made for LittleChami and private servers.
  85.  
  86. commands:
  87.   gms:
  88.     description: Sets gamemode to survival.
  89.   gmc:
  90.     description: Sets gamemode to creative.
  91.   gmsp:
  92.     description: Sets gamemode to spectator.
  93.  
  94.  
  95.  
  96. Description Resource    Path    Location    Type
  97. Incorrect type. Expected "string".  plugin.yml  /ChamiTools/src line 3  Language Servers
  98. Incorrect type. Expected "string".  plugin.yml  /ChamiTools/src line 5  Language Servers
  99. Missing property "api". plugin.yml  /ChamiTools/src line 1  Language Servers
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top