-
Notifications
You must be signed in to change notification settings - Fork 24
Developer API
Yap Zhen Yie edited this page Apr 10, 2019
·
6 revisions
Here is the official API that you can use. Please do not use the method that didn't list here, it may cause some unstable issue and may crash the plugin.
public static void doSomeAction(Player player) {
PlayerManager playerManager = GadgetsMenuAPI.getPlayerManager(player);
// Add some code here.
}
General player settings. (top)
playerManager.getMysteryDust();
playerManager.addMysteryDust(amount);
playerManager.setMysteryDust(amount);
playerManager.removeMysteryDust(amount);
playerManager.getMysteryBoxes();
/**
* Give player mystery boxes.
*
* @param MysteryBoxType
* The type of mystery boxes.
* @param expiryDate
* The expiry date of mystery boxes.
* Set to null won't expire.
* @param requirePerm
* Does player need to require permission to open it.
* @param details
* The details of gifted mystery box(sender) and crafted mystery
* box(craft date).
* @param amount
* The amount of the mystery boxes will give to player.
*/
playerManager.giveMysteryBoxes(MysteryBoxType mysteryBoxType, Long expiryDate, boolean requirePerm, String details, int amount);
/**
* MysteryBox Types: NORMAL_MYSTERY_BOX_1, NORMAL_MYSTERY_BOX_2, NORMAL_MYSTERY_BOX_3, NORMAL_MYSTERY_BOX_4,
* NORMAL_MYSTERY_BOX_5
* expiryDate: System.currentTimeMillis() + (24 * 3600 * 1000) // 1 day; Set to null, the mystery box won't expire.
* requirePerm: true or false
* details: always set to null
* amount: How many mystery boxes should be given.
Ex: playerManager.giveMysteryBoxes(MysteryBoxType.NORMAL_MYSTERY_BOX_3, (System.currentTimeMillis() + (24 * 3600 * 1000)), true, null, 1);
playerManager.getGiftPacks();
/**
* Give player's mystery gifts.
* Each gift contains 5 mystery boxes.
*/
playerManager.addGiftPacks(amount);
playerManager.giveMenuSelector();
Open Specific menu (top)
playerManager.goBackToMainMenu();
playerManager.openHatsMenu(page);
playerManager.openAnimatedHatsMenu(page);
playerManager.openParticlesMenu(page);
playerManager.openSuitsMenu();
/**
* @param type The SuitType.
*/
playerManager.openSuitEquipmentMenu(type);
playerManager.openCategoryGadgetsMenu();
/**
* @param type The GadgetCategoryType.
* @param page The page of the menu.
*/
playerManager.openGadgetTypesMenu(type, page);
playerManager.openCategoryPetsMenu();
/**
* @param type The PetCategoryType.
* @param page The page of the menu.
*/
playerManager.openPetTypesMenu(type, page);
playerManager.openMorphsMenu();
playerManager.openBannersMenu(page);
playerManager.openMorphsMenu(page);
playerManager.openCloaksMenu();
Equip & Unequip cosmetic (top)
/**
* Equip hat.
* @param type The HatType.
*/
playerManager.equipHat(type);
/**
* Unequip hat.
*/
playerManager.unequipHat();
/**
* Equip animated hat.
* @param type The AnimatedHatType.
*/
playerManager.equipAnimatedHat(type);
/**
* Unequip animatedhat.
*/
playerManager.unequipAnimatedHat();
/**
* Equip particle.
* @param type The ParticleType.
*/
playerManager.equipParticle(type);
/**
* Unequip particle.
*/
playerManager.unequipParticle();
/**
* Equip suit.
* @param type The SuitType.
*/
playerManager.equipSuit(type);
/**
* Unequip suit.
*/
playerManager.unequipSuit();
/**
* Equip gadget.
* @param type The GadgetType.
*/
playerManager.equipGadget(type);
/**
* Unequip gadget.
*/
playerManager.unequipGadget();
/**
* Equip pet.
* @param type The PetType.
*/
playerManager.equipPet(type);
/**
* Unequip pet.
*/
playerManager.unequipPet();
/**
* Equip morph.
* @param type The MorphType.
*/
playerManager.equipMorph(type);
/**
* Unequip morph.
*/
playerManager.unequipMorph();
/**
* Equip banner.
* @param type The BannerType.
*/
playerManager.equipBanner(type);
/**
* Unequip banner.
*/
playerManager.unequipBanner();
/**
* Equip emote.
* @param type The EmoteType.
*/
playerManager.equipEmote(type);
/**
* Unequip emote.
*/
playerManager.unequipEmote();
/**
* Equip cloak.
* @param type The CloakType.
*/
playerManager.equipCloak(type);
/**
* Unequip cloak.
*/
playerManager.unequipCloak();
Go to the top of the page.
Getting Started
Features
- Cosmetic Item Purchase
- Item Cost Discount
- Mystery Boxes
- Custom Mystery Boxes Loot
- Pets
- Morphs
- Data Migration (From SQLite to MySQL)
Custom Cosmetic Items
- Custom Hats
- Custom Animated Hats
- Custom Particles
- Custom Banners
- Custom Emotes
- Custom Miniatures (New)
Developers
Misc
Discord