Skip to content

Commit

Permalink
Add debug for /npc command
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Jun 12, 2020
1 parent bcf932d commit a591089
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main/src/main/java/net/citizensnpcs/trait/CommandTrait.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ public NPCCommand(int id, String command, Hand hand, boolean player, boolean op,

public void run(NPC npc, Player clicker) {
String interpolatedCommand = Placeholders.replace(command, clicker, npc);
if (Messaging.isDebugging()) {
Messaging.debug(
"Running command " + interpolatedCommand + " on NPC " + npc.getId() + " clicker " + clicker);
}
if (!player) {
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), interpolatedCommand);
return;
Expand Down

0 comments on commit a591089

Please sign in to comment.