Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package drakegm;
- import java.util.logging.Logger;
- import org.bukkit.GameMode;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.PluginDescriptionFile;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin {
- public static Main plugin;
- public final Logger logger = Logger.getLogger("Minecraft");
- @Override
- public void onEnable() {
- PluginDescriptionFile pdfFile = this.getDescription();
- this.logger.info( pdfFile.getName() + " Zostal Wlaczony :)");
- }
- @Override
- public void onDisable() {
- PluginDescriptionFile pdfFile = this.getDescription();
- this.logger.info( pdfFile.getName() + " Wylaczyl sie :C");
- }
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String commandlabel, String[] args) {
- readCommand((Player) sender, commandlabel);
- return false;
- }
- public void readCommand(Player player, String command) {
- if(command.equalsIgnoreCase("gm1")) {
- player.setGameMode(GameMode.CREATIVE);
- player.sendMessage("Wlaczyles gm1");
- }
- else if(command.equalsIgnoreCase("gm0")) {
- player.setGameMode(GameMode.SURVIVAL);
- player.sendMessage("Wlaczyles gm0");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment