Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.Fox.TrollPlus.Commands;
- import java.util.ArrayList;
- import org.bukkit.Bukkit;
- import org.bukkit.Material;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.Inventory;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.meta.ItemMeta;
- import me.Fox.TrollPlus.Main;
- public class TrollCommand implements CommandExecutor {
- private Main main;
- public void TrollCommand() {
- this.main = main;
- }
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- Player player = (Player) sender;
- if (sender instanceof Player && player.hasPermission("trollplus.troll")) {
- if (args.length == 0) {
- player.sendMessage("§cYou do not have permission to use this command!");
- return true;
- }
- if (args.length == 1) {
- Player target = Bukkit.getPlayer(args[0]);
- gui(player);
- }
- }
- return true;
- }
- public void gui(Player target) {
- //BEGINNING
- Inventory gui = Bukkit.createInventory(null, 54, "§cTrollPlus - You are trolling:" + target.getName());
- // LORES
- // Launch Lore \\
- ArrayList<String> launchL = new ArrayList<>();
- launchL.add("§7With this command you can launch");
- launchL.add("§7the current target!");
- launchL.add("");
- launchL.add("§7Target: §a" + target.getName());
- // Drunk Lore \\
- ArrayList<String> drunkL = new ArrayList<>();
- drunkL.add("§7With this command you can make");
- drunkL.add("§7your target drink till they get");
- drunkL.add("§7drunk!");
- drunkL.add("");
- drunkL.add("§7Target: §a" + target.getName());
- // ITEM STACK
- // Launch ItemStack \\
- ItemStack launchI = new ItemStack(Material.WEB);
- ItemMeta launchM = launchI.getItemMeta();
- launchM.setDisplayName("§a§lLaunch " + target.getName());
- // ITEM SETTINGS
- //FINAL
- target.openInventory(gui);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement