}
}
// Call NPC talk event
if (npc.getNPCData().isTalk() && UtilityProperties.isHoldingTool("TalkItems", player)) {
Player target = (Player) e.getTarget();
NPCTalkEvent talkEvent = new NPCTalkEvent(npc, target, MessageUtils.getText(npc, target));
Bukkit.getServer().getPluginManager().callEvent(talkEvent);
if (!talkEvent.isCancelled()) {
if (!talkEvent.getText().isEmpty()) {
Messaging.send(target, npc, talkEvent.getText());
}
}
}
NPCRightClickEvent rightClickEvent = new NPCRightClickEvent(npc, player);
Bukkit.getServer().getPluginManager().callEvent(rightClickEvent);