Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.blackmine.pl2;
- import org.bukkit.GameMode;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- public class SalutCommand implements CommandExecutor {
- /*
- * /Salut help
- * /salut gamemode
- */
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String msg, String[] args) {
- if(sender instanceof Player){
- Player P = (Player)sender;
- if(cmd.getName().equalsIgnoreCase("test")){
- if(args.length == 0){
- P.sendMessage("/test <help|gamemode>");
- }
- if(args.length == 1){
- if (args[0].equalsIgnoreCase("help")){
- P.sendMessage("Besoin d'aide !" +P);
- if (args[0].equalsIgnoreCase("gamemode")){
- P.sendMessage("§aTu vas être en gamemode !");
- P.setGameMode(GameMode.CREATIVE);
- }
- }
- }
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment