diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java b/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java index ddf94ab..0e8440e 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java @@ -10,6 +10,7 @@ import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayNetworkHandler; +import net.minecraft.client.network.ClientPlayerEntity; public class CustomChat { private final MinecraftClient client; @@ -30,7 +31,8 @@ public class CustomChat { } public void chat (String message) { - if (!enabled) { + final ClientPlayerEntity player = client.player; + if (!enabled || !player.hasPermissionLevel(2) || !player.isCreative()) { final ClientPlayNetworkHandler networkHandler = client.getNetworkHandler(); networkHandler.sendChatMessage(message); return;