> For the complete documentation index, see [llms.txt](https://cyr1en.gitbook.io/commandprompter/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cyr1en.gitbook.io/commandprompter/features/permission-attachment.md).

# Permission Attachment

Permission attachments temporarily grant a target player a named set of permissions while [Player Delegate](/commandprompter/features/player-delegate.md) dispatches a command.

```yaml
Permission-Attachment:
  ticks: 0
  Permissions:
    GAMEMODE:
      - bukkit.command.gamemode
      - essentials.gamemode.survival
      - essentials.gamemode.creative
```

Use the group name as the delegate's second argument:

```
/playerdelegate CyR1en GAMEMODE gamemode <Which gamemode?> %target_player%
```

CommandPrompter captures the configured permission list for the delegated main command, unqualified inline post-commands that inherit the delegate context (on completion or cancellation), and direct no-prompt dispatch. It attaches the permissions immediately before each applicable player dispatch and schedules removal after `ticks` when that value is positive (`Permission-Attachment.ticks` defaults to `0` in 3.2.0). `0` or a negative value removes the attachment immediately after dispatch. When command dispatch fails (returns `false`), throws an error, or removal-scheduling fails, the attachment is removed immediately.

Delayed inline post-commands that inherit a Player Delegate context verify that the named group still exists and has the same permissions before attaching it. If the group changed, the delayed command is skipped. An explicitly marked `@player` post-command does not inherit the attachment.

Preset post-commands never inherit the Player Delegate attachment, including presets configured with `execute_as: "player"`; their executor is authoritative but their dispatch context is independent.

{% hint style="danger" %}
The target can use attached permissions during the configured retention window, not only inside the delegated command call. Keep `ticks` as low as practical and never grant broad administrative permissions.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cyr1en.gitbook.io/commandprompter/features/permission-attachment.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
