Combat Tag

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 playerName
	 * @return true if player is in combat
	 */
	public boolean isInCombat(String 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 player
	 * @return true if player is in combat
	 */
        public boolean isInCombat(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 player
	 * @return
	 */
	public long getRemainingTagTime(String player)

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

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

	/**
	 * Tags player with name
	 * @param string
	 */
	public void tagPlayer(String playerName)

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

You must login to post a comment. Don't have an account? Register to get one!

  • 1 comment
  • 1 comment

Facts

Date created
Jan 04, 2012
Last updated
Mar 23, 2013