Interface LevelInterface

All Known Implementing Classes:
LevelManager

public interface LevelInterface
Welcome to the LevelInterface, this class is a 'global' interface for LM itself AND other plugins to apply and modify the main functions of LevelledMobs.
Since:
2.5
  • Method Details

    • getLevellableState

      @NotNull @NotNull LevellableState getLevellableState(@NotNull @NotNull LivingEntityInterface lmInterface)
      Check if an existing mob is allowed to be levelled, according to the user's configuration.

      Thread-safety intended, but not tested.

      Parameters:
      lmInterface - target mob
      Returns:
      if the mob is allowed to be levelled (yes/no), with reason
    • generateLevel

      int generateLevel(@NotNull @NotNull LivingEntityWrapper lmEntity)
      This method generates a level for the mob. It utilises the levelling mode specified by the administrator through the settings.yml configuration.

      Thread-safety intended, but not tested.

      Parameters:
      lmEntity - the entity to generate a level for
      Returns:
      a level for the entity
    • generateLevel

      int generateLevel(@NotNull @NotNull LivingEntityWrapper lmEntity, int minLevel, int maxLevel)
      This method generates a level for the mob. It utilises the levelling mode specified by the administrator through the settings.yml configuration.

      Thread-safety intended, but not tested.

      Parameters:
      lmEntity - the entity to generate a level for
      minLevel - the minimum level to be used for the mob
      maxLevel - the maximum level to be used for the mob
      Returns:
      a level for the entity
    • applyLevelToMob

      void applyLevelToMob(@NotNull @NotNull LivingEntityWrapper lmEntity, int level, boolean isSummoned, boolean bypassLimits, @NotNull @NotNull HashSet<AdditionalLevelInformation> additionalLevelInformation)
      This method applies a level to the target mob.

      You can run this method on a mob regardless if they are already levelled or not.

      This method DOES NOT check if it is LEVELLABLE. It is assumed that plugins make sure this is the case (unless they intend otherwise).

      It is highly recommended to leave bypassLimits = false, unless the desired behaviour is to override the user-configured limits.

      Thread-safety intended, but not tested.

      Parameters:
      lmEntity - target mob
      level - the level the mob should have
      isSummoned - if the mob was spawned by LevelledMobs, not by the server
      bypassLimits - whether LM should disregard max level, etc.
      additionalLevelInformation - used to determine the source event
    • isLevelled

      boolean isLevelled(@NotNull @NotNull org.bukkit.entity.LivingEntity livingEntity)
      Check if a LivingEntity is a levelled mob or not. This is determined *after* MobPreLevelEvent.

      Thread-safety intended, but not tested.

      Parameters:
      livingEntity - living entity to check
      Returns:
      if the mob is levelled or not
    • getLevelOfMob

      int getLevelOfMob(@NotNull @NotNull org.bukkit.entity.LivingEntity livingEntity)
      Retrieve the level of a levelled mob.

      Thread-safety intended, but not tested.

      Parameters:
      livingEntity - the levelled mob to get the level of
      Returns:
      the mob's level
    • removeLevel

      void removeLevel(@NotNull @NotNull LivingEntityWrapper lmEntity)
      Un-level a mob.
      Parameters:
      lmEntity - levelled mob to un-level