Input Catcher
Ask the player to provide an input and get its value

Usage

1
(input)?(-)?catcher(s)?
Copied!

Example of the Old version

1
- |-
2
Catcher:
3
<Type=CHAT>
4
<Before=tell:请输入一个值>
5
<Valid=tell: 你成功输入了一个数值 ${input}>
6
<Invalid=tell: 你输入的不是一个数值>
7
<Require=isNumber.${input}>
8
<Cancel=tell: 已取消捕获器>
Copied!
Type
Before
Valid
Invalid
Require
Type of the catcher (see below)
Actions executed before that the player inputs a message
Actions executed when the input is given and when the requirements are met (if defined)
Actions executed when the requirements are not met
Once the player inputs a message, if the conditions are met, the Valid actions will be executed, else, the Invalid ones will

Example of the New Advanced version

1
- catcher:
2
3
target:
4
type: CHAT
5
before: 'tell: Enter a player name'
6
cancel: 'tell: Cancelled...'
7
reactions:
8
- condition: 'bukkitServer.getOfflinePlayer("${input_target}").hasPlayedBefore() || isOnline.${input_target}'
9
execute: 'tell: Player selected. ${input_target}'
10
deny:
11
- 'tell: ${input_target} has never played on this server before!'
12
- 'return'
13
14
amount:
15
type: CHAT
16
before: 'tell: Provide an amount to pay'
17
cancel: 'tell: Cancelled'
18
reactions:
19
- condition: 'isNumber.${input_amount}'
20
execute:
21
- 'tell: Amount selected. ${input_amount}'
22
- 'command: pay ${input_target} ${input_amount}'
23
deny:
24
- 'tell: You didn''t provide a valid number!'
25
- 'retype'
Copied!
  • The returnaction will stop the following input catchers and actions
  • The retypeaction will re-execute the input catcher

Types of Input Catcher

  • CHAT
    • Gets the input of the player from the chat
  • SIGN
    • Makes a sign pop-up and gets the input of the player
  • ANVIL
    • Makes an anvil pop-up and gets the input of the player
Last modified 1yr ago