Package kamkeel.npcdbc.api.effect
Interface IDBCEffectHandler
-
public interface IDBCEffectHandler
Interface for handling custom effects within the NPCDBC mod.Provides methods to check, apply, remove, and clear effects on players. This includes managing effect duration, levels, and verifying the existence of specific effects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
applyEffect(IPlayer player, int id)
Applies the effect with the specified ID to the given player using default duration and level.void
applyEffect(IPlayer player, int id, int duration)
Applies the effect with the specified ID to the given player with a custom duration.void
applyEffect(IPlayer player, int id, int duration, byte level)
Applies the effect with the specified ID to the given player with a custom duration and level.void
clearDBCEffects(IPlayer player)
Clears all effects managed by the NPCDBC effect handler from the specified player.int
getEffectDuration(IPlayer player, int id)
Retrieves the remaining duration of the effect with the specified ID for the given IPlayer.int
getEffectLevel(IPlayer player, int id)
Retrieves the level of the effect with the specified ID for the given IPlayer.boolean
hasEffect(IPlayer player, int id)
Checks if the specified player currently has the effect with the given ID.void
removeEffect(IPlayer player, int id)
Removes the effect with the specified ID from the given player.
-
-
-
Method Detail
-
hasEffect
boolean hasEffect(IPlayer player, int id)
Checks if the specified player currently has the effect with the given ID.- Parameters:
player
- the player to checkid
- the effect ID to look for- Returns:
true
if the player has the effect, otherwisefalse
-
applyEffect
void applyEffect(IPlayer player, int id)
Applies the effect with the specified ID to the given player using default duration and level.- Parameters:
player
- the player to apply the effect toid
- the effect ID to be applied
-
applyEffect
void applyEffect(IPlayer player, int id, int duration)
Applies the effect with the specified ID to the given player with a custom duration.- Parameters:
player
- the player to apply the effect toid
- the effect ID to be appliedduration
- the duration for which the effect should last, in ticks
-
applyEffect
void applyEffect(IPlayer player, int id, int duration, byte level)
Applies the effect with the specified ID to the given player with a custom duration and level.- Parameters:
player
- the player to apply the effect toid
- the effect ID to be appliedduration
- the duration for which the effect should last, in tickslevel
- the level or strength of the effect
-
clearDBCEffects
void clearDBCEffects(IPlayer player)
Clears all effects managed by the NPCDBC effect handler from the specified player.- Parameters:
player
- the player from which to clear all effects
-
removeEffect
void removeEffect(IPlayer player, int id)
Removes the effect with the specified ID from the given player.- Parameters:
player
- the player from which the effect should be removedid
- the effect ID to be removed
-
getEffectDuration
int getEffectDuration(IPlayer player, int id)
Retrieves the remaining duration of the effect with the specified ID for the given IPlayer. Uses the DBC effect index.- Parameters:
player
- the IPlayer to checkid
- the effect ID- Returns:
- the remaining duration in seconds, or -1 if the effect is not active
-
getEffectLevel
int getEffectLevel(IPlayer player, int id)
Retrieves the level of the effect with the specified ID for the given IPlayer. Uses the DBC effect index.- Parameters:
player
- the IPlayer to checkid
- the effect ID- Returns:
- the effect level, or -1 if the effect is not active
-
-