1 - 20 of 20
if(sender instanceof Player){
Player player = (Player) sender;
if(commandLabel.equalsIgnoreCase("test")){
player.sendMessage("You ran the test command in-game!");
}
}else{
this.getLogger().info("You ran the test command from console!");
}
package com.optisize.test;
import org.bukkit.Bukkit;
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;
public class Test extends JavaPlugin {
public void onEnable() {
Bukkit.getServer().getLogger().info("Test Plugin is enabled");
}
public void onDisable() {
Bukkit.getServer().getLogger().info("Test Plugin is disabled");
}
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[]args) {
if(sender instanceof Player){
Player player = (Player) sender;
if(commandLabel.equalsIgnoreCase("test")){
player.sendMessage("You ran the test command in-game!");
}
}else{
this.getLogger().info("You ran the test command from console!");
}
}
}
1 - 20 of 20
© 2010 - 2024
www.planetminecraft.com