Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.snooker.SpecialPet;
- import java.util.ArrayList;
- import org.bukkit.ChatColor;
- import org.bukkit.Material;
- import org.bukkit.inventory.ItemFlag;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.meta.ItemMeta;
- public class Smith {
- public ItemStack makeItem(Material m, String name, String desc, int amount ){
- ItemStack item = new ItemStack (m, amount);
- //create the items meta data, name, text etc
- ItemMeta im = item.getItemMeta();
- im.setDisplayName(name);
- //Create the lore
- ArrayList<String> lore = new ArrayList<String>();
- lore.add(desc);
- im.setLore(lore);
- //Hide the vanilla minecraft tooltip text
- im.addItemFlags(ItemFlag.HIDE_ENCHANTS);
- im.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
- //Set the items meta data to custom 'im' meta data
- item.setItemMeta(im);
- return item;
- }
- public ItemStack speed(int amount) {
- Material m = Material.SUGAR;
- String name = (ChatColor.RED + "Speed Boost");
- return makeItem(m, name, name, amount);
- }
- public ItemStack absorb(int amount) {
- Material m = Material.GOLD_NUGGET;
- String name = (ChatColor.RED + "Absorbtion Boost");
- String desc = (ChatColor.DARK_GRAY + "Right click to activate");
- return makeItem(m, name, desc, amount);
- }
- public ItemStack jump(int amount) {
- Material m = Material.EMERALD;
- String name = (ChatColor.RED + "Jump Boost");
- String desc = (ChatColor.DARK_GRAY + "Right click to activate");
- return makeItem(m, name, desc, amount);
- }
- public ItemStack night(int amount) {
- Material m = Material.CARROT;
- String name = (ChatColor.RED + "Night Vision Boost");
- String desc = (ChatColor.DARK_GRAY + "Right click to activate");
- return makeItem(m, name, desc, amount);
- }
- public ItemStack strength(int amount) {
- Material m = Material.REDSTONE;
- String name = (ChatColor.RED + "Strength Boost");
- String desc = (ChatColor.DARK_GRAY + "Right click to activate");
- return makeItem(m, name, desc, amount);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement