diff --git a/src/main/java/land/chipmunk/chipmunkbot/commands/RunCommand.java b/src/main/java/land/chipmunk/chipmunkbot/commands/RunCommand.java index 9410f34..234fb18 100644 --- a/src/main/java/land/chipmunk/chipmunkbot/commands/RunCommand.java +++ b/src/main/java/land/chipmunk/chipmunkbot/commands/RunCommand.java @@ -9,7 +9,6 @@ import static com.mojang.brigadier.arguments.StringArgumentType.getString; import com.mojang.brigadier.context.CommandContext; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; -import com.github.steveice10.opennbt.tag.builtin.Tag; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.opennbt.tag.builtin.StringTag; import java.util.concurrent.CompletableFuture; @@ -36,8 +35,12 @@ public class RunCommand extends Command { future.thenApply(tag -> { if (!tag.contains("LastOutput") || !(tag.get("LastOutput") instanceof StringTag)) return tag; final String outputJson = ((StringTag) tag.get("LastOutput")).getValue(); - final Component output = GsonComponentSerializer.gson().deserialize(outputJson); - source.sendOutput(output); + + try { + final Component output = GsonComponentSerializer.gson().deserialize(outputJson); + source.sendOutput(output); + } catch (Exception exception) { + } return tag; });