Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.TheBmanSwan.Commands;
- import org.bukkit.ChatColor;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.java.JavaPlugin;
- /**
- * **********************************************************
- * Project: BukkitTutorials
- * Copyright TheBmanSwan (c) 2015. All Rights Reserved.
- * Upon using this for commercial use, the user must give
- * credit to TheBmanSwan. Distribution of the code is allowed
- * Claiming this project to be created by you is strictly prohibited.
- * **********************************************************
- */
- public class Main extends JavaPlugin {
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- if (!(sender instanceof Player)) {
- sender.sendMessage(ChatColor.GREEN+"You ran the command in the console!");
- return true;
- }
- Player p = (Player) sender;
- if (label.equalsIgnoreCase("command")) {
- p.sendMessage(ChatColor.GREEN+"You ran the command in-game!");
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment