> For the complete documentation index, see [llms.txt](https://battlepass.advancedplugins.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://battlepass.advancedplugins.net/developer-api/developer-api-general-api-methods.md).

# General API Methods

`BattlePlugin.getPlugin().getActionRegistry()` -> Returns the ActionRegistry which should be used to register internal & external quests.

`CompletableFuture<Optional<User>> getUser(UUID)` -> Returns a completable future of a user (the optional will be present/not present based on whether they were in the cache)

`CompletableFuture<User> getOrLoadUser(UUID)` -> Returns a completable future of a user from the cache, loaded or created (since v3.13).

`Optional<Reward<?>> getReward(String id)` -> Returns a Reward if a command or Reward if an item wrapped in an optional. It will not be present if the reward could not be found.

`long currentWeek()` -> Returns the current week of the battlepass.

`void setPassId(User user, String passId)` -> Sets the pass type of the specified user and gives rewards if set to premium.

`Tier getTier(int tier, String passId)` -> Gets the Tier object for the specified tier and pass type.

`int getRequiredPoints(int tier, String passId)` -> Gets the number of points required to reach the specified tier of a specified pass type.

`void givePoints(User user, int points)` -> Gives the set amount of points to the user.

`void reward(User user, int tier, boolean ignoreRestrictions)` -> Gives the rewards of a specified tier for every pass type to the user (it verifies they have that pass type).

`void reward(User user, String passId, int tier, boolean ignoreRestrictions)` -> Gives the rewards of a specified tier for a specific pass type to the user (it verifies they have that pass type).


---

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

```
GET https://battlepass.advancedplugins.net/developer-api/developer-api-general-api-methods.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.
