Player Inputs

Use the chat bar to allow the player to add input for commands

Clicking on an Item

If you want the player to enter input in the chat bar for commands, you can use the following example below. As you can see, commands are also under the name 'player-input' instead of being under a list called 'commands'. These commands will run after the players enters an input, so using the input placeholder only works under that list. The commands list as seen in the example can still be used, and the commands will run immidiatly after the item is clicked.

'4':
  material: GRASS_BLOCK
  name: "Example Item"
  player-input:
  - "msg= Input --> %cp-player-input%" #will replace placeholders with message
  - "msg= another message" #this will always run after the message above
  commands:
  - "cpc" #so that the panel automatically closes

Maximum Characters

Using %cp-player-input-[number]% placeholder, you can choose a word from an input. For example, if a player enters "no thanks" and the placeholder has the number 1 at the end, the output for the placeholder will be "no".

The example below should go in the main panel and not in a specific item. For reference, it should be indented the same amount as the panel title or rows. As seen in the example below, you can also add a maximum input length settings and add custom messages that will send if the player enters a message too long.

max-input-length: 1
custom-messages:
  input: '&bCustom Max-Character Message!'

Last updated