I've taken a look at the code, and the fix seems to be quite simple.
In a normal command block, a check is done to see if the string is empty beforehand (yarn mappings):
ServerPlayNetworkHandler#onUpdateCommandBlock
commandBlockExecutor.markDirty();
if (!ChatUtil.isEmpty(string)) {
this.player.sendSystemMessage(new TranslatableText("advMode.setCommand.success", new Object[]{string}), Util.NIL_UUID);
}
But, in a minecart command block, the implementation is different (yarn mappings):
I've taken a look at the code, and the fix seems to be quite simple.
In a normal command block, a check is done to see if the string is empty beforehand (yarn mappings):
ServerPlayNetworkHandler#onUpdateCommandBlock
But, in a minecart command block, the implementation is different (yarn mappings):
ServerPlayNetworkHandler#onUpdateCommandBlockMinecart
This issue can easily be solved by only calling sendSystemMessage if ChatUtil#isEmpty returns false like a normal command block