8000 Executors · TriggerReactor/TriggerReactor Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Felleus edited this page Mar 19, 2024 · 133 revisions

Executors are commands you can use in triggers. TriggerReactor provides over 50 executors by default, but you can create your own Executors as well using JavaScript.

Try it yourself:

/trg run #POTION "LUCK", 100

Built-in Executors

This is a list of the executors that come with TriggerReactor. Be careful when putting in arguments.

Things to note:

  • Strings have double quotes, while numbers, variables, and boolean do not.
  • Item/Entity references since 1.13.2+ should use String ID instead of item number.
    Example:
    #DROPITEM <String ID>, 1, "NONE", -204, 82, 266
    #DROPITEM "APPLE", 1, "NONE", -12, 0, 15
    String ID is based on Material Enum
    https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html

#ACTIONBAR #ACTIONBAR color("&cMy Action Bar")

Show actionbar to the current player.

  • You may specify the player
    • #ACTIONBAR player("wysohn"), color("&cMy Action Bar")### #BREAK and #CONTINUE Control the flow of WHILE and FOR loop. See Loop for details.

#BROADCAST #BROADCAST "Hello Server!"

Broadcast a message to all players.

#BURN #BURN 5

Burn current player for specified seconds.

  • If you want to specify other player or entity, you may use two parameters instead
    • #BURN {player name} {seconds}
      • #BURN "wysohn" 5
    • #BURN {Entity instance} {seconds} *#BURN player("wysohn") 5 *Though, if you are not an experienced plugin developer, ignore this one.

#CALL #CALL "NamedTrigger"

Execute a named trigger.

  • Advanced Users: By default, named triggers will run synchronously. To run concurrently: #CALL "NamedTrigger" false

#CANCELEVENT #CANCELEVENT

Cancel the event that has activated the trigger.

  • Advanced Users: This has no effect if your Trigger is running asynchronously. The event is already processed and out of your hand at the point if the Trigger is running asynchronously.

#CLEARCHAT #CLEARCHAT

Clear current player's chat.

Since 2.2.0 You can also specify a different player whose chat will be cleared: #CLEARCHAT player("Pro_Snape")

#CLEARENTITY #CLEARENTITY 5

Clear all entities around current player's radius.

#CLEARPOTION #CLEARPOTION

Clear all potion effects

  • If you want to clear a specific potion type only, provide it as argument. #CLEARPOTION "LUCK"

#CLOSEGUI #CLOSEGUI

Close the inventory which the player is currently watching.

#CMD #CMD "spawn"

Make the current player execute a command.

  • Append arguments like this: #CMD "spawn" true

#CMDCON #CMDCON "version"

Executes a command through console.

  • Append arguments like this: #CMDCON "version" true

#CMDOP #CMDOP "spawn"

Make the current player execute a command as an OP.

  • Append arguments like this: #CMDOP "spawn" true

#COOLDOWN #COOLDOWN 10

Add a cooldown to the trigger in seconds.

#DOORCLOSE #DOORCLOSE -204, 78, 266

Close the door at the specified coordinate.

#DOOROPEN #DOOROPEN -204, 78, 266

Open the door at the specified coordinate.

#DOORTOGGLE #DOORTOGGLE -204, 78, 266

Open/Close the door at the specified coordinate.

#DROPITEM #DROPITEM 1, 1, "NONE", -204, 82, 266

Drop item at any location.

  • #DROPITEM {ID} {Amount} {Enchantment String} {x} {y} {z}
    • Enchantment String EnchantName:Level,EnchantName:Level,...
      • EnchantName
      • #DROPITEM 1, 1, "LUCK:0,POISON:1", -204, 82, 266
      • If you do not want to specify the enchantment, just put "NONE"
        • #DROPITEM 1, 1, "NONE", -204, 82, 266
  • #DROPITEM {ID} {Data} {Amount} {Enchantment String} {x} {y} {z}
  • #DROPITEM {ID} {Amount} {Enchantment String} {Location instance}
  • #DROPITEM {ID} {Data} {Amount} {Enchantment String} {Location instance}
  • #DROPITEM {ItemStack instance} {Location instance}
    • You can therefore can use item saved in global variable
      • /trg vars Item {"item.on.hand.saved"}
      • #DROPITEM {"item.on.hand.saved"} location($worldname, -204, 82, 266)

#EXPLOSION #EXPLOSION 100, 70, 100, 2.0, false

Creates explosion at location

  • You can add the following options:
    • power - the explosion power. 4.0 is equivalent to a TNT explosion. If power is not specified, it will default to 4.0
      • #EXPLOSION 100, 70, 100, 4.0
      • #EXPLOSION $x, $y, $z, 4.0
    • fire - set it to true if you want the explosion to cause fire. (like a ghast fireball)
      • #EXPLOSION 100, 70, 100, 5.0, true

#FALLINGBLOCK #FALLINGBLOCK 1, -204, 82, 266

Spawn a falling block at the location

  • #FALLINGBLOCK {block id} {x} {y} {z}
  • #FALLINGBLOCK {block id} {block data} {x} {y} {z}
  • #FALLINGBLOCK {block id} {Location instance}
  • #FALLINGBLOCK {block id} {block data} {Location instance}

#GIVE #GIVE {"items.0"}

Gives an item to the player.

  • You can give vanilla items using the item() function. The data value is optional.
    • #GIVE item(ID, Amount, Data Value)
    • #GIVE item("DIAMOND",8)

#GUI #GUI "MainMenu"

Opens an inventory trigger. If the player already has an inventory open, that inventory will close.

#ITEMFRAMEROTATE

#ITEMFRAMESET

#KICK #KICK Since 2.2.1

Kick a player.

Usage Description
#KICK kick the sender with a generic reason.
#KICK "Reason" Kick the sender with provided reason.
#KICK player Kick a provided player without saying any reason.
#KICK player "reason" Kick a provided player with provided reason.

#KILL#KILL

Kill current player immediately.

  • Only applies if the player is in Survival or Adventure mode Since 2.0.0 this will now work on any gamemode.

#LEVEROFF

Make the lever powered-off at the specified coordinate.

#LEVERON

Make the lever powered-on at the specified coordinate.

#LEVERTOGGLE

Power on/off the lever at the specified coordinate.

#LIGHTNING #LIGHTNING $worldname, 100, 70, 100

Strikes lightning at location

#LOG #LOG "Hello Console!"

Sends a message to console.

#MESSAGE #MESSAGE "Hello There!"

Sends a message to the player.

  • To send multiple lines of messages, separate them with spaces or comma
    • #MESSAGE "Hello There!" "How are you?" "Welcome!"

#MODIFYHELDITEM#MODIFYHELDITEM "TITLE" "ThisIsMyItem"

Modify the current item's information

Type Value Usage
TITLE String #MODIFYHELDITEM "TITLE" "ThisIsMyItem"
LORE String, String, String, Number(optional) #MODIFYHELDITEM "LORE" "ADD" "ThisIsMyItem" 4
LORE String, String, String, Number #MODIFYHELDITEM "LORE" "SET" "ThisIsMyItem" 4
LORE String, String, Number #MODIFYHELDITEM "LORE" "REMOVE" 4
  • Remarks
    • using LORE ADD with index out of the range will add the line to the end of item lore anyway.
    • using LORE SET with index out of the range will fill the lore with empty string until the specified index.
    • LORE DELETE silently fails if index is out of range.

#MONEY #MONEY 100

Give money to the current player.

  • Error will occur if Vault is not installed.
  • You can give negative money to take money instead to give money.
    • #MONEY -100

#MYSQL #MYSQL "myValue" "Hoho"

Save value into Mysql database.

  • The value part can be String, Number, or Boolean
  • For Advanced User Only:
    • You may use any value that implements Serializable interface.
    • ObjectOutputStream is used to serialize the data into string before saving into Mysql.
    • Even though TR uses pooled connection, it's always best practice to use MYSQL operation only in asynchronous Triggers.

#PERMISSION #PERMISSION "my.permission"

Give permission to current player

  • Not implemented in Sponge.

  • Error will occur if Vault is not installed.

  • You may delete permission by giving negative sign in front of the permission.

    • #PERMISSION "-my.permission"

#POTION #POTION "LUCK" 100 1

Gives player a potion effect.

  • Potion duration should be set with ticks(20ticks = 1second)
  • You may specify the potion level (#POTION "BLINDNESS" 100(ticks) 2(level))
    • #POTION "LUCK" 100 1
    • #POTION "HEAL" 500 2
  • You can find potions here

#PUSH #PUSH player, 1, 2, -5

Pushes an entity in specific direction. Higher values will have a stronger effect.

  • #PUSH {entity} {x} {y} {z}

#ROTATEBLOCK #ROTATEBLOCK "EAST", -204, 82, 266

Rotate the block to the given direction

  • #ROTATEBLOCK {"Direction (see the link below)"}
  • #ROTATEBLOCK {"Direction"} {location}
  • #ROTATEBLOCK {"Direction"} {x} {y} {z}

Directions: Bukkit, Sponge

#SCOREBOARD #SCOREBOARD "OBJ" "someobjective:dummy" "SLOT" "SIDEBAR"

Modify the current player's scoreboard. This is individual to each players.

Type Value Usage
OBJ String, String, String, Number #SCOREBOARD "OBJ" "myObjective:someCriteria" "SET" "valuename" 100
OBJ #SCOREBOARD "OBJ" "myObjective:someCriteria" "SET" "valuename" null
OBJ String, String, String #SCOREBOARD "OBJ" "myObjective:someCriteria" "NAME" "displayname"
OBJ #SCOREBOARD "OBJ" "myObjective:someCriteria" "SLOT" "SIDEBAR"
TEAM String, String, String #SCOREBOARD "TEAM" "myteam" "ADD" "someplayername"
TEAM #SCOREBOARD "TEAM" "myteam" "REMOVE" "someplayername"
TEAM #SCOREBOARD "TEAM" "myteam" "PREFIX" "prefix"
TEAM #SCOREBOARD "TEAM" "myteam" "SUFFIX" "suffix"
TEAM #SCOREBOARD "TEAM" "myteam" "NAME" "teamname"
TEAM String, String, Boolean #SCOREBOARD "TEAM" "myteam" "INVISHARE" true
TEAM #SCOREBOARD "TEAM" "myteam" "TEAMDAMAGE" false
  • Remarks
    • Scoreboard will use the current one already set for the player. If scoreboard is not set already, then new one will be created.
    • For the value for the "SLOT" option of Objective, see DisplaySlot for the names
    • For the Team, new team will be created each time if the team with provided doesn't exist.

#SERVER #SERVER "lobby"

For bungeecord setups. Sends the player to specified server.

  • Not implemented in Sponge.

#SETBLOCK #SETBLOCK "STONE", -204, 82, 266

Set block at the specified coordinate

(Since Bukkit 1.13, only material name is allowed.)

  • #SETBLOCK {block id} {x} {y} {z}
  • #SETBLOCK {block id} {block data} {x} {y} {z}
  • #SETBLOCK {block id} {Location instance}
  • #SETBLOCK {block id} {block data} {Location instance}

Special Consideration

If you are using #SETBLOCK within a trigger or event related to 'block,' such as onBlockBreak or org.bukkit.event.block.BlockBreakEvent, the usage is fixed as follow:

  • #SETBLOCK {block id}
  • #SETBLOCK {block id} {block data}

In this case, the block associated with the event is already understood by the #SETBLOCK itself, so you don't have to specify the location twice.

#SETHEALTH #SETHEALTH 19.5

Sets the current player's health, measured in half-hearts. Must not be more than the max health or less than 0. This executor works even if the health bar is not visible (creative/spectator mode)

#SETHELDITEM #SETHELDITEM item("APPLE", 1) Since 3.0

Set the held item. The old item will be lost.

#SETOFFHAND #SETOFFHAND item("SHIELD", 1) Since 3.0

Set the item in the offhand slot. The old item will be lost.

#SETSLOT #SETSLOT 8, item("STONE", 1) Since 3.0

Set the player's current inventory slot. The old item will be lost.

#SETPLAYERINV #SETPLAYERINV 0, item("AIR", 1) Since 3.0

  • SETPLAYERINV {slot} {item} Set an item in the player’s inventory. Inventory slot numbers start at 0. The old item will be lost.

#SETSATURATION #SETSATURATION 0

Sets the current player's saturation. Must be a positive value. For more information about saturation, look here.

#SETXP #SETXP 0.2

Sets the current player's xp until the next level, as a percentage value between 0.0 and 1.0, with 1.0 representing the next level and 0.0 representing no progress.

#SETWALKSPEED #SETWALKSPEED 0.2

Sets the current player's walking speed, as a number between -1.0 and 1.0. 0.2 is the normal walking speed. 0.1 is the normal sneaking speed. A negative value will make the player walk backwards.

#SETFLYSPEED #SETFLYSPEED 0.1

Sets the current player's flying speed, as a number between -1.0 and 1.0. 0.1 is the normal flying speed. A negative value will make the player fly backwards. (This will also reverse ascend/descend directions, so the player will have trouble getting off the ground)

#SETFLYMODE #SETFLYMODE true

Sets whether or not the player is allowed to fly. Setting it to true will allow them to freely switch in and out of flight and immediately switch them to flight mode. Setting it to false will disable their flight permissions and they will immediately stop flying.

#SETFOOD #SETFOOD 18

Sets the current player's food level, measured in half-meats. Must not be more than the max food level or less than 0. This executor works even if the health bar is not visible (creative/spectator mode).

#SETGAMEMODE #SETGAMEMODE 1

Sets the current player's gamemode. The following values are allowed:

String Number
"survival" 0
"creative" 1
"adventure" 2
"spectator" 3

#SETITEMLORE {lore} {item}#SETITEMLORE "This sword protects you...\nIf you use it well", $helditem Since 3.0

Set the lore of the specified item. Color codes using & are supported. To create a lore with multiple lines, separate the lines with \n

#SETITEMNAME #SETITEMNAME "Weed Whacker", $helditem Since 3.0

Set the name of the specified item. Color codes using & are supported.

#SETCOUNT #SETCOUNT 3, $helditem (Coming in 3.1)

Sets quantity of provided item.

#SETTYPE #SETTYPE "STONE", $helditem (Coming in 3.1)

Sets the type of provided item. [ONLY Bukkit Supported]

#SETMAXHEALTH #SETMAXHEALTH 24

Sets the current player's max health, measured in half-hearts. Must be at least 1

#SIGNEDIT #SIGNEDIT 0, "test", -205, 79, 266

Change the line of the sign post

  • #SIGNEDIT {line index} {new text} {x} {y} {z}
  • #SIGNEDIT {line index} {new text} {Location instance}

#SOUND #SOUND player.getLocation(), "ENTITY_PLAYER_LEVELUP", 1.0, 1.0

Plays a sound to the player at the given location. The numbers after the sound name are volume, then pitch.

  • Bukkit, Sponge
  • Volume: Should be 0.0 to 1.0.
  • Pitch: Can be 0.5 to 2.0.

#SOUNDALL #SOUNDALL player.getLocation(), "ENTITY_PLAYER_LEVELUP", 1.0, 1.0

Same as #SOUND, except all players can hear it. Volume is a bit different here. It can be higher than 1.0, but it will not increase in volume. Instead, it will start to increase the distance that players can hear the sound.

#SPAWN #SPAWN "CREEPER"

Spawn an entity at the players location.

  • List of Entities: Bukkit Sponge
  • You can use a global variable to set the location: #SPAWN {"locations.creeperspawner"} "CREEPER"

#STOP #STOP

Immediately stop the script. The Trigger will stop immediately. The process will be completely terminated and no other codes will be interpreted.

#TIME #TIME $worldname 12000

Change the time of the world

#TP #TP 100, 60, 100 , 90, 20

Teleports the player to coordinates x, y, z, yaw, and pitch.

  • You can also use a global variable in place of coordinates.
    • /trg vars Location some.place.to.tp
    • #TP {"some.place.to.tp"}

#VELOCITY #VELOCITY 0, 2, 0

Set velocity of the current player.

#WAIT #WAIT 5

Pause the script for a time in seconds.

#WEATHER #WEATHER $worldname true

Set weather of the world. Set it true means the world will snow/rain.

Deprecated Executors

These Executors are deprecated in the latest version and are no longer supported. They may be removed in a future release.

#MODIFYPLAYER #MODIFYPLAYER "HEALTH" 10 Deprecated since 2.2.0

Modify the current player.

Type Value Desc
HEALTH Number 20 is MAX heart for vanilla
FOOD Number 20 is MAX food for vanilla
SATURATION Number 20 is MAX saturation for vanilla
EXP Number 0.0 to 1.0. 1.0 is full bar
WALKSPEED Number 0.2 is the default
FLYSPEED Number 0.1 is the default
FLY Boolean true for enable; false for disable
GAMEMODE String SURVIVAL, CREATIVE, ADVENTURE, SPECTATOR(may not work for old versions)
MAXHEALTH Number Max health of player. Similar to HEALTH

#MODIFYPLAYER has been superseded by the following executors:

  • #SETFOOD
  • #SETHEALTH
  • #SETSATURATION
  • #SETXP
  • #SETWALKSPEED
  • #SETFLYSPEED
  • #SETFLYMODE
  • #SETGAMEMODE
  • #SETMAXHEALTH

As you can see, each one in this list corresponds to an option in MODIFYPLAYER. Changing your code to use the executors in this list will make it shorter, so please do so. Note that none of these are available before version 2.2.0.

Plugin Description / 목차

1. Getting Started () (рус)

S.L. In-game Editor () (рус)

2. Triggers () (рус)

List and usage of Triggers / 트리거 목록과 사용 방법:

  • List of Executors / 실행자(Executor) 목록

4. Placeholders () (рус)

  • Using PlaceholderAPI / PlaceholderAPI 사용법
  • List of Placeholders / 플레이스 홀더(Placeholder) 목록

5. Conditions () (рус)

  • Creating Conditions / 조건식 만들기
    • Boolean Expressions / 부울 (Boolean) 표현 방법
  • Logical Operators / 연산자 사용법
  • IF statement / IF 조건문
  • Null Checking / Null 검사법
  • Switch Case / Switch Case 조건

6. Variables () (рус)

  • Local Variables / 지역 변수
  • Global Variables / 전역 변수

Advanced

Timings () (рус)

7. Methods () (рус)

  • Using Methods / 메소드 사용법
  • Special Data Types / 특수한 데이터 형식
  • Reading Javadocs / Javadoc 읽기
  • Handling Enum / Enum 데이터 처리
  • Lambda Expresion / Lambda(람다) 식 사용법

8. Array () (рус)

  • Creating an empty array / 빈 배열 만들기
  • Storing data into array / 배열에 데이터값 저장하기
  • Read data from array / 배열에서 데이터 읽기(불러오기)

9. Loops () (рус)

  • WHILE loop / WHILE 반복문
  • FOR loop / FOR 반복문
    • Iterating Collection / Collection 형식의 변수 순회법
    • #BREAK executor / #BREAK 실행자
    • #CONTINUE executor / #CONTINUE 실행자

10. Sync Mode () (рус)

  • #CANCELEVENT executor / #CANCELEVENT 실행자
  • Setting Sync/Async Mode / 동기, 비동기 모드 전환
    • Custom Trigger
    • Area Trigger

11. Custom Executors () (рус)

12. Plugin Access () (рус)

  • Check And Use / 플러그인 존재여부 확인
    • Get Third Party Plugin / 제 3자 플러그인 불러오기
    • Check Eligibility / 호환성 확인하기
    • Use the Plugin / 플러그인 사용하기

13. IMPORT Statement () (рус)

  • Creating new instance / 새 인스턴스 생성하기
  • Accessing static method / 종속 메소드 불러오기
  • Accessing static field / 종속 Enum 불러오기

14. IS Statement () (рус)

  • Understanding / 이해하기
    • Understanding Instance / 인스턴스 이해하기
    • Understanding Superclass / 부모클래스 이해하기
    • Understanding Subclass / 자식클래스 이해하기
  • Using IS Statement / IS조건연산자 사용하기

15. TRY-CATCH Statement () (рус)

  • Understanding TRY-CATCH Exception Handling / TRY-CATCH 예외처리 이해하기

Misc

16. Interface Casting () (рус)

module x.x does not "opens x.x" problem

  • List of Custom Events

Examples

Trigger

Trigger Example () (рус)

More Examples: Bukkit, Sponge

Case Specific

Clone this wiki locally
0