MonGen's Cave Docs
  • Welcome here!
  • Premium Products
    • mc-DiscordLink
      • Plugin FAQ
      • Commands
      • Feature Help
        • Setup Discord Bot
        • Link System
        • Embed Builder
      • Supported Plugins
        • Rank Plugins
        • PlaceholderAPI
        • DiscordLinkProxy
        • Floodgate
      • Migrate Data
    • mc-KillStats
      • Plugin FAQ
      • Supported Plugins
      • Commands
      • Hooks
        • PlaceholderAPI
      • Developer API
    • mc-Levels
      • Plugin FAQ
      • Commands
      • Supported Plugins
        • PlaceholderAPI
        • AxBooster
      • Developer API
    • mc-Credits
      • Plugin FAQ
      • Commands
      • Feature Help
        • GUI Options
      • Supported Plugins
        • PlaceholderAPI
      • Developer API
    • mc-Homes
      • Plugin FAQ
      • Commands
      • Feature Help
        • Safe Teleport
        • Home Name
  • Free Products
    • mc-FunGun
      • Plugin FAQ
      • Supported Plugins
      • Commands
    • mc-PlayerVisibility
      • Plugin FAQ
      • Supported Plugins
      • Commands
    • mc-IPGuard
      • Plugin FAQ
      • Supported Plugins
      • Commands
    • mc-Scheduler
      • Plugin FAQ
      • Commands
      • Supported Plugins
        • PlaceholderAPI
  • REACH US HERE
  • Discord Support
  • BuiltByBit
  • SpigotMC
  • Polymart
Powered by GitBook
On this page
  • 1) Add the Dependency
  • 2) Add mc-Credits to plugin.yml
  • 3) Example how to use the CreditsAPI
  1. Premium Products
  2. mc-Credits

Developer API

PreviousPlaceholderAPINextmc-Homes

Last updated 2 months ago

1) Add the Dependency

Don't forget to change always the version!

<repository>
  <id>MonGens-Cave</id>
  <url>https://repo.mongenscave.com/releases<repository></url>
</repository>

<dependency>
  <groupId>com.mongenscave</groupId>
  <artifactId>mc-CreditsAPI</artifactId>
  <version>[VERSION]</version>
</dependency>
maven { url "https://repo.mongenscave.com/releases" }

implementation "com.mongenscave:mc-CreditsAPI:[VERSION]"

2) Add mc-Credits to plugin.yml

depend:
  - mc-Credits
softdepend:
  - mc-Credits

3) Example how to use the CreditsAPI

As an example, add Credit to a player.

public class CreditExemple {
   public void giveCredit(Player player, int amount){
       CreditUtil.addCredits(player, amount);
   }
}
Event
Description

CreditChangeEvent

Triggered when a player's credit balance is modified.

PlayerBoughtEvent

Triggered when a player buys anything in the credit shop.