Skip to content

Commit

Permalink
Update usage.md
Browse files Browse the repository at this point in the history
Signed-off-by: Ryder Belserion <[email protected]>
  • Loading branch information
ryderbelserion authored Apr 16, 2024
1 parent de8ef2f commit 21f6fe6
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion docs/plugins/crazycrates/api/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,27 @@ pagination_prev: null

sidebar_label: API Usage
---
https://github.com/Crazy-Crew/ExamplePlugin -> An example of how to use the CrazyCrates API.
## Add virtual keys to a player
```java
UserManager userManager = CratesProvider.get().getUserManager():

userManager.addKeys(5, uuid, "CrateName", KeyType.virtual_key);
```

## Add physical keys to a player
```java
UserManager userManager = CratesProvider.get().getUserManager():

userManager.addKeys(5, uuid, "CrateName", KeyType.physical_key);
```

## Update or add how many times a player has opened a crate.
```java
UserManager userManager = CratesProvider.get().getUserManager():

userManager.addOpenedCrate(uuid, "CrateName");
```

## An example of the api in use in a plugin.
> https://github.com/Crazy-Crew/ExamplePlugin/tree/main
> You can compile the plugin using ./gradlew assemble

0 comments on commit 21f6fe6

Please sign in to comment.