Interaction of Molang within GameTest API would be really benefitial, it would interact well with data-driven addon system and allow more advanced creations. My idea of syntax would be a new class within "mojang-minecraft" module called Molang. It would have a method called execute which would take 2 parameters, first for the molang expression (Type: string) and second for the actor (Type: Entity, Block) it would return the same way as in any other Molang context within data-driven system and it would allow for 2 major interactions:
- Reading actor queries and variables.
- Modifying actor variables.
Example of script using Molang method:
import { Molang, World } from "mojang-minecraft";
var players = World.getPlayers();
var player = players[0];
var topSolidBlock = Molang.execute("q.above_top_solid(q.position(0),q.position(2))", player) - 1;
console.log(topSolidBlock); //Result would be Y level of the heighest solid block on current X and Z coordinate of the player, like in other Molang context
Please sign in to leave a comment.
0 Comments