ConditionEntity
variableContains
since v5.10Checks if the specified variable contains a given value. This can either be done between strings or sets
Aliases
variableContainvarContainsvarContainvarCont
Configuration Fields (1)
| Name | Type | Default | Description |
|---|---|---|---|
| value val, v | PolymorphicPlaceholder | — | The value to match |
Examples & Notes
Descriptions
Checks if the given variable contains a certain value.
- For String variables, is it checked if the variable contains a substring. Based on the compareType used, it can also be checked if the variable “starts with” or “ends with” the given value.
- For List or Set variables
- If the value is a simple string, it is checked if the List or Set contains the value
- If the entry is another List or Set, it is checked if the variable contains all or any of the elements of the value, based on the compareType.
Examples
Conditions:
- variablecontains{var=skill.examplelist;val=hello}
- variablecontains{var=skill.examplelist;val=hello,world;compareType=ANY}
- variablecontains{var=skill.examplestring;val=pizza}
- variablecontains{var=skill.examplestring;val=dungeon_;compareType=STARTS_WITH}
Universal Condition Options
- Author:
- Lxlp