> For the complete documentation index, see [llms.txt](https://docsv1.polyfrost.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docsv1.polyfrost.org/configuration/available-options/boolean-options/switch-option.md).

# Switch option

<figure><img src="https://455339379-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMEjGl1BGNegPgKE0wK4Y%2Fuploads%2FQj1Ujg2ck01TQ8cl68GT%2Fjava_uYaiwaWS6n.png?alt=media&amp;token=944f1cda-f9de-4ad5-8509-a613cded5f69" alt=""><figcaption><p>An example of what the switch looks like in-game, toggled both on and off.</p></figcaption></figure>

## Example

{% tabs %}
{% tab title="Java" %}

```java
@Switch(
    title = "My Switch",
    titleKey = "", // Sets the options tile translation key, default = ""
    description = "This is my switch", // Sets the options description, default = ""
    descriptionKey = "", // Sets the options description translation key, default = ""
    icon = "/my_switch.svg", // Sets the icon used for the option, default = ""
    category = "Switches", // Sets the options category, default = "General"
    categoryKey = "", // Sets the categories translation key, default = ""
    subcategory = "General", // Sets the options subcategory, default = "General"
    subcategoryKey = "" // Sets the options subcategory translation key, default = ""
)
public static boolean mySwitch = false;
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
var mySwitch: Boolean by switch(
    name = "My Switch",
    def = true, // Default value, required
    nameKey = null, // Sets the options tile translation key, default = null
    description = "This is my switch", // Sets the options description, default = null
    descriptionKey = null, // Sets the options description translation key, default = null
    icon = "/my_switch.svg", // Sets the icon used for the option, default = null
    category = "Switches", // Sets the options category, default = "General"
    categoryKey = null, // Sets the categories translation key, default = null
    subcategory = "General", // Sets the options subcategory, default = "General"
    subcategoryKey = null // Sets the options subcategory translation key, default = null
)
```

{% endtab %}
{% endtabs %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docsv1.polyfrost.org/configuration/available-options/boolean-options/switch-option.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
