CommandPrompter
GitHubSpigotDiscordKofi
  • Welcome
  • Getting Started
    • Installation
    • Usage
    • Arguments
      • Prompt Argument
      • PromptQueue Argument
      • Prompt and PromptQueue Arguments
    • Commands and Permissions
  • Configuration
    • CommandPrompter Configuration
      • Prompt-Prefix
      • Prompt-Timeout
      • Cancel-Keyword
      • Enable-Permission
      • Update-Checker
      • Argument-Regex
      • Debug-Mode
      • Enable-Unsafe and Modification-Delay
      • Show-Completed-Command
      • Fancy-Logger
      • Ignored-Commands
      • Permission-Attachment
      • Command-Tab-Complete
      • Allowed-Commands-In-Prompt
      • Ignore MiniMessage
    • Prompts Configuration
      • Chat Prompt
        • Clickable-Cancel
        • Cancel-Message
        • Cancel-Hover-Message
        • Response-Listener-Priority
      • Player UI
        • Skull-Name-Format
        • Skull Custom Model Data
        • Size
        • Cache-Size
        • Cache-Delay
        • PlayerUI Control Items
        • Sorted
        • Per-World
        • Empty-Message
        • Filter-Format
      • Anvil UI
        • Enable-Title
        • Custom-Title
        • Prompt-Message
        • Item
        • Enchanted
      • Sign UI
        • Input-Field-Location
        • Material
    • Internationalization (I18N)
  • Prompts
    • Chat Prompt
    • Anvil UI Prompt
    • Player UI Prompt
    • Sign UI Prompt
  • Features
    • Permission Attachment
    • Input Validation
    • Post Command
    • Console Delegate
    • Player Delegate
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Features

Permission Attachment

PreviousSign UI PromptNextInput Validation

Last updated 8 months ago

Was this helpful?

Starting v2.7.0, this feature can only now be used through the command.

If you want to execute commands as a console refer to .

Permission attachments allow players to have temporary access to command permissions. It's only available via player delegate to prevent a vulnerability when it's used as a prompt queue argument.

How to use Permission Attachment

The general idea is to give players a set of permissions that you define in a very short amount of time. This permission set and the duration can be found and configured in config.yml under the Permission Attachment section.

Step 1: Configuring permissions

# Permission Attachment Config
# 
# Permission attachments allow players
# to have temporary permissions.
# 
# ticks - Set how long (in ticks) should the
#         permission attachment persist.
# 
# permissions - permissions to temporarily
#               attach to the players.
Permission-Attachment:
  ticks: 1
  Permissions:
    GAMEMODE:
    - bukkit.command.gamemode
    - essentials.gamemode
    - essentials.gamemode.survival
    - essentials.gamemode.creative
    

With the given configuration above, we defined a permission attachment called GAMEMODE to attach gamemode-related permission.

It's important that you only give permissions that you are willing to give to your players. I advise against putting permissions that allow your server to be compromised!

Step 2: Using permission attachments in a prompt

playerdelegate CyR1en GAMEMODE gamemode <what gamemode do you want?>

Once the player fulfilled the prompt, CommandPrompter will attach the permissions defined under GAMEMODE and dispatch the command, and remove the attached permissions afterward.

To use the permission attachment, we need to use it via the like the following:

Player Delegate
Console Delegate
Player Delegate