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)
- 1 comment
- 1 comment
- Reply
- #1
tremor77 Feb 14, 2013 at 04:22 UTC - 0 likesIs your code tags messed up, doesn't look like everything is here.
PwnFilter - PwnChickenLay - PwnPlantGrowth - PwnNoCombatRegion