Olzie Development
HomeDiscord
  • Introduction
  • Minecraft Plugins
    • Player Auctions
      • Commands & Permissions
      • Configuration
        • Item Configuration
        • Menu Configuration
        • Lang Configuration
      • FAQ
        • Database FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
        • Creating expansions
          • Auction Currency
          • Auction Product
          • Auction Converter
        • Creating Commands
        • Using Events
      • Rest API
        • Endpoints
          • GET
            • /api/playerauctions/getPlayerAuctionByID/{id}
            • /api/playerauctions/getRecentAuctionsByUUID/{page}
            • /api/playerauctions/getPlayerAuctions/{page}
            • /api/playerauctions/getAuctionCategoryByName/{categoryname}
            • /api/playerauctions/getAuctionCategories/{page}
            • /api/playerauctions/getAuctionPlayerByUUID/{uuid}
          • DELETE
            • /api/playerauctions/deleteRecentAuctionByID/{id}
        • Events
          • PlayerAuctionSellEvent
          • PlayerAuctionBuyEvent
          • PlayerAuctionBidEvent
          • PlayerAuctionBidWonEvent
          • PlayerAuctionRemoveEvent
          • AuctionExpireUpdateEvent
          • AuctionPlayerUpdateEvent
          • PlayerAuctionUpdateEvent
        • Errors
    • Player Economy
      • Commands & Permissions
      • Configuration
        • Item Configuration
        • Lang Configuration
      • FAQ
        • Database FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
        • Creating Commands
        • Using Events
      • Rest API
        • Endpoints
          • GET
          • DELETE
        • Events
        • Errors
    • Player Warps
      • Commands & Permissions
      • Configuration
        • Item Configuration
        • Menu Configuration
        • Lang Configuration
      • FAQ
        • Database FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
        • Creating expansions
          • Warp Addon
          • Warp Map Addon
          • Warp Converter
          • Warp Currency
        • Creating Commands
        • Using Events
      • Rest API
        • Endpoints
          • GET
            • /api/playerwarps/getPlayerWarpByName/{warpname}
            • /api/playerwarps/getSponsorWarp/{id}
            • /api/playerwarps/getPlayerWarpByID/{id}
            • /api/playerwarps/getPlayerWarps/{page}
            • /api/playerwarps/getWarpCategoryByName/{categoryname}
            • /api/playerwarps/getWarpCategories/{page}
            • /api/playerwarps/getWarpPlayerByUUID/{uuid}
          • DELETE
            • /api/playerwarps/deletePlayerWarpByName/{warpname}
            • /api/playerwarps/deletePlayerWarpByID/{id}
        • Events
          • PlayerWarpTeleportEvent
          • PlayerWarpSponsorEvent
          • PlayerWarpRentEvent
          • PlayerWarpRemoveEvent
          • PlayerWarpCreateEvent
          • WarpPlayerUpdateEvent
          • PlayerWarpUpdateEvent
        • Errors
    • Player Businesses
      • Commands & Permissions
      • Configuration
        • Item Configuration
        • Menu Configuration
        • Lang Configuration
      • FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
      • Rest API
        • Endpoints
          • GET
          • DELETE
        • Events
        • Errors
    • Player Trade
      • Commands & Permissions
      • Configuration
        • Item Configuration
        • Menu Configuration
        • Lang Configuration
      • FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
      • Rest API
        • Endpoints
          • GET
          • DELETE
        • Events
        • Errors
    • Player Treasury
      • Commands & Permissions
      • Configuration
        • Lang Configuration
      • FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
      • Rest API
        • Endpoints
          • GET
          • DELETE
        • Events
        • Errors
    • Player Elections
      • Commands & Permissions
      • Configuration
        • Lang Configuration
      • FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
      • Rest API
        • Endpoints
          • GET
          • DELETE
        • Events
        • Errors
    • Night Market
      • Commands & Permissions
      • Configuration
        • Item Configuration
        • Menu Configuration
        • Lang Configuration
      • FAQ
      • Supported Plugins
      • Plugin Features
      • Plugin API
        • Creating expansions
          • Market Currency
        • Creating Commands
        • Using Events
      • Rest API
        • Endpoints
          • GET
          • DELETE
        • Events
        • Errors
Powered by GitBook
On this page
  • Registering
  • Examples

Was this helpful?

  1. Minecraft Plugins
  2. Night Market
  3. Plugin API
  4. Creating expansions

Market Currency

Here you can view details on how to create a currency addon using the Expansions Plugin API.

PreviousCreating expansionsNextCreating Commands

Last updated 3 months ago

Was this helpful?

In Night Market you can create a currency addon that will allow you to create a new currency type. This will allow you to create a new currency type that will be able to be used anywhere in the plugin.

Registering

You can go to learn on how to register an expansion.

Examples

Here is an example of a currency addon class, this will let you be able to create a new currency type.

import com.olziedev.nightmarket.api.expansion.MCurrency;
import com.olziedev.nightmarket.api.player.MPlayer;

import java.util.function.Consumer;

public class CurrencyExample extends MCurrency {

    @Override
    public String getCurrencyName() {
        return "";
    }

    @Override
    public String getCurrencyPrefix(String internalCurrency) {
        return "";
    }

    @Override
    public void getBalance(MPlayer mPlayer, String internalCurrency, Consumer<Double> balanceConsumer) {

    }

    @Override
    public void deposit(MPlayer mPlayer, double amount, String internalCurrency, Consumer<Boolean> response) {

    }

    @Override
    public void withdraw(MPlayer mPlayer, double amount, String internalCurrency, Consumer<Boolean> response) {

    }

    @Override
    public boolean isEnabled() {
        return true;
    }

    @Override
    public String getName() {
        return "Example Currency";
    }

    @Override
    public void onLoad() {

    }
}

The above example is a currency addon that will allow you to create a new currency type. You can use this to create a new currency type that will be able to be used anywhere in the plugin.

here