Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.imyou011001.Tutorial;
- import java.util.logging.Logger;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Tutorial extends JavaPlugin{
- Logger logger = getLogger();
- public void onEnable() {
- this.getLogger().info("this plugin has been set up correctly!");
- }
- public void onDisable() {
- this.getLogger().info("this plugin has been disabled successfully!");
- }
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- if(!(sender instanceof Player)) {
- sender.sendMessage("§c&lHi there, console!");
- }
- if(cmd.getName().equalsIgnoreCase("test")) {
- Player p = (Player) sender;
- if(args.length == 0) {
- p.sendMessage("§4Invalid arguments! /test <hi:bye>");
- }
- else if(args[0].equalsIgnoreCase("hi")) {
- p.sendMessage("§aHi.");
- }
- else if(args[0].equalsIgnoreCase("bye")) {
- p.sendMessage("§aBye.");
- }
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement