Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static ItemStack makeItem(String type, String name, List<String> lore){
- int ty = 0;
- if(type.contains(":")){
- String[] b = type.split(":");
- type = b[0];
- ty = Integer.parseInt(b[1]);
- }
- Material m = Material.matchMaterial(type);
- ItemStack item = null;
- try{
- item = new ItemStack(m, 1, (short) ty);
- ItemMeta itemmeta = item.getItemMeta();
- itemmeta.setDisplayName(name);
- if(lore != null){
- itemmeta.setLore(lore);
- }
- item.setItemMeta(itemmeta);
- }catch(Exception e){
- item = new ItemStack(Material.BEDROCK);
- }
- return item;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement