Skip to content

[1.21] internal exception kicks player from server due to message codec failure #1229

Description

@YukkuriC

when causing an internal exception, since the raw exception is passed to Component.translatable, server got something like

[018��2026 13:20:38.836] [Netty Server IO #6/ERROR] [net.minecraft.network.Connection/]: Exception caught in connection
io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:system_chat'
	at TRANSFORMER/minecraft@1.21.1/net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:55) ~[client-1.21.1-20240808.144430-srg.jar%23234!/:?]
[......STACKTRACE OMITTED......]
Caused by: io.netty.handler.codec.EncoderException: Failed to encode: This value needs to be parsed as component translation{key='hexcasting.mishap.unknown', args=[dev.latvian.mods.rhino.EvaluatorException: Can't find method at.petrak.hexcasting.api.casting.eval.vm.CastingImage.copy(at.petrak.hexcasting.api.utils.TreeList$TreeList1,number,at.petrak.hexcasting.api.utils.TreeList$TreeList0,boolean,number,net.minecraft.nbt.CompoundTag). (startup_scripts:HEX/patterns/RegistryBase.js#75)]}
[......STACKTRACE OMITTED......]

, which results in an instant kick

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions