Package me.gamercoder215.mobchip.bosses
Class Boss<T extends Mob>
java.lang.Object
me.gamercoder215.mobchip.bosses.Boss<T>
- Type Parameters:
T
- The entity type of this Boss.
Represents a Boss Entity.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Default health for Boss (20)protected final long
The Numerical ID of this Boss.protected T
This Entity, can be null. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Boss
(@NotNull EntityType t, @NotNull Plugin plugin) Creates a New Boss. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addAttribute
(@NotNull AttributeInstance inst, double value) Adds an Attribute that this Boss will spawn with.final @NotNull Map
<AttributeInstance, Double> Fetch this Entity's Attributes.final long
Get the ID of this Boss Class.Gets the Death Sound, orSound.ENTITY_WITHER_DEATH
if not setgetDrops()
Get the Drops of this Boss Entity.Fetch the Entity Class of this Boss.final EntityType
Fetch the Entity Type of this Boss.final @NotNull Map
<EquipmentSlot, ItemStack> Fetch the Boss's Equipment.final @NotNull BossHandler
Fetches the BossHandler for this Boss.final double
Get the health that this Boss will spawn with.final T
getMob()
Fetch the Entity.final float
Fetches the current sound pitch.final float
Fetches the current sound volume.Gets the Spawn Sound, orSound.ENTITY_WITHER_SPAWN
if not setvoid
Called when this Entity receives damagevoid
Called when this Entity damages another Entityvoid
onDeath
(EntityDeathEvent death) Called when the Entity Diesvoid
Called when the Entity Spawnsfinal void
Removes an Attribute that this Boss will spawn with.final void
Sets this Boss's Boots.final void
setChestplate
(@Nullable ItemStack item) Sets this Boss's Chestplate.final void
Sets the Death Sound.final void
setHealth
(double health) Sets the health that this Boss will spawn with.final void
Sets this Boss's Helmet.final void
setItem
(@NotNull EquipmentSlot slot, @Nullable ItemStack item) Sets an item on this Boss's Equipment that it will spawn with.final void
setLeggings
(@Nullable ItemStack item) Sets this Boss's Leggings.final void
setMainhand
(@Nullable ItemStack item) Sets this Boss's Mainhand.final void
setOffhand
(@Nullable ItemStack item) Sets this Boss's Offhand.final void
setSoundPitch
(float pitch) Sets the Sound's Pitch.final void
setSoundVolume
(float volume) Sets the Sound's Volume.final void
Sets the Death Sound.final void
Spawns this Boss.valueOf
(long id) Fetch a Boss by its id.Fetch a Boss by an Entity UUID.valueOf
(T entity) Fetch a Boss by its Entity Instance.
-
Field Details
-
DEFAULT_HEALTH
public static final int DEFAULT_HEALTHDefault health for Boss (20)- See Also:
-
mob
This Entity, can be null. -
id
protected final long idThe Numerical ID of this Boss.
-
-
Constructor Details
-
Boss
protected Boss(@NotNull @NotNull EntityType t, @NotNull @NotNull Plugin plugin) throws IllegalArgumentException Creates a New Boss.- Parameters:
t
- EntityType of Bossplugin
- Plugin that owns this boss- Throws:
IllegalArgumentException
- if not a valid Mob EntityType or if Plugin is null
-
-
Method Details
-
valueOf
Fetch a Boss by its id.- Parameters:
id
- ID of boss to fetch- Returns:
- found boss, or null if not found
-
valueOf
Fetch a Boss by an Entity UUID. Will not work for Bosses that are not spawned.- Parameters:
uid
- UUID of Entity Boss- Returns:
- Found boss class, or null if not found
-
valueOf
Fetch a Boss by its Entity Instance.- Type Parameters:
T
- Type of Entity- Parameters:
entity
- Entity Instance- Returns:
- Found boss class, or null if not found
-
getHandler
Fetches the BossHandler for this Boss.- Returns:
- BossHandler found
-
getEntityClass
Fetch the Entity Class of this Boss.- Returns:
- Entity Class Found
-
getEntityType
Fetch the Entity Type of this Boss.- Returns:
- Entity Type Found
-
getBossId
public final long getBossId()Get the ID of this Boss Class.- Returns:
- ID of Boss
-
spawn
Spawns this Boss. The SpawnReason will always beCreatureSpawnEvent.SpawnReason.CUSTOM
.- Parameters:
l
- Location to spawn
-
getDeathSound
Gets the Death Sound, orSound.ENTITY_WITHER_DEATH
if not set- Returns:
- Found Death Sound
-
setDeathSound
Sets the Death Sound.- Parameters:
s
- New Death Sound, or Null to reset
-
getSpawnSound
Gets the Spawn Sound, orSound.ENTITY_WITHER_SPAWN
if not set- Returns:
- Found Spawn Sound
-
setSpawnSound
Sets the Death Sound.- Parameters:
s
- New Death Sound, or Null to reset
-
getSoundPitch
public final float getSoundPitch()Fetches the current sound pitch.- Returns:
- Current Sound Pitch
-
getSoundVolume
public final float getSoundVolume()Fetches the current sound volume.- Returns:
- Current Sound Volume
-
setSoundPitch
Sets the Sound's Pitch.- Parameters:
pitch
- Pitch to set- Throws:
IllegalArgumentException
- if pitch is less than -2F or greater than 2F
-
setSoundVolume
Sets the Sound's Volume.- Parameters:
volume
- Volume to set- Throws:
IllegalArgumentException
- if volume is less than 0F
-
getMob
Fetch the Entity. Can be null if not spawned yet.- Returns:
- Entity found
-
getAttributes
Fetch this Entity's Attributes.- Returns:
- Entity Attributes
-
getHealth
public final double getHealth()Get the health that this Boss will spawn with.- Returns:
- Health spawned with
-
setHealth
public final void setHealth(double health) Sets the health that this Boss will spawn with.- Parameters:
health
- Health to spawn with
-
addAttribute
Adds an Attribute that this Boss will spawn with.- Parameters:
inst
- Attribute Instancevalue
- Value to set
-
removeAttribute
Removes an Attribute that this Boss will spawn with.- Parameters:
inst
- Attribute Instance
-
getEquipment
Fetch the Boss's Equipment.- Returns:
- Equipment that the Boss will spawn with
-
setItem
Sets an item on this Boss's Equipment that it will spawn with.- Parameters:
slot
- EquipmentSlot to spawnitem
- ItemStack to set, can be null
-
setHelmet
Sets this Boss's Helmet.- Parameters:
item
- Helmet Item to set, can be null
-
setChestplate
Sets this Boss's Chestplate.- Parameters:
item
- Chestplate Item to set, can be null
-
setLeggings
Sets this Boss's Leggings.- Parameters:
item
- Leggings Item to set, can be null
-
setBoots
Sets this Boss's Boots.- Parameters:
item
- Boots Item to set, can be null
-
setMainhand
Sets this Boss's Mainhand.- Parameters:
item
- Mainhand Item to change, can be null
-
setOffhand
Sets this Boss's Offhand.- Parameters:
item
- Offhand Item to change, can be null
-
getDrops
Get the Drops of this Boss Entity.- Returns:
- List of Drops
-
onSpawn
Called when the Entity Spawns- Parameters:
e
- Event called when it spawns
-
onDeath
Called when the Entity Dies- Parameters:
death
- Event called when it dies
-
onDamageDefensive
Called when this Entity receives damage- Parameters:
e
- Event called when it is damaged
-
onDamageOffensive
Called when this Entity damages another Entity- Parameters:
e
- Event called when it damages another entity
-