Mantic Development
DiscordStore
  • Join our Discord
  • Visit our Store
  • Welcome!
  • 📚ManticLib
  • 🤖Server Bot
    • 📬Setup Guide
    • 🆘Frequently Asked Questions
    • Config Files
      • config.yml
      • custom_responses.yml
      • messages.yml
      • reactionroles.yml
      • ticketsettings.json
      • technical_settings.yml
    • Modules
      • Application Module
      • Music Module
      • AI Module Module
      • MCModule
  • 🌾ManticHoes
    • Permissions
    • Placeholders
    • Config Files
      • config.yml
      • enchants.yml
      • prestige.yml
      • messages.yml
      • harvest-event.yml
      • commands.yml
      • harvester-hoes.yml
      • override-prices.yml
      • Menus
        • main.yml
        • prestige.yml
        • crop-prices.yml
        • token-shop.yml
        • leaderboard.yml
        • upgrades.yml
  • ⚔️ManticSwords
    • Config Files
      • config.yml
      • messages.yml
      • commands.yml
      • mob-swords.yml
      • leaderboard.yml
      • crystal-shop.yml
      • upgrades.yml
      • drops.yml
      • override_prices.yml
      • enchants.json
    • Placeholders
    • Permissions
  • 🎣ManticRods
    • Config Files
      • config.yml
      • messages.yml
      • commands.yml
      • rods.yml
      • leaderboard.yml
      • shard-shop.yml
      • upgrades.yml
      • drops.json
      • enchants.json
    • Permissions
    • Placeholders
  • 🌑ManticDarkzone
    • Config Files
      • config.yml
      • darkzone-mobs.yml
      • commands.yml
      • messages.yml
    • Frequently Asked Questions (FAQ)
  • 🛡️ManticSets
    • Placeholders
    • Permissions
    • Config Files
      • config.yml
      • messages.yml
      • _INFO.txt
      • Pre-Made Sets
        • Damage Set
        • Patching Set
        • XP Booster Set
        • McMMO Booster Set
        • Money Booster Set
        • ShopGUI+ Booster Set
        • Token Booster Set
        • Crystal Booster Set
        • Shard Booster Set
        • Coin Booster Set
        • Regeneration Set
        • Health Boost Set
    • Custom data for armour
  • 💴AfkZone
    • Setup Guide
    • Placeholders
    • Config Files
      • config.yml
      • gem-shop.yml
  • 💴ManticCurrency
    • Frequently Asked Questions (FAQ)
    • Placeholders
    • Config Files
      • config.yml
      • currency-shop.yml
      • leaderboard.yml
  • 🎁Giftcards
    • Config Files
      • config.yml
      • giftcard_items.yml
      • view_menu.yml
  • 🗡️InfiniteKoth
  • 🌊Water Pearls
  • 🤺PvPItems
    • 📖Configurations
    • 🎟️Permissions
  • ⛏️Mining Economy
    • 📑Configuration
    • ⌨️Commands and Usages
    • 🎟️Permissions
    • 📂Placeholders
    • ⚙️API
    • 🍩Free Addons
  • 👿DevilEnchants
    • Config Files
      • config.yml
      • lang.yml
      • enchant-settings.yml
      • custom-enchant.yml
  • 🪄VanillaEnchants
    • Config Files
      • config.yml
      • messages.yml
      • enchant-settings.yml
      • custom-enchant.yml
  • 💣Throwable Creepers
    • Config Files
      • config.yml
  • 🛄Reclaim
    • config.yml
  • 🤝EULA
Powered by GitBook
On this page
  1. Mining Economy

API

Mining Economy's API Download, information and example usage.

PreviousPlaceholdersNextFree Addons

Last updated 3 years ago

Download:

JavaDocs (archived):

Example Usages:

MiningEconomy miningEconomy = (MiningEconomy) JavaPlugin.getProvidingPlugin(MiningEconomy.class);

miningEconomy.setMine(location, mineType);

The above code will set a new mine at that location.

 @EventHandler
    public void onCoinTransfer(CoinEvent event) {

        final CommandSender giver = event.getGiver();

        if (!event.getType().equals(CoinEvent.Types.SET) || giver.hasPermission("example.permission")) return;

        event.setCancelled(true);
        giver.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cInsufficient Permission."));

    }

The above code will disallow anyone who does not have the permissions example.permission or if the type of transfer is not SET, the event will be cancelled.

public class NightVisionEnchant extends Enchant {

    public NightVisionEnchant() {
        super("Night-Vision", false);
        setMaxLevel(1);
        setBaseCost(1);
        setCostIncreasePerUpgrade(0);
    }

    @Override
    public void onPlayerMine(PlayerMineEvent event) {
        event.getMPlayer().getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 20, 1));
        event.getMPlayer().sendPrefixMessages("&aYou have been given night vision!");
    }

}

The above is an example of how to make your own enchant.

MiningEconomy miningEconomy = (MiningEconomy) JavaPlugin.getProvidingPlugin(MiningEconomy.class);
miningEconomy.registerEnchant(new NightVisionEnchant());

You will need to register the enchant like the above.

⛏️
⚙️
https://github.com/Fullpage12/MiningEconomyApiDocs/releases/
https://fullpage12.github.io/MiningEconomyApiDocs/