Skip to content

Commit

Permalink
Fix /npc command random
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Jul 15, 2020
1 parent 4e26f52 commit 0036c9d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main/src/main/java/net/citizensnpcs/trait/CommandTrait.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,11 @@ public boolean apply(NPCCommand command) {
return command.hand == hand || command.hand == Hand.BOTH;
}
}));
if (executionMode == ExecutionMode.RANDOM && commandList.size() > 0) {
runCommand(player, commandList.get(Util.getFastRandom().nextInt(commandList.size())));
if (executionMode == ExecutionMode.RANDOM) {
if (commandList.size() > 0) {
runCommand(player, commandList.get(Util.getFastRandom().nextInt(commandList.size())));
}
return;
}
int max = -1;
if (executionMode == ExecutionMode.SEQUENTIAL) {
Expand Down

0 comments on commit 0036c9d

Please sign in to comment.