@ascentbv/ts-common - v1.0.221
    Preparing search index...

    Class MolangUtilAbstract

    Index

    Constructors

    Methods

    • Sends Molang data to an entity using a hidden animation controller.

      Parameters

      • entity: Entity

        The entity to send the animation to.

      • animation: string

        The animation name used to transfer data (e.g. "status_update").

      • data: Record<string, MolangValue>

        A map of Molang variable names to values.

      • receivers: Player[] = []

        Optional players to send the animation to. Defaults to all players.

      • enableDevUtil: boolean = false

      Returns void

      MolangUtil.send(entity, "status_update", {
      "v.health": 20,
      "v.is_tamed": true,
      "v.alert_level": { value: "query.time_of_day > 12000 ? 2 : 1" },
      });

      This will internally construct a stop_expression like: v.__time__=12345;v.__random__=87;v.health=20;v.is_tamed=1;v.alert_level=query.time_of_day > 12000 ? 2 : 1;return 0;