Nexa Developer Docs

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

ParameterTypeDescription
playerPlayerThe player to check
gamepassIdStringThe 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

ValueMeaning
truePlayer owns the gamepass
falsePlayer does not own the gamepass or an API error occurred

On this page