Check if a Player owns a Gamepass
Check if a Player owns a gamepass.
Checking Gamepass Ownership
Checks whether a player owns a specific gamepass.
Method
Boolean checkIfUserOwnsGamepass(Player player, String gamepassId)Parameters
| Parameter | Type | Description |
|---|---|---|
| player | Player | The player to check |
| gamepassId | String | The Gamepass ID from the Nexa Panel |
Example
boolean owns = nexaAPI.checkIfUserOwnsGamepass(player, "starter_rank");
if (owns) {
player.sendMessage("You own this gamepass.");
} else {
player.sendMessage("You do not own this gamepass.");
}Returns
| Value | Meaning |
|---|---|
| true | Player owns the gamepass |
| false | Player does not own the gamepass or an API error occurred |