Skip to content

Molang parser doesn't handle context switch operator correctly #564

@Joelant05

Description

@Joelant05

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions