aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/world/anhgelus/molehunt/Molehunt.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/world/anhgelus/molehunt/Molehunt.java b/src/main/java/world/anhgelus/molehunt/Molehunt.java
index 52399dc..d94e523 100644
--- a/src/main/java/world/anhgelus/molehunt/Molehunt.java
+++ b/src/main/java/world/anhgelus/molehunt/Molehunt.java
@@ -134,7 +134,10 @@ public class Molehunt implements ModInitializer {
return Command.SINGLE_SUCCESS;
})
));
- command.then(literal("moles").requires(source -> game != null && game.isAMole(source.getPlayer())).executes(context -> {
+ command.then(literal("moles").requires(source ->
+ (game != null && game.isAMole(source.getPlayer())) ||
+ (source.getPlayer() != null && source.getPlayer().isSpectator())
+ ).executes(context -> {
context.getSource().sendFeedback(() -> Text.translatable("commands.molehunt.moles.list").append(" " + game.getMolesAsString()),false);
return Command.SINGLE_SUCCESS;
}));