Package me.gamercoder215.mobchip.bosses
Class Minion<T extends Mob>
java.lang.Object
me.gamercoder215.mobchip.bosses.Minion<T>
- Type Parameters:
T
- Type of Minion
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 Summary
ConstructorsConstructorDescriptionCreates a Minion with a health of 20.Creates a Minion with no equipment or attributes.Creates a Minion with no equipment.Minion
(@NotNull Class<T> clazz, double health, @Nullable Map<EquipmentSlot, ItemStack> equipment, @Nullable Map<AttributeInstance, Double> attributes) Creates a Minion. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(@NotNull AttributeInstance inst, double value) Adds an Attribute that this Minion will spawn with.Fetch this Entity's Attributes.Get the Entity Class of this Minion.Fetch the Minion's Equipment.double
Get the health that this Minion will spawn with.void
Removes an Attribute that this Minion will spawn with.void
Sets this Minion's Boots.void
setChestplate
(@Nullable ItemStack item) Sets this Minion's Chestplate.void
setHealth
(double health) Sets the health that this Minion will spawn with.void
Sets this Minion's Helmet.void
setItem
(@NotNull EquipmentSlot slot, @Nullable ItemStack item) Sets an item on this Minion's Equipment that it will spawn with.void
setLeggings
(@Nullable ItemStack item) Sets this Minion's Leggings.void
setMainhand
(@Nullable ItemStack item) Sets this Minion's Mainhand.void
setOffhand
(@Nullable ItemStack item) Sets this Minion's Offhand.Spawns this Minion at a Boss.Spawns this Minion at a Location.Spawns this Minion at another Boss.
-
Constructor Details
-
Minion
public Minion(@NotNull @NotNull Class<T> clazz, double health, @Nullable @Nullable Map<EquipmentSlot, ItemStack> equipment, @Nullable @Nullable Map<AttributeInstance, throws IllegalArgumentExceptionDouble> attributes) Creates a Minion.- Parameters:
clazz
- Entity Classhealth
- Health of Entityequipment
- Entity Equipment Map of EquipmentSlot to ItemStackattributes
- 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 IllegalArgumentExceptionCreates a Minion with no equipment.- Parameters:
clazz
- Entity Classhealth
- Health of Entityequipment
- Entity Equipment Map of EquipmentSlot to ItemStack- Throws:
IllegalArgumentException
- if health is less than 0 or if class is null
-
Minion
Creates a Minion with no equipment or attributes.- Parameters:
clazz
- Entity Classhealth
- Health of Entity- Throws:
IllegalArgumentException
- if health is less than 0 or if class is null
-
Minion
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
Get the Entity Class of this Minion.- Returns:
- Entity Class
-
spawn
Spawns this Minion at a Location.- Parameters:
loc
- Location to spawn- Returns:
- Spawned minion, or null if location is null
-
spawn
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
Spawns this Minion at another Boss.- Parameters:
en
- Entity to spawn on- Returns:
- Spawned minion, or null if entity is null
-
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
Adds an Attribute that this Minion will spawn with.- Parameters:
inst
- Attribute Instancevalue
- Value to set
-
removeAttribute
Removes an Attribute that this Minion will spawn with.- Parameters:
inst
- Attribute Instance
-
getEquipment
Fetch the Minion's Equipment.- Returns:
- Equipment that the Minion will spawn with
-
setItem
Sets an item on this Minion's Equipment that it will spawn with.- Parameters:
slot
- EquipmentSlot to spawnitem
- ItemStack to set, can be null
-
setHelmet
Sets this Minion's Helmet.- Parameters:
item
- Helmet Item to set, can be null
-
setChestplate
Sets this Minion's Chestplate.- Parameters:
item
- Chestplate Item to set, can be null
-
setLeggings
Sets this Minion's Leggings.- Parameters:
item
- Leggings Item to set, can be null
-
setBoots
Sets this Minion's Boots.- Parameters:
item
- Boots Item to set, can be null
-
setMainhand
Sets this Minion's Mainhand.- Parameters:
item
- Mainhand Item to change, can be null
-
setOffhand
Sets this Minion's Offhand.- Parameters:
item
- Offhand Item to change, can be null
-