Input Catcher

Ask the player to provide an input and get its value

Usage

(input)?(-)?catcher(s)?

Example of the Old version

- |-
  Catcher:
   <Type=CHAT>
   <Before=tell:请输入一个值>
   <Valid=tell: 你成功输入了一个数值 ${input}>
   <Invalid=tell: 你输入的不是一个数值>
   <Require=isNumber.${input}>
   <Cancel=tell: 已取消捕获器>

Type of the catcher (see below)

Example of the New Advanced version

- catcher:

    target:
      type: CHAT
      before: 'tell: Enter a player name'
      cancel: 'tell: Cancelled...'
      reactions:
        - condition: 'bukkitServer.getOfflinePlayer("${input_target}").hasPlayedBefore() || isOnline.${input_target}'
          execute: 'tell: Player selected. ${input_target}'
          deny:
            - 'tell: ${input_target} has never played on this server before!'
            - 'return'

    amount:
      type: CHAT
      before: 'tell: Provide an amount to pay'
      cancel: 'tell: Cancelled'
      reactions:
        - condition: 'isNumber.${input_amount}'
          execute:
            - 'tell: Amount selected. $${input_amount}'
            - 'command: pay ${input_target} ${input_amount}'
          deny:
          - 'tell: You didn''t provide a valid number!'
          - 'retype'
  • 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 updated