# Options

In the **pre-context** of your format, you can add options to an argument.

```java
        this.addFormat("int:foo", context -> {
            if (!(context.getSender() instanceof final Player player)) {
                return;
            }
            final int foo = context.get("foo");
            final CommandSender sender = context.getSender();
            sender.sendMessage(player.getName());
            sender.sendMessage(Component.text(foo));
        }, pre -> {
            pre.addOptions("foo", new IntegerArgument.Options());
        });
```

You can figure out which options it takes in by looking at the `IntegerArgument` class:<br>

```java
public class IntegerArgument implements Argument<IntegerArgumentType> {
    @Override
    public IntegerArgumentType create(Object[] options) {
        return switch (options.length) {
            case 0 -> IntegerArgumentType.integer();
            case 1 -> IntegerArgumentType.integer((int) options[0]);
            case 2 -> IntegerArgumentType.integer((int) options[0], (int) options[1]);
            default -> throw new IllegalStateException("Unexpected argument length: " + options.length);
        };
    }
}
```

Here, we can see that 5 and 3 will be our minimum and maximum values for our integer, respectively.


---

# Agent Instructions: 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:

```
GET https://slimecraft.gitbook.io/slimecraft-docs/deep-dive/arguments/options.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
