@minecraft
    正在准备搜索索引...

    类 ObservableString实验性

    An observable that holds a string value. Listeners are notified whenever the value changes.

    索引

    构造函数

    方法

    • 世界修改 早期执行

      返回 string

      Returns the current string value held by this observable.

    • 世界修改

      参数

      返回 Promise<string | TextFilteringError[]>

      Gets filtered data from the Observable (only available for strings). In case of failure, it will return an array of TextFilteringError that can provide more context about the filtering process. For testing purposes, the options are available under 'Creator -> Text Filtering' settings menu. This delay is only applied to the getFilteredText function and can be used to simulate network latency when testing.

      This function can throw errors.

      EngineError

      InvalidEntityError

    • 世界修改 早期执行

      参数

      • data: string

        The new string value to set.

      返回 void

      Updates the string value held by this observable. If the new value differs from the current value, all subscribed listeners are notified with the new value.

    • 世界修改 早期执行

      参数

      • callback: (arg0: string) => void

        A function that receives the new string value each time the observable changes.

      返回 (arg0: string) => void

      Registers a callback to be invoked whenever the observable's value changes. Returns the callback, which can be passed to unsubscribe to remove the listener.

    • 世界修改 早期执行

      参数

      • callback: (arg0: string) => void

        The callback handle previously returned by subscribe.

      返回 boolean

      Removes a previously registered listener from this observable. Returns true if the listener was found and removed, false if it was not found.