daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.admirable.buffs.commands;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.Material;
  6. import org.bukkit.command.Command;
  7. import org.bukkit.command.CommandExecutor;
  8. import org.bukkit.command.CommandSender;
  9. import org.bukkit.entity.Player;
  10. import org.bukkit.inventory.Inventory;
  11. import org.bukkit.inventory.ItemStack;
  12. import org.bukkit.inventory.meta.ItemMeta;
  13.  
  14. public class BuffsGUI implements CommandExecutor {
  15.    
  16.     public boolean onCommand(CommandSender sender, Command command, String label, String[] arg) {
  17.         Player player = (Player) sender;
  18.         Inventory inv = Bukkit.createInventory(null, 36, "Buffs");
  19.         ItemStack speed = nameItem(Material.POTION, ChatColor.AQUA + "Speed");
  20.         inv.setItem(4, speed);
  21.         player.openInventory(inv);
  22.         return true;
  23.     }
  24.     private ItemStack nameItem(ItemStack item, String name) {
  25.     ItemMeta meta = item.getItemMeta();
  26.     meta.setDisplayName(name);
  27.     item.setItemMeta(meta);
  28.     return item;
  29.     }
  30.     private ItemStack nameItem(Material item, String name) {
  31.         return nameItem(new ItemStack(item), name);
  32.         }
  33. }
RAW Paste Data
Top