Repository navigation
Conversation
Earthcomputer
requested changes
Dec 5, 2026
Earthcomputer
left a comment
Owner
There was a problem hiding this comment.
Please, if you are going to entirely vibecode a PR, at least use a better clanker that's actually competent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
When a line inside a function file run through
/cfunctionis written wrongly — for example a command with a stray leading slash, like/csnap ~0.5 ~ ~— clientcommands answers with brigadier's generic 'unknown or incomplete command' error on the/cfunctioncommand in chat. The message names neither the function file nor the offending line, so players reasonably assume the command they just typed is at fault and go debug the wrong thing. Any player running/cfunctionon a function containing a malformed command hits this.Steps to reproduce:
test.mcfunction, in thefunctionsfolder of the clientcommands config directory./csnap ~0.5 ~ ~(the added test's minimal input is a file containing# comment, a blank line, then/unknown, so the bad command sits on line 3)./cfunction testin a world./cfunctioncommand itself, with no function name or line number.Root cause:
executeFunctioninsrc/main/java/net/earthcomputer/clientcommands/features/ClientCommandFunctions.javaparses each non-comment line of the function file with brigadier and, when a line does not parse completely, rethrows the raw exception returned byCommands.getParseException(command). That exception carries only brigadier's generic 'unknown or incomplete command' message about the leftover text — the function name and line number are dropped — so the failure reads as if the/cfunctioninvocation itself were malformed.What changed
The function file is now read through a size-capped input stream (at most 4 MiB, with a new
commands.cfunction.tooLargemessage for anything bigger) and decoded explicitly as UTF-8, while a counter tracks the current line number as lines are parsed. A line that fails to parse now throws a newPARSE_EXCEPTION(aDynamic3CommandExceptionType) combining the function name, the 1-based line number, and brigadier's underlying reason, rendered through the newcommands.cfunction.parseErrorentry, 'Error in function %s on line %s: %s'.A new
ClientCommandFunctionsTestcovers the error location for both/unknownandunknowninputs, a command that executes successfully, and the unknown-function path.Testing
./gradlew --no-daemon test --tests ClientCommandFunctionsTestwas invoked to run the new test, but the test command did not run because the credential lockout could not be built, so there is no pass or fail result to report. The new test src/test/java/net/earthcomputer/clientcommands/test/ClientCommandFunctionsTest.java did not run here: no test runner for it was available.Closes #759