XPBoost API

Jul 16, 2017 at 7:31 PM
XPBoost API
  • XPBoost API

    Example:
    Code (Text):

    //sets a new boost for a player
    public void setBoost(UUID id, double boost, int duration){
            XPBoost xpb = xpbAPI.setPlayerBoost(id, boost, duration);
    }


    public void customFunction(Player player){
        UUID id = player.getUniqueId();
        if(xpbAPI.hasBoost(id)){
            XPBoost xpb = xpbAPI.getBoost(id);
         
            System.out.println("Player boost: " + xpb.getBoost());
            System.out.println("Player boost duration: " + xpb.getBoostTime());
            System.out.println("Time remaining: (in seconds) " + xpb.getTimeRemaining());
            System.out.println("Boost end time (in miliseconds): " + xpb.getEndTime());
            System.out.println("List of conditions: " + xpb.getConditions());
            //xpb.putCondition(Condition.MCMMO, false); // will disable an effect of this boost for mcmmo
            ///xpb.clear(); //Clears/Removes Boost
         
        }

    }
     

    Other:
    Code (Text):
    xpbAPI.hasBoost(UUID id) /Returns Boolean
    xpbAPI.setPlayerBoost(UUId id, double boost, int time) /Set XP Boost for a player
    xpbAPI.getGlobalBoost() //returns GlobalBoost object

    These are depricated:
    xpbAPI.getPlayerBoost(UUID id) /Returns players current XP boost
    xpbAPI.clearBoost(UUID id) /Clears Boost from a player
    xpbAPI.getTimeRemaining(UUID id) /Returns time remaining in seconds (if boost is not active then 0)
     
  • Loading...
  • Loading...