public class MobMetadataUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ARROW_DAMAGE
Metadata that holds the base damage of an arrow, used to determine impact damage.
|
private static java.lang.String |
ARROW_TYPE
Metadata that holds the type of an arrow, used to determine impact effects.
|
private static java.lang.String |
BESTIARY_ENTRY
Metadata that holds the bestiary entry name of a mob.
|
private static java.lang.String |
DROP_EXP_AMOUNT
Metadata that holds the amount of an exp drop.
|
private static java.lang.String |
DROP_EXP_TIER
Metadata that holds the tier (max level) of an exp drop.
|
private static java.lang.String |
DROP_KEY_ID
Metadata that holds the id of an instance key drop.
|
private static java.lang.String |
FIXED_DAMAGE
Metadata that implies that the damage of the next damage event has a fixed value.
|
private static java.lang.String |
MAGIC_DAMAGE_MULTIPLIER
Metadata that holds the magic attack multiplier for the next damage event.
|
private static java.lang.String |
MENACING_MODIFIER
Metadata that implies that a generic menacing modifier exists on a mob.
|
private static java.lang.String |
RAID_BOSS
Metadata that implies that a mob is a raid boss.
|
private static java.lang.String |
STRONGBOX_MOB_UUID
Metadata that holds the uuid of the strongbox, that a mob belongs to.
|
private static java.lang.String |
STRONGBOX_TIER
Metadata that holds the tier of a strongbox, used to determine loot contents.
|
Constructor and Description |
---|
MobMetadataUtils() |
Modifier and Type | Method and Description |
---|---|
private static void |
addMetadata(org.bukkit.entity.Entity mob,
java.lang.String key,
java.lang.Object value)
Sets a metadata value in the given mob's metadata store.
|
static int |
getArrowDamage(org.bukkit.entity.Arrow arrow)
Gets the base damage of an arrow from its metadata.
|
static java.lang.String |
getArrowType(org.bukkit.entity.Arrow arrow)
Gets the type of an arrow from its metadata.
|
static java.lang.String |
getBestiaryEntry(org.bukkit.entity.Entity mob)
Gets the bestiary entry name of the given mob mob.
|
static double |
getExpDropAmount(org.bukkit.entity.Entity mob)
Gets the exp to drop, after the mob gets killed.
|
static int |
getExpDropTier(org.bukkit.entity.Entity mob)
Gets the tier (max level) of the exp to drop, after the mob gets killed.
|
static java.lang.String |
getKeyDrop(org.bukkit.entity.Entity mob)
Gets the key drop, after the mob gets killed.
|
static double |
getMagicDamageMultiplier(org.bukkit.entity.Entity mob)
Gets the magic damage multiplier to apply, the next time the mob takes damage.
|
private static org.bukkit.metadata.MetadataValue |
getMetadata(org.bukkit.entity.Entity mob,
java.lang.String key)
Gets a metadata value from the given mob's metadata store.
|
static java.lang.String |
getStronboxMob(org.bukkit.entity.Entity mob)
Gets the uuid of the strongbox, the given mob belongs to.
|
static int |
getStrongboxTier(org.bukkit.entity.ArmorStand strongbox)
Gets the tier of a strongobx, used to determine loot contents.
|
static boolean |
hasArrowTypeAndDamage(org.bukkit.entity.Arrow arrow)
Checks if an arrow has type and base damage values set in its metadata.
|
static boolean |
hasBestiaryEntry(org.bukkit.entity.Entity mob)
Checks if the given mob has a bestiary entry.
|
static boolean |
hasExpDrop(org.bukkit.entity.Entity mob)
Checks for an exp drop, after the mob gets killed.
|
static boolean |
hasFixedDamage(org.bukkit.entity.Entity mob)
Gets if the damage value should be fixed, the next time the mob takes damage.
|
static boolean |
hasKeyDrop(org.bukkit.entity.Entity mob)
Checks for a key drop, after the mob gets killed.
|
static boolean |
hasMenacingModifier(org.bukkit.entity.Entity mob,
MenacingModifier modifier)
Checks if the given menacing modifier on a mob is enabled.
|
static boolean |
hasStrongboxMob(org.bukkit.entity.Entity mob)
Checks if the given mob belongs to a strongbox.
|
static boolean |
isRaidBoss(org.bukkit.entity.Entity mob)
Checks if the raid boss flag on a mob is enabled.
|
static void |
setArrowTypeAndDamage(org.bukkit.entity.Arrow arrow,
java.lang.String type,
int damage)
Sets type and base damage of an arrow, to determine its effects and damage on impact.
|
static void |
setBestiaryEntry(org.bukkit.entity.Entity mob,
java.lang.String entry)
Sets the bestiary entry name of the given mob mob.
|
static void |
setExpDrop(org.bukkit.entity.Entity mob,
int expTier,
double expAmount)
Sets the exp to drop, after the mob gets killed.
|
static void |
setFixedDamage(org.bukkit.entity.Entity mob,
boolean enabled)
Sets if the damage value should be fixed, the next time the mob takes damage.
|
static void |
setKeyDrop(org.bukkit.entity.Entity mob,
java.lang.String keyId)
Sets the key to drop, after the mob gets killed.
|
static void |
setMagicDamageMultiplier(org.bukkit.entity.Entity mob,
double multiplier)
Sets the magic damage multiplier to apply, the next time the mob takes damage.
|
static void |
setMenacingModifier(org.bukkit.entity.Entity mob,
MenacingModifier modifier)
Sets the given menacing modifier on a mob to enabled.
|
static void |
setRaidBoss(org.bukkit.entity.Entity mob,
boolean value)
Sets the raid boss flag on a mob.
|
static void |
setStrongboxMob(org.bukkit.entity.Entity mob,
org.bukkit.entity.ArmorStand strongbox)
Sets the uuid of the strongbox, the given mob belongs to.
|
static void |
setStrongboxTier(org.bukkit.entity.ArmorStand strongbox,
int strongboxTier)
Sets the tier of a strongobx, used to determine loot contents.
|
private static final java.lang.String FIXED_DAMAGE
private static final java.lang.String MAGIC_DAMAGE_MULTIPLIER
private static final java.lang.String ARROW_TYPE
private static final java.lang.String ARROW_DAMAGE
private static final java.lang.String BESTIARY_ENTRY
private static final java.lang.String MENACING_MODIFIER
private static final java.lang.String RAID_BOSS
private static final java.lang.String STRONGBOX_TIER
private static final java.lang.String STRONGBOX_MOB_UUID
private static final java.lang.String DROP_EXP_TIER
private static final java.lang.String DROP_EXP_AMOUNT
private static final java.lang.String DROP_KEY_ID
public static void setFixedDamage(org.bukkit.entity.Entity mob, boolean enabled)
mob
- The mob that receives the metadata.enabled
- If the damage value should be fixed.public static boolean hasFixedDamage(org.bukkit.entity.Entity mob)
mob
- The mob that gets its metadata checked.public static void setMagicDamageMultiplier(org.bukkit.entity.Entity mob, double multiplier)
mob
- The mob that receives the metadata.multiplier
- The multiplier where 1 equals 100 percent, or 0 to disable.public static double getMagicDamageMultiplier(org.bukkit.entity.Entity mob)
mob
- The mob that gets its metadata checked.public static void setArrowTypeAndDamage(org.bukkit.entity.Arrow arrow, java.lang.String type, int damage)
arrow
- The arrow mob that receives the metadata.type
- The type of the arrow.damage
- The base damage the arrow deals.public static boolean hasArrowTypeAndDamage(org.bukkit.entity.Arrow arrow)
arrow
- The arrow mob that gets its metadata checked.public static java.lang.String getArrowType(org.bukkit.entity.Arrow arrow)
arrow
- The arrow mob that gets its metadata checked.public static int getArrowDamage(org.bukkit.entity.Arrow arrow)
arrow
- The arrow mob that gets its metadata checked.public static void setBestiaryEntry(org.bukkit.entity.Entity mob, java.lang.String entry)
mob
- The mob that receives the metadata.entry
- The full name of the bestiary entry.public static boolean hasBestiaryEntry(org.bukkit.entity.Entity mob)
mob
- The mob that gets its metadata checked.public static java.lang.String getBestiaryEntry(org.bukkit.entity.Entity mob)
mob
- The mob that gets its metadata checked.public static void setMenacingModifier(org.bukkit.entity.Entity mob, MenacingModifier modifier)
mob
- The mob that receives the metadata.modifier
- The menacing modifier that the mob receives.public static boolean hasMenacingModifier(org.bukkit.entity.Entity mob, MenacingModifier modifier)
mob
- The mob that gets its metadata checked.modifier
- The menacing modifier to look for.public static void setRaidBoss(org.bukkit.entity.Entity mob, boolean value)
mob
- The mob that receives the metadata.value
- If the mob is a raid boss.public static boolean isRaidBoss(org.bukkit.entity.Entity mob)
mob
- The mob that gets its metadata checked.public static void setStrongboxTier(org.bukkit.entity.ArmorStand strongbox, int strongboxTier)
strongbox
- The strongbox mob that receives the metadata.strongboxTier
- The tier of the strongbox.public static int getStrongboxTier(org.bukkit.entity.ArmorStand strongbox)
strongbox
- The strongbox mob that gets its metadata checked.public static void setStrongboxMob(org.bukkit.entity.Entity mob, org.bukkit.entity.ArmorStand strongbox)
mob
- The mob that receives the metadata.strongbox
- The strongbox mob to which the mob belongs.public static boolean hasStrongboxMob(org.bukkit.entity.Entity mob)
mob
- The mob that gets its metadata checked.public static java.lang.String getStronboxMob(org.bukkit.entity.Entity mob)
mob
- The mob that gets its metadata checked.public static void setExpDrop(org.bukkit.entity.Entity mob, int expTier, double expAmount)
mob
- The mob that receives the metadata.expTier
- The tier (max level) of the exp to drop.expAmount
- The amount of exp to drop.public static boolean hasExpDrop(org.bukkit.entity.Entity mob)
mob
- The mob that gets its metadata checked.public static int getExpDropTier(org.bukkit.entity.Entity mob)
mob
- The mob that gets its metadata checked.public static double getExpDropAmount(org.bukkit.entity.Entity mob)
mob
- The mob that gets its metadata checked.public static void setKeyDrop(org.bukkit.entity.Entity mob, java.lang.String keyId)
mob
- The mob that receives the metadata.keyId
- The id of the instance key to drop.public static boolean hasKeyDrop(org.bukkit.entity.Entity mob)
mob
- The mob that gets its metadata checked.public static java.lang.String getKeyDrop(org.bukkit.entity.Entity mob)
mob
- The mob that gets its metadata checked.private static void addMetadata(org.bukkit.entity.Entity mob, java.lang.String key, java.lang.Object value)
mob
- The mob that receives the metadata.key
- The key under which the metadata is stored.value
- The value of the metadata.private static org.bukkit.metadata.MetadataValue getMetadata(org.bukkit.entity.Entity mob, java.lang.String key)
mob
- The mob that gets its metadata checked.key
- The key under which the metadata is stored.