Phantom Development | Products
  • Welcome to our Docs!
  • Phantom Series
    • Phantom Masks ($10)
    • Phantom NameMC ($5)
    • Phantom Lockboxes ($10)
    • Phantom Rebirths ($10)
    • Phantom Luckyblocks ($5)
    • Phantom Outposts (TBD)
    • Phantom Robots ($15)
    • Phantom Armor ($17.99)
      • Actions System
        • Action Implementation
      • Armor Buffs System
        • Buff Implementation
      • Attributes System
      • Armor Placeholders
      • Backpack System
      • Execution Filtering
      • FAQ
        • Items-Adder Integration
        • Creating Sets & more
        • Message Options & More
        • Full-Set Bonuses
      • Files
        • armor
          • example_set.yml
          • enchanted_set.yml
        • menus
          • attribute-menu.yml
          • sets-menu.yml
          • settings-menu.yml
          • shard-select-menu.yml
          • attribute-list-menu.yml
          • armor-preview-menu.yml
        • attributes.yml
        • commands.yml
        • items.yml
        • messages.yml
        • settings.yml
        • shards.yml
        • backpack.yml
        • events.yml
      • Changelogs
        • v1.2.0
          • messages.yml
          • sets.yml
          • backpack.yml
        • v1.2.3
          • sets.yml
        • 1.2.4
          • sets.yml
    • Phantom Autominer (TBD)
    • Phantom Voting (Open-Source)
      • Message Hyperlinking
      • Vote Placeholders
      • Configuration Options
      • Files
        • menus
          • leaderboard.yml
          • milestones.yml
          • streaks.yml
        • modules
          • vote_reminder.yml
          • bossbar.yml
        • config.yml
        • messages.yml
        • modules.yml
        • voteparty.yml
        • storage.yml
    • Phantom Prison Core ($$$)
  • EdPrison Addon Series
    • Phantom RPGs ($10)
    • Phantom Momentum ($7)
      • Momentum Buffs System
      • Momentum Placeholders
    • Enchant Packages
      • Phantom Enchant Package #1
      • Phantom Enchant Package #2
      • Phantom Enchant Package #3
    • Phantom Bombs ($15)
      • files
        • bombs
          • acidic-bomb.yml
          • cluster-bomb.yml
          • default-bomb.yml
          • glacial-bomb.yml
          • hive-bomb.yml
          • nuclear-bomb.yml
          • swarm-bomb.yml
          • transmuter-bomb.yml
        • messages.yml
        • settings.yml
  • Fade Series
    • Fade Cubes ($15)
    • Fade Gifts ($7.50)
      • files
        • menus
          • gift_menu.yml
          • gift_top_menu.yml
        • settings.yml
        • messages.yml
    • Fade Abilities (TBD)
    • Fade Milestones (TBD)
    • Fade Bosses (TBD)
Powered by GitBook
On this page
  1. Phantom Series
  2. Phantom Armor ($17.99)
  3. Armor Buffs System

Buff Implementation

Below is an example on how to add your own custom buffs, support your own plugins etc.

After you have implemented this code and registered your own custom plugin or provider, you can now use the provider-prefix in the armor boost types section of the armor set.

public class MyCustomPotionProvider extends ArmorBoostProvider<[EVENT_NAME]> {
    /**
     * Constructor for the MyCustomPotionProvider
     *
     * @param instance the Phantom Armor Instance, which can be gotten via PhantomArmor.getInstance()
     */
    public MyCustomPotionProvider(PhantomArmor instance) {
        super(instance, "PROVIDER_PREFIX"); // an example of a prefix is phantomarmor-xp
        PhantomArmor.getProviderManager().registerProvider([EVENT_NAME].class, this);
    }
    /**
     * Event handler for the [EVENT_NAME]
     *
     * @param event the [EVENT_NAME]
     */
    @EventHandler(priority = EventPriority.LOWEST)
    @Override
    public void onBoost([EVENT_NAME] event) {
        // This is an example of how to get the total boost corresponding to the buff type.
        // getTotalBoost() is inherited from the base class, you don't need to write your own logic.
        double totalBoost = getTotalBoost(player, providerPrefix);
        if (totalBoost > 0) {
            event.setExp(((int)(event.getExp() * totalBoost)));
        }
    }
}

PreviousArmor Buffs SystemNextAttributes System

Last updated 4 months ago