Open Cynthia7979 opened 2 weeks ago
First of all, this is a user error :) If a function, that is supposed to return nothing, returns something nevertheless, the code won't compile and therefore cannot be executed. I don't really think a warning is needed here as this is just based on wrong syntax assumptions, but maybe it would help some people.
Sadly there is not much documentation about the custom filter scripts yet. Apart from the custom filter tutorial I wrote a while back there is barely any, if not none. But I created a repo with some useful examples and am planning to add more filters over time and make it a place for everyone to share their examples. Currently there are a few examples for filters and modifiers. You can check them out here. And if you still need help, you can check out the Discord Server and ask for help there.
Hope that helps :)
Thanks! The custom filter tutorial was of some help, though it does not fully apply to NBT change use cases. I will check out the examples you linked!
Describe the bug It seems that
apply(ChunkData data)
,before()
, andafter()
will not be run at all if anything is returned by one of them.To Reproduce
null
. For example:return 1;
Expected behavior Depending on the nature of what caused the bug, I would expect either of these behaviors:
null
value was returned by any of the methods. Or,return
statement is entered into any of the functions, then after clicking on 'OK' while having the "Script" tab open, an error should be shown in a message dialog and be printed to the log file. The error message should indicate that the code was not executed because it contained areturn
statement.Screenshots and other files Screenshots and log will probably not tell much since the bug is the absence of log or error message. Here's them anyway:
mcaselector.log mcaselector.log
Environment (please complete the following information):
Additional context Would greatly appreciate it if there can be some sort of documentation for modifying chunk NBT via custom script. The Custom field is helpful but does not allow importing libraries, and I still haven't figured out how you're supposed to use the Script field yet 😅