Klasse MobScaler

java.lang.Object
de.delinkedde.mobarenareborn.mob.MobScaler

public final class MobScaler extends Object
Spawns mobs and applies the configured scaling.

Health and attack damage are derived from the formulas.mob-health and formulas.mob-damage expressions, which receive the per-mob base value together with the ScalingContext variables. Scaling against party-level is what keeps the difficulty rising with player progression. Every spawned mob is tagged in its persistent data container with the owning arena name so it can be identified and cleaned up.

  • Felddetails

    • MARKER_KEY

      public static final String MARKER_KEY
      Persistent-data key marking an entity as an arena mob; the stored value is the arena name.
      Siehe auch:
    • XP_KEY

      public static final String XP_KEY
      Persistent-data key storing the base experience awarded for killing the mob.
      Siehe auch:
    • SUPPLY_KEY

      public static final String SUPPLY_KEY
      Persistent-data key storing the supply-item spec a supply-wave mob drops on death.
      Siehe auch:
    • BOSS_KEY

      public static final String BOSS_KEY
      Persistent-data key storing the boss definition id on a spawned boss.
      Siehe auch:
  • Konstruktordetails

    • MobScaler

      public MobScaler(@NotNull @NotNull MobArenaPlugin plugin, @NotNull @NotNull ConfigManager config)
      Parameter:
      plugin - the owning plugin, used to namespace the marker key
      config - the configuration manager providing the scaling formulas
  • Methodendetails

    • markerKey

      @NotNull public @NotNull NamespacedKey markerKey()
      Gibt zurück:
      the persistent-data key used to mark arena mobs
    • xpKey

      @NotNull public @NotNull NamespacedKey xpKey()
      Gibt zurück:
      the persistent-data key holding a mob's experience value
    • supplyKey

      @NotNull public @NotNull NamespacedKey supplyKey()
      Gibt zurück:
      the persistent-data key holding a supply mob's drop specification
    • bossKey

      @NotNull public @NotNull NamespacedKey bossKey()
      Gibt zurück:
      the persistent-data key holding a boss's definition id
    • spawn

      @Nullable public @Nullable LivingEntity spawn(@NotNull @NotNull MobType type, @NotNull @NotNull Location location, @NotNull @NotNull ScalingContext context, @NotNull @NotNull String arenaTag)
      Spawns and scales a mob.
      Parameter:
      type - the mob type to spawn
      location - the spawn location
      context - the scaling context for the current wave
      arenaTag - the arena name stored as the marker value
      Gibt zurück:
      the spawned, scaled entity, or null if the world is unavailable or the entity is not a living entity
    • spawnBoss

      @Nullable public @Nullable LivingEntity spawnBoss(@NotNull @NotNull EntityType entityType, @NotNull @NotNull Location location, @NotNull @NotNull ScalingContext context, @NotNull @NotNull String arenaTag, double baseHealth, double baseDamage, double healthMultiplier, double damageMultiplier, int xpValue, @NotNull @NotNull net.kyori.adventure.text.Component displayName)
      Spawns a boss: a named entity whose scaled health and damage are multiplied by the boss factors. The boss is tagged like any other arena mob so the wave engine tracks it and cleans it up.
      Parameter:
      entityType - the entity type to spawn
      location - the spawn location
      context - the scaling context for the current wave
      arenaTag - the arena name stored as the marker value
      baseHealth - the unscaled base health before the multiplier
      baseDamage - the unscaled base damage before the multiplier
      healthMultiplier - the factor applied to the scaled health
      damageMultiplier - the factor applied to the scaled damage
      xpValue - the base experience awarded for the kill
      displayName - the custom name shown above the boss
      Gibt zurück:
      the spawned boss entity, or null if the world is unavailable or the entity is not a living entity