SethBling / cbscript

CBScript for Minecraft
1.13k stars 28 forks source link

I'm getting an error just trying to compile an example script? #30

Closed Jankoy closed 3 months ago

Jankoy commented 3 months ago

I downloaded the better_click_detector.cblib file and tried to compile it with compile.py, and I got this output:

Compiling better_click_detector...
Syntax error at line 1 column 14. Unexpected NEWLINE symbol "\n" in state 57.
Unable to parse script.
Script had compile error(s).

Is it an error on my end? Did I do something wrong? I have the most recent version.

AdoHTQ commented 3 months ago

If I'm understanding correctly, better_click_detector is a library so you can't compile it by itself. You would need to include it at the top of a .cbscript file to compile it. The error you are getting seems to be treating it like a script so it can't find the compile directory that would be on line 1.

Jankoy commented 3 months ago

I see, it is a .cblib file. I was just trying to download and compile something to see if it worked. Thanks.

Brian151 commented 3 months ago

if there's no actual distinction between .cblib and .cbscript other than semantics, it would actually make sense to compile it, anyways. by itself, it obviously wouldn't do anything, but it should be possible to turn it into, a DLL/module for other datapacks to use. and honestly, i think this would be a valid use case. say there's a common functionality like adding custom blocks/entities, it makes more sense to create datapack "std_blocks_and_entities" that all datapacks then rely on as a dependency versus individually compiling it into each one.