Class Minion<T extends Mob>

java.lang.Object
me.gamercoder215.mobchip.bosses.Minion<T>
Type Parameters:
T - Type of Minion

public final class Minion<T extends Mob> extends Object
Represents a Boss Minion

Any methods that will call a class update (i.e. setHealth(double)) will not update the actual entity if spawned. Call updates directly from the entity received at spawn(Location).

  • Constructor Details

    • Minion

      public Minion(@NotNull @NotNull Class<T> clazz, double health, @Nullable @Nullable Map<EquipmentSlot, ItemStack> equipment, @Nullable @Nullable Map<AttributeInstance, Double> attributes) throws IllegalArgumentException
      Creates a Minion.
      Parameters:
      clazz - Entity Class
      health - Health of Entity
      equipment - Entity Equipment Map of EquipmentSlot to ItemStack
      attributes - Entity Attribute Map of Attribute Instance to Value (Max Health will be automatically applied)
      Throws:
      IllegalArgumentException - if health is less than 0 or if class is null
    • Minion

      public Minion(@NotNull @NotNull Class<T> clazz, double health, @Nullable @Nullable Map<EquipmentSlot, ItemStack> equipment) throws IllegalArgumentException
      Creates a Minion with no equipment.
      Parameters:
      clazz - Entity Class
      health - Health of Entity
      equipment - Entity Equipment Map of EquipmentSlot to ItemStack
      Throws:
      IllegalArgumentException - if health is less than 0 or if class is null
    • Minion

      public Minion(@NotNull @NotNull Class<T> clazz, double health) throws IllegalArgumentException
      Creates a Minion with no equipment or attributes.
      Parameters:
      clazz - Entity Class
      health - Health of Entity
      Throws:
      IllegalArgumentException - if health is less than 0 or if class is null
    • Minion

      public Minion(@NotNull @NotNull Class<T> clazz) throws IllegalArgumentException
      Creates a Minion with a health of 20.
      Parameters:
      clazz - Class of minion
      Throws:
      IllegalArgumentException - if health less than 0 or if class is null
  • Method Details

    • getEntityClass

      public Class<T> getEntityClass()
      Get the Entity Class of this Minion.
      Returns:
      Entity Class
    • spawn

      @Nullable public T spawn(@Nullable @Nullable Location loc)
      Spawns this Minion at a Location.
      Parameters:
      loc - Location to spawn
      Returns:
      Spawned minion, or null if location is null
    • spawn

      @Nullable public T spawn(@Nullable @Nullable Boss<?> b)
      Spawns this Minion at a Boss.
      Parameters:
      b - Boss to spawn on
      Returns:
      Spawned minion, or null if boss is null / not spawned yet
    • spawn

      @Nullable public T spawn(@Nullable @Nullable Entity en)
      Spawns this Minion at another Boss.
      Parameters:
      en - Entity to spawn on
      Returns:
      Spawned minion, or null if entity is null
    • getAttributes

      @NotNull public @NotNull Map<AttributeInstance, Double> getAttributes()
      Fetch this Entity's Attributes.
      Returns:
      Entity Attributes
    • getHealth

      public double getHealth()
      Get the health that this Minion will spawn with.
      Returns:
      Health
    • setHealth

      public void setHealth(double health)
      Sets the health that this Minion will spawn with.
      Parameters:
      health - Health to spawn with
    • addAttribute

      public void addAttribute(@NotNull @NotNull AttributeInstance inst, double value)
      Adds an Attribute that this Minion will spawn with.
      Parameters:
      inst - Attribute Instance
      value - Value to set
    • removeAttribute

      public void removeAttribute(@NotNull @NotNull AttributeInstance inst)
      Removes an Attribute that this Minion will spawn with.
      Parameters:
      inst - Attribute Instance
    • getEquipment

      @NotNull public @NotNull Map<EquipmentSlot, ItemStack> getEquipment()
      Fetch the Minion's Equipment.
      Returns:
      Equipment that the Minion will spawn with
    • setItem

      public void setItem(@NotNull @NotNull EquipmentSlot slot, @Nullable @Nullable ItemStack item)
      Sets an item on this Minion's Equipment that it will spawn with.
      Parameters:
      slot - EquipmentSlot to spawn
      item - ItemStack to set, can be null
    • setHelmet

      public void setHelmet(@Nullable @Nullable ItemStack item)
      Sets this Minion's Helmet.
      Parameters:
      item - Helmet Item to set, can be null
    • setChestplate

      public void setChestplate(@Nullable @Nullable ItemStack item)
      Sets this Minion's Chestplate.
      Parameters:
      item - Chestplate Item to set, can be null
    • setLeggings

      public void setLeggings(@Nullable @Nullable ItemStack item)
      Sets this Minion's Leggings.
      Parameters:
      item - Leggings Item to set, can be null
    • setBoots

      public void setBoots(@Nullable @Nullable ItemStack item)
      Sets this Minion's Boots.
      Parameters:
      item - Boots Item to set, can be null
    • setMainhand

      public void setMainhand(@Nullable @Nullable ItemStack item)
      Sets this Minion's Mainhand.
      Parameters:
      item - Mainhand Item to change, can be null
    • setOffhand

      public void setOffhand(@Nullable @Nullable ItemStack item)
      Sets this Minion's Offhand.
      Parameters:
      item - Offhand Item to change, can be null