WingedSeal / jmc

A compiler for JMC (JavaScript-like Minecraft Function), a mcfunction extension language for making Minecraft Datapack
https://jmc.wingedseal.com
MIT License
64 stars 7 forks source link

[BUG] cant use macros in conditions #99

Closed amqndin closed 3 months ago

amqndin commented 3 months ago

Describe the bug

here is the code:

$if (resist.effect.$(effect_type):@s[type=!player] == true) {

and here is the error:

JMCValueError
In src/code/arthealth/combat.jmc:91:10
Unrecognized condition 'resist.effect.$' at line 91 col 10.
90 |
91 |    $if (resist.effect.$(effect_type):@s[type=!player] == true) {
             ^^^^^^^^^^^^^^^
92 |      $effect.resist = true;
Consider using one of the following: biome, block, blocks, data, dimension, entity, function, loaded, predicate, score.

To Reproduce

try using a macro thats not wrapped in quotes in a condition

Desktop

Additional context

after some testing its actually the extra bracket in the macro reference that causes this issue.

WingedSeal commented 3 months ago

This is a duplicate of https://github.com/WingedSeal/jmc/issues/98

Nico314159 commented 2 months ago

This is a duplicate of #98

Personally I would've closed #98 and kept this one open, since #98 is a more specific version of this one.