跳到主要内容

Cachable Fact Check Event

An event that triggers when a cachable fact matches a value

字段

字段类型默认值描述
factRef<CachableFactEntry>—The cachable fact to check.
amountVar<Int>0The amount that represents the required value to trigger the event.
operatorComparisonOperatorEQUALThe comparison operator to use (EQUAL, GREATER_THAN, LESS_THAN, GREATER_OR_EQUAL, LESS_OR_EQUAL).可选值:EQUALGREATER_THANLESS_THANGREATER_OR_EQUALLESS_OR_EQUAL
checkOnJoinBooleanfalseIf true, the event will check the fact for players when they join.
checkIntervalSecondsLong10Interval in seconds for periodic fact checks when enabled.
TypeWriter 通用字段(criteria, children, triggers, modifiers)
字段类型默认值描述
criteriaList<Criteria>empty—
childrenList<Ref<AudienceEntry>>empty—
triggersList<Ref<TriggerableEntry>>empty—
modifiersList<Modifier>empty—

How to use it​

Despite its name this entry is placed in an audience: it watches a counter fact and runs triggers when the value matches.

  • The comparison is fact operator amount, with operator one of EQUAL, GREATER_THAN, LESS_THAN, GREATER_OR_EQUAL, LESS_OR_EQUAL.
  • With checkOnJoin on, the check also runs when a player joins.
  • Every checkIntervalSeconds (default 10; 0 disables it) the check runs again for all online players that match criteria, and the triggers fire each time the value still matches. Add a modifier that changes the fact, or a criteria that no longer matches, to avoid repeated triggers.
  • The periodic check stops by itself when no trigger is configured or no online player matches criteria.