Skip to content

MCCompiled 1.18

Choose a tag to compare

@7UKECREAT0R 7UKECREAT0R released this 24 Apr 00:57
41722ec

Additions
• Added while command.
• Added repeat command. Differs from the compile-time version as it is runtime-only.
• Added countEntities(selector) function which counts the number of matching entities.
• Added support for checking for spectator mode in selectors.
• Added --trace compiler option for tracing execution path in chat; used only for debugging.
• New bindings for bind attribute:
• Added query.is_baby
• Added query.is_carrying_block (endermen)
• Added query.is_sitting (foxes, wolves/dogs, parrots)
• Added query.is_sneezing (llamas)
• Added query.is_transforming (zombies/husks)
• Added query.is_tamed
• Added query.is_elder (guardians)
• Added summon command; matches vanilla syntax.

Additions: Errors
Added loads of errors where previously the code was ignored. If some of your code is causing errors after these changes, it's most likely safe to remove the problematic parts because it wasn't valid; probably not even being processed in the first place.
• Added 7 new errors for conditions.
• Added 3 new errors for function definitions.
• Added 2 new errors for give command.
• Added an error for attempting to apply duplicate attributes to functions.
• Added an error for when tokens at the end of statements go unused (not including comments).

Additions: Async
• Async functions can now be created, allowing you to use the new await command inside of them.

async(global) makes the scheduler in a global context, not running on a specific entity.
async(local) makes the scheduler run on the calling entity only.
Does not support return values; returns an "awaitable"

• Added await command. Can be used inside async functions.
• await <time> waits for a specific amount of time.
• await until <condition> waits until a condition evaluates to true.
• await while <condition> waits while a condition remains true.
• await <awaitable> await another async function.

You cannot await a local function from a global function.

• Async isn't yet supported in repeat and while, but support is coming.
• Async is supported with if and else.
• halt and throw properly cancel execution of async functions.

Additions: Web Editor
I'm planning on focusing on LSP for 1.19 and integrating into VSCode, but since the web editor is already VSCode based, these fixes are an essential step regardless.
• Updated to Monaco 0.47.0

Sticky lines support.

• Enabled code mini-map only when hovered (right-side).
• Set default font to Jetbrains Mono
• Added button to switch to Minecraft Font (Monocraft)

Changes
• Changed exporter udl2.1 to notepadplusplus for clarity.
• Overhauled raw exporter to output JSON and much more information.
• Added raw-min exporter, which is just the minimized version of raw.

Bugfixes
• Made throw show source code rather than compiled code (including location).
• MCCompiled now internally strips inline comments away to prevent unexpected errors.

Full-line comments still remain for uses like documentation; just inline comments are stripped.

• Decimals multiplied using time suffixes are once again interpreted as integers (e.g., 0.5s)
• playsound command no longer requires a selector, defaulting to @s if unspecified.
• Fixed function re-definitions (e.g., partials or overloads) being interpreted as a call if there was parentheses.
• (Web Editor) Autocomplete no longer triggers inside comments or strings.
• (Web Editor) Unclosed strings are now highlighted.
• Made all generated file names use consistent camelCase formatting.