Click Events

Click Events
Click Event Type

Executed when player clicks the item. Multiple events can run in sequence:

codeclick-events:
  message:
    message: "&aHello %player%!"
  command:
    command: say %player% executed this!
  money-give:
    amount: '%input%'
  money-remove:
    amount: 100
  money-set:
    amount: '%vault_eco_balance_fixed%'
  player-picker-command:
    command: ban %player% "You are banned"
  chat-fetcher:
    message: "Type a number:"
    conditionFailMessage: "Invalid input!"
    conditions:
      is-integer:
        value: '%input%'
    click-events:
      # events after chat input given
      message:
        message: "You typed %input%!"
  offline-player-picker-command:
    command: unban %player%
  save-player-info:
    save-format: deposited:%input%+%infinitegui_player_info_deposited%
  close-inventory: {}
  title:
    title: "&6Welcome"
    subtitle: "&eEnjoy"
    fadeIn: 10
    stay: 60
    fadeOut: 10

Explaining Some Events:

  • message: Sends a chat message or title (if using !@! format) to the player.

  • command: Runs a command. %player% replaced with clicking player’s name. By default runs as console.

  • money-give/money-remove/money-set: Adjust player balance. Requires Vault.

  • player-picker-command: Open a player selection GUI, once a player chosen, executes command with %player% as chosen player and %executor% as the clicking player.

  • chat-fetcher: Prompt the player to type something in chat. Input is stored in %input%. Use conditions to validate input (is integer, has money, etc.). Subsequent events run if input is valid.

  • offline-player-picker-command: Similar to player-picker but allows selecting offline players.

  • save-player-info: Store persistent data keyed by infinitegui_player_info_ placeholders.

  • close-inventory: Close the GUI.

Wait for Conditions to Pass: If conditions fail, the event chain stops. If a conditionFailMessage is set at the item level, it’s shown to the player.


Events trigger on click. If multiple defined, they run in sequence:

  • message:

    codeclick-events:
      message:
        message: "Hello %player%!"

    Sends a chat message to player. Supports !@! format to send titles: "Title !@! subtitle !@! fadeIn !@! stay !@! fadeOut"

  • command:

    codeclick-events:
      command:
        command: give %player% diamond 1

    Runs command as console. %player% replaced with clicking player.

  • title:

    codeclick-events:
      title:
        command: 'title /?/ subtitle /?/ fadeIn /?/ stay /?/ fadeOut'

    Alternative method if using a different formatting. Or just message with !@! works.

  • money-give, money-remove, money-set:

    codemoney-give:
      amount: '100'
    money-remove:
      amount: '%input%'
    money-set:
      amount: '5000'

    Adjust player’s Vault balance.

  • player-picker-command:

    codeplayer-picker-command:
      command: ban %player% Banned by %executor%

    Opens a GUI to pick a player. Once chosen, runs command with %player% replaced by chosen player’s name and %executor% by original player.

  • chat-fetcher:

    codechat-fetcher:
      message: "Type amount:"
      conditionFailMessage: "Not a number!"
      conditions:
        is-integer:
          value: '%input%'
      click-events:
        message:
          message: "You typed %input%!"

    Prompts player in chat. If conditions pass, run subsequent events.

  • offline-player-picker-command: Similar to player-picker-command but also lists offline players.

  • save-player-info:

    codesave-player-info:
      save-format: deposited:%input%+%infinitegui_player_info_deposited%

    Edits persistent player data stored by InfiniteGUI. Useful for tracking custom variables.

  • close-inventory:

    codeclose-inventory: {}

    Closes the current GUI.

Note: %input% placeholder is available after a chat-fetcher event. %player% always refers to the clicking player. %executor% is used in events like player-picker-command to differentiate between chosen player and the one who triggered the command.

Last updated