Ir para conteúdo

ITEM NÃO EXCLUÍ


Joao5567

Posts Recomendados

  

Estou em duvida com um codigo, Tou tentando fazer que quando ele clicar nessa Runa com um Beacon, o Beacon fique encantado e a ruma suma, Mas não tou conseguindo remover o item, Se pudessem me ajudar seria grato.

 

 @EventHandler
    public void onClick(InventoryClickEvent e) {
        
        if (e.getCurrentItem() == null) return;
        if (e.getCurrentItem().getType() == Material.AIR) return;
        
        if (e.getCursor().getItemMeta() != null) {
            if (e.getCursor().getItemMeta().getDisplayName() != null) {
                if (e.getCursor().getType() != Material.AIR) {
                    if (e.getCursor().getItemMeta().getDisplayName().contains("§6Runa da Evolução") && e.getCurrentItem().getType() == Material.BEACON) {
                            Player p = (Player)e.getWhoClicked();    
                            e.getCursor().setType(Material.AIR);
                             p.getInventory().removeItem(e.getCursor());
                    }
                }
            }
        }
    }

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...