MyPet - Wiki
WebsiteDownloadSpigotDiscord
Legacy
Legacy
  • MyPet - Wiki
  • MyPet-Premium
  • Setup
    • Permissions
    • Commands
    • Configurations
      • config.yml
      • pet-config.yml
      • pet-shops.yml
      • Custom-Item-Data in Config
  • Systems
    • Leash Flags / Requirements
    • Skilltrees
      • SkilltreeCreator - Tool
    • Experience
      • Experience-Script
    • MyPet Storage
    • Hunger-System
    • World Groups
    • Auto Updater
  • Skill Overview
    • Backpack
    • Beacon
    • Behavior
    • Control
    • Damage
    • Fire
    • Heal
    • Knockback
    • Life
    • Lightning
    • Pickup
    • Poison
    • Slow
    • Ranged
    • Ride
    • Shield
    • Sprint
    • Stomp
    • Thorns
    • Wither
  • Tutorials
    • How to get a pet
    • File to MySQL
    • File to MongoDB
  • Plugin-Hooks
    • Hook Types
    • Citizens NPC
    • WG Region Flags
    • PlaceholderAPI
    • BossShopPro
  • Misc
    • Is MyPet EULA compliant?
    • FAQ
    • Changelog
Powered by GitBook
On this page
  • Script
  • Result Methods
  • Examples

Was this helpful?

  1. Systems
  2. Experience

Experience-Script

With the Experience-Script exp.js it's possible to customize when a pet will level up. As you can see at the file ending, the used language is JavaScript.

Script

Result Methods

To make a fully functional exp-script that can be used by MyPet you have to implement the following methods:

    • function getLevel(exp, mypet)-> return the actual level in this method.

    • function getRequiredExp(exp, mypet) -> return the exp that are needed to levelup in this method

    • function getCurrentExp(exp, mypet) -> return the actual exp of the current level in this method.

    • function getExpByLevel(level, mypet) -> return the exp needed for this level in this method.

Usable Methods

You can use the following methods to react individually on some pets:

  • MyPet.getType() -> pet-type of the MyPet.

  • MyPet.getOwnerName() -> name of the owner.

  • MyPet.getSkilltree() -> selected skilltree.

  • MyPet.getUUID() -> internal UUID of the MyPet.

  • MyPet.getWorldGroup() -> worldgroup the MyPet is in.

If you have any questions related to this topic please contact me on Discord or the Spigot forums.

Examples

PreviousExperienceNextMyPet Storage

Last updated 6 years ago

Was this helpful?

You can find a working example (it calculates it the same way as it was calculated for players in ).

here
Minecraft 1.3.1