editor icon indicating copy to clipboard operation
editor copied to clipboard

Molang parser doesn't handle context switch operator correctly

Open Joelant05 opened this issue 3 years ago • 0 comments

The following script in a .molang file function will not compile correctly

for_each(v.player, q.get_nearby_entities(16, 'minecraft:player'), {
    v.playerloc.x = v.player -> q.position(0);
    v.playerloc.z = v.player -> q.position(2);
    break;
});

Error: Cannot use context switch operator "->" on FunctionExpression

I tried changing q.position(0) and q.position(1) to q.position and it compiles correctly, but this isn't valid in Minecraft

Joelant05 avatar Aug 16 '22 09:08 Joelant05