📐How to make condition
Creating condition
Okay, we're starting to create our first condition. The new condition type that presents our conditions library is based on sections. Here is an example of the functionality of sections in the config:
conditions: # <-- This is section name.
first: # <-- This is the first section in our list of sections.
data1: # <-- We can add multiple data rows to the section
data2:
second: # <-- This is another section. You can create unlimited sections in the list.
Now you know how to use sections. Lets take a look at conditions format. When we create an condition, we name it arbitrarily. The name must be together and must be unique in the list.
conditions:
condition_name: # <<<---
Now you have to add condition data for full funcionality.
Select a condition type from the list of library conditions
or select condition type from specific plugin
. For a example we will make a has-permission condition.
Every condition request type. Determine the type as follows:
conditions:
condition_name:
type: has-permission # <-- here paste your selected type instead of a has-permission
Now just add requested data for your condition. HasPermission only request input. Each condition has a proper example in the conditions list
.
conditions:
condition_name:
type: has-permission
inoput: 'rotatingheads.create' # <-- example permission to check
Last updated
Was this helpful?