8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Trigger Reactor (TR) has two main components: Triggers and Scripts.
Triggers are events that you want TR to react to so it can run your scripts. For example, if we wanted TR to react to us walking over a set block we can create a walk trigger:
/trg walk #MESSAGE "Hello!"
If you did everything correctly, you should see Hello! show up in chat.
Hello!
Note: You can delete this trigger by using the bone tool, or by deleting it in the WalkTrigger folder.
There are many triggers already built into TR, but if you need to, you can use any event. Even those from third party plugins!
Here is a full list of triggers currently available: Triggers
Scripts tell TR what you want it to do. In the above example, you are using the #MESSAGE executor. This tells TR that you want to send the player a message in chat.
Scripts can contain:
You can run a script without a trigger by using the command /trg run <script>. This is useful for debugging purposing if you are experiencing errors, or if you want to see how certain variables/placeholders will be parsed.
/trg run <script>
For example:
/trg run #MESSAGE "My name is" + $playername
Run multiple scripts by using a semi-colon:
/trg run #MESSAGE "Spawning a creeper."; #SPAWN "CREEPER"
Executors are what makes things actually happen. You can set the time of day, or teleport players to a different location for example.
#MESSAGE
#SPAWN
Here is a full list of executors currently available: Executors
Placeholders are used to reference variables within your server. You can use them to get a players name for example.
$playername
A full list of placeholders is available here: Placeholders
Conditions allow you to trigger scripts only when certain criteria is met. For example, you can make it so a trigger can only happen during a specific time of day:
IF $time == 18000 #MESSAGE "It is midnight." ENDIF
For more information on conditions: Conditions
Variables allow you to store data to be used in other triggers or scripts. For example, you can create a variable called points and use it in your scripts.
points
points = 10 #MESSAGE "I have " + points + " points."
This would output I have 10 points.
I have 10 points.
For more information on variables: Variables
You can directly access all methods on spigot. With methods, there is almost no limitation with what you can do in your scripts. If there is an executor or placeholder you want but isn't listed, you can usually use methods to do what you want.
For more information on methods: Methods
Syntax is the language used by TR in order to run your scripts. If your syntax is incorrect, then you will get errors and your script will not work.
Trigger Reactor will read your script from left to right, then top to bottom.
#MESSAGE "First"; #MESSAGE "Second" #MESSAGE "Third"
We call a form of instruction Statement. For example, in the code above, #MESSAGE "First" is an instruction that will display First to the player when run. #MESSAGE "Second" is another statement as well. Each statement will be executed in order, but the order can altered by control statements like the IF/ELSE statement. Otherwise, each statement run one by one, from left to right and top to bottom.
#MESSAGE "First"
#MESSAGE "Second"
You can separate each statements by using a semi-colon, or by creating a new line. The above example has three different scripts that will run in the specified order. (First, Second, then Third)
There are three main data types in Trigger Reactor:
You can do almost any mathematical operation on numbers, using order of operations.
Strings must always be surrounded by double quotes! If you do not put in double quotes, TR will treat as a Local Variable, or a number.
You can add strings and numbers together by using concatenation. Do this by using the + operator.
"My name is " + "Bob."
My name is Bob.
"I am " + 10 + " years old."
I am 10 years old.
Boolean is value either be true or false. They are most often used in Conditions.
Comments are completely ignored by TR's compiler. So you can add notes to your scripts without throwing any errors. This is also useful for disabling scripts without having to delete them.
There are two types of comments:
You can comment out a single line by putting double slashes in front of it.
//#MESSAGE "This is a comment and will not be run."
You can comment multiple scripts by using /* and */.
/*
*/
/*#MESSAGE "This script will not be run" #MESSAGE "Nor will this one."*/
List and usage of Triggers / 트리거 목록과 사용 방법:
module x.x does not "opens x.x" problem