⚡
xShyo_ Plugins Wiki
  • 👋 Welcome
  • PREMIUM PLUGINS
    • 🏠 PsMenu
      • Home
      • Installation
      • Commands & Permissions
      • Plugin´s Files
      • Flags
      • FAQ
    • 🛒 ShopMaster
      • Home
      • Installation
      • Commands & Permissions
      • item Creation
      • Economy Symbols Configuration
      • Menu Customization
      • Plugin´s Files
      • Development Portal
        • API Getting Started
        • Events
    • 🛠️ TheItemSkin
      • Home
      • Installation
      • Commands & Permissions
      • Plugin´s Files
      • Templates Skin
      • Development Portal
        • API Getting Started
        • Events
    • 🔴 NameGradient
      • Home
      • Installation
      • Commands & Permissions
      • PlaceholderAPI Support
      • Plugin´s Files
      • Format Gradient
      • Development Portal
        • API Getting Started
        • Events
  • FREE PLUGINS
    • 🎁 TheRewards
      • Home
      • Installation
      • Commands & Permissions
      • PlaceholderAPI Support
      • Layouts
      • Reward
      • Plugin´s Files
      • Addons
        • VoucherAddon
      • Development Portal
        • API Getting Started
        • Events
        • Addons
    • ✨ TheGlow
      • Home
      • Installation
      • Commands & Permissions
      • PlaceholderAPI Support
      • Plugin´s Files
    • 🏷️ TheTags
      • Home
      • Installation
      • Commands & Permissions
      • PlaceholderAPI Support
      • Plugin´s Files
      • Tags
    • ♂️ PlayerGender
      • Home
      • Installation
      • Commands & Permissions
      • PlaceholderAPI Support
      • Gender
      • Plugin´s Files
  • Setups
    • 🏃 Parkour Setup
      • Home
      • Installation
      • Frequently Asked Questions
    • ⛏️ Survival Setup
  • GENERAL
    • ❔ FAQ
    • ⚙️ Items | Custom Items
    • 📙 Support
Powered by GitBook
On this page
  • Introduction
  • Setup
  • Getting an API instance
  • API
  1. FREE PLUGINS
  2. 🎁 TheRewards
  3. Development Portal

API Getting Started

Introduction

TheRewards contains an API for obtaining or modifying player rewards.

Setup

Replace VERSION with the plugin version

<dependencies>
        <dependency>
            <groupId>xshyo.us</groupId>
            <artifactId>TheRewards</artifactId>
            <version>1.4.5-STABLE</version>
            <scope>provided</scope>
        </dependency>
</dependencies>

In your plugin.yml file you must add as a dependency

depend: [TheRewards]

Getting an API instance

import xshyo.com.therewards.TheRewardsAPI;
import xshyo.com.therewards.TheRewards;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class Example extends JavaPlugin {

    private TheRewardsAPI api;    
        
    @Override
    public void onEnable() {
        if (Bukkit.getPluginManager().isPluginEnabled("TheRewards")) {
            this.api = TheRewards.getInstance().getAPI();
        }

        if (this.api != null) {
    
        }
        
    }
}

API

The Settings option is not yet functional.

/**
 * Retrieves a reward by its name.
 *
 * @param name Name of the reward to search for.
 * @return The reward corresponding to the provided name, or null if not found.
 */
 
public Rewards getRewardByName(String name)

/**
 * Checks if a reward exists by its name.
 *
 * @param name Name of the reward to check.
 * @return true if the reward exists, false otherwise.
 */
public boolean isReward(String name)


public boolean availableStreak(UUID uuid)

/**
 * Sets reward options for a player.
 *
 * @param playerId Unique identifier of the player.
 * @param settingsData Reward configuration data for the player.
 */
public void setRewardOptions(UUID playerId, SettingsData settingsData)


/**
 * Retrieves reward options for a player.
 *
 * @param playerId Unique identifier of the player.
 * @return Reward configuration data for the player identified by their UUID.
 */
public SettingsData getRewardOptions(UUID playerId)

PreviousDevelopment PortalNextEvents

Last updated 7 months ago