Interact with an Armorstand

Discussion in 'Spigot Help' started by SpassiHD, Mar 17, 2020.

  1. Hey I try to interact with an armorstand but it doesn't work. I want to interact with a specific custom name. Here is my code:
    Code (Java):
    @EventHandler
        public void clickOnChest(PlayerInteractAtEntityEvent e) {
            if (e.getRightClicked().getType() == EntityType.ARMOR_STAND) {
                if (e.getRightClicked().getCustomName().equalsIgnoreCase(normalLootChestName)) {
                    e.setCancelled(true);
                    e.getPlayer().sendMessage("output");
                }
            }
        }
    Can you please say me what I should to do that it works, Thanks!