Advertisement
Guest User

Untitled

a guest
Jun 11th, 2022
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. @EventHandler
  2. public void onAnvil(InventoryClickEvent e) {
  3. Player p = (Player) e.getWhoClicked();
  4. if (e.getWhoClicked() instanceof Player) {
  5. if (e.getView().getType() == InventoryType.ANVIL) {
  6. ArrayList<String> listOfLores = new ArrayList<>();
  7. listOfLores.add(ChatColor.DARK_PURPLE + "Glow I");
  8. listOfLores.add(ChatColor.DARK_PURPLE + "Poison I");
  9. AnvilInventory anvilInventory = (AnvilInventory) e.getInventory(); // inventory type
  10. ItemStack[] itemsInAnvil = anvilInventory.getContents();
  11. ItemStack slot1 = itemsInAnvil[0];
  12. ItemStack slot2 = itemsInAnvil[1];
  13. ItemStack slot3 = itemsInAnvil[2];
  14. for(String lores : listOfLores){
  15. if(slot1.getItemMeta().getLore().contains(lores)){
  16. if(slot2.getItemMeta().getLore().contains(lores)){
  17.  
  18. }
  19. }
  20. }
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement