Class Boss<T extends Mob>
java.lang.Object
me.gamercoder215.mobchip.bosses.Boss<T>
- Type Parameters:
T- The entity type of this Boss.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault health for Boss (20)protected final longThe Numerical ID of this Boss.protected TThis Entity, can be null. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBoss(@NotNull EntityType t, @NotNull Plugin plugin) Creates a New Boss. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddAttribute(@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 longGet the ID of this Boss Class.final @NotNull SoundGets the Death Sound, orSound.ENTITY_WITHER_DEATHif not setgetDrops()Get the Drops of this Boss Entity.Fetch the Entity Class of this Boss.final EntityTypeFetch the Entity Type of this Boss.final @NotNull Map<EquipmentSlot, ItemStack> Fetch the Boss's Equipment.final @NotNull BossHandlerFetches the BossHandler for this Boss.final doubleGet the health that this Boss will spawn with.final TgetMob()Fetch the Entity.final floatFetches the current sound pitch.final floatFetches the current sound volume.final @NotNull SoundGets the Spawn Sound, orSound.ENTITY_WITHER_SPAWNif not setvoidCalled when this Entity receives damagevoidCalled when this Entity damages another EntityvoidonDeath(EntityDeathEvent death) Called when the Entity DiesvoidCalled when the Entity Spawnsfinal voidremoveAttribute(@NotNull AttributeInstance inst) Removes an Attribute that this Boss will spawn with.final voidSets this Boss's Boots.final voidsetChestplate(@Nullable ItemStack item) Sets this Boss's Chestplate.final voidsetDeathSound(@Nullable Sound s) Sets the Death Sound.final voidsetHealth(double health) Sets the health that this Boss will spawn with.final voidSets this Boss's Helmet.final voidsetItem(@NotNull EquipmentSlot slot, @Nullable ItemStack item) Sets an item on this Boss's Equipment that it will spawn with.final voidsetLeggings(@Nullable ItemStack item) Sets this Boss's Leggings.final voidsetMainhand(@Nullable ItemStack item) Sets this Boss's Mainhand.final voidsetOffhand(@Nullable ItemStack item) Sets this Boss's Offhand.final voidsetSoundPitch(float pitch) Sets the Sound's Pitch.final voidsetSoundVolume(float volume) Sets the Sound's Volume.final voidsetSpawnSound(@Nullable Sound s) Sets the Death Sound.final voidSpawns this Boss.static @Nullable Boss<?> valueOf(long id) Fetch a Boss by its id.static @Nullable Boss<?> 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
-
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
-
valueOf
-
getHandler
Fetches the BossHandler for this Boss.- Returns:
- BossHandler found
-
getEntityClass
-
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_DEATHif 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_SPAWNif 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
-
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
-