I`m tried to get the command which executes when i click an npc on my server. How can i get this command?
I tried to use some modded client to get it but it didnt helped.
I`m tried to get the command which executes when i click an npc on my server. How can i get this command?
I tried to use some modded client to get it but it didnt helped.
There is not a direct event for that, but you can use "PlayerInteractEntity" and compare if the clicked entity is a Villager or whatever NPC you want.
Something like this:
@EventHandler
public void onPlayerInteractEntity(PlayerInteractEntityEvent e) {
Entity ent = e.getRightClicked();
if (ent instanceof NPC){
// Do whatever
}
}