8000 Command Trigger · TriggerReactor/TriggerReactor Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
wysohn edited this page Aug 12, 2023 · 9 revisions

Command triggers are a way to make custom actions on your game server.

How to Create a Trigger

Start by using this command:

/trg cmd <command> <script>

For example:

/trg cmd hi #MESSAGE "Hi"

After that, if you type /hi, your custom command will activate.

Note: In the newer versions of Minecraft (likely starting from 1.17), all commands must be in lowercase. This is due to changes in Minecraft itself, not a specific issue with TriggerReactor.

Editing a Command Trigger

To edit a command trigger, simply type the same command you used to create it.

For example, to edit our "hi" trigger:

/trg cmd hi

You can also edit the trigger by finding it in the server files, making changes, and then reloading with /trg reload. To delete a trigger, use /trg delete cmd <command> or delete it directly in the server files.

Tab Completer (Version 3.1.0)

Starting from version 3.1.0, you can add a Tab-Completer feature to your CommandTrigger. In the somecommand.json file, you'll find a new section called tabs. We recommend using commands to add tab completion instead of manually editing this file.

To add tab completion, use the command:

/trg cmd <name> tab

For example:

/trg cmd myCommand tab <a,b,c>:a,b,c <playername>:$playerlist this,it,that

In the example above, the values left of : are hints, and those on the right are the candidates that players can choose from.

Original Command Control (Version 3.4.x)

If you create a Command Trigger with the same name as an existing plugin command, you're essentially "overriding" that command and adding your own behavior. If you want to just execute the original command with its original arguments, use:

original.forward()

If you want to modify the arguments before forwarding them to the original command, use:

original.run("arg1", "arg2")

You can pass as many arguments as you need. The script above is equivalent to the command /the_original_command arg1 arg2 in the game.

Internal Variables

Here's a list of internal variables you can use in your command triggers. You can also use third-party internal variables. Refer to the provided links for more information.

Variable Data Type Description
event Bukkit, Sponge Called when a player runs a command.
player Bukkit, Sponge Player triggering the event.
command String The actual command string.
args Array of strings The arguments entered by the player. args[0] for the first argument, args[1] for the second, and so on.
argslength Number The number of arguments, equivalent to args.length.
original Link Original command handle, e.g., original.forward() or original.run("arg1", "arg2", "arg3").

For more details on variables, visit the Variables page.

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