Using the api

Basic code to use the api:

CombatTagApi combatApi;
if(getServer().getPluginManager().getPlugin("CombatTag") != null){
	combatApi = new CombatTagApi((CombatTag)getServer().getPluginManager().getPlugin("CombatTag")); 
}

Available methods:

    /**
     * Checks to see if the player is in combat. The combat time can be
     * configured by the server owner If the player has died while in combat the
     * player is no longer considered in combat and as such will return false
     *
     * @param player
     * @return true if player is in combat
     */
    public boolean isInCombat(Player player)

    /**
     * Checks to see if the player is in combat. The combat time can be
     * configured by the server owner If the player has died while in combat the
     * player is no longer considered in combat and as such will return false
     *
     * @param name
     * @return true if player is online and in combat
     */
    public boolean isInCombat(String name)

    /**
     * Returns the time before the tag is over -1 if the tag has expired -2 if
     * the player is not in combat
     *
     * @param player
     * @return
     */
    public long getRemainingTagTime(Player player)

    /**
     * Returns the time before the tag is over -1 if the tag has expired -2 if
     * the player is not in combat
     *
     * @param name
     * @return
     */
    public long getRemainingTagTime(String name) 

    /**
     * Returns if the entity is an NPC
     *
     * @param entity
     * @return true if the player is an NPC
     */
    public boolean isNPC(Entity entity)

    /**
     * Tags player
     *
     * @param player
     * @return true if the action is successful, false if not
     */
    public boolean tagPlayer(Player player)

    /**
     * Untags player
     *
     * @param player
     */
    public void untagPlayer(Player player)

    /**
     * Returns the value of a configuration option with the specified name
     *
     * @param configKey
     * @return String value of option
     */
    public String getConfigOption(String configKey)

Comments

Posts Quoted:
Reply
Clear All Quotes