Class EntityBuilder
java.lang.Object
dev.selena.luacore.utils.entities.EntityBuilder
THIS CLASS IS NOT AT ALL READY YET PLEASE DO NOT USE
-
Constructor Summary
ConstructorDescriptionUsed for creating a blank instanceEntityBuilder
(org.bukkit.entity.EntityType type) Used for creating an instance with EntityType -
Method Summary
Modifier and TypeMethodDescriptionaddCustomNBTData
(String key, Object cls) Used for adding custom NBTData to the entityaddCustomNBTDataValues
(Map<String, Object> values) Used for adding a map of NBTData to add to the entityaddDrop
(double chance, ItemBuilder item) Used for adding a drop to the collectionaddDrop
(double chance, org.bukkit.inventory.ItemStack item) Used for adding a drop to the collectionaddDrops
(Map<ItemBuilder, Double> drops) used to add a map of drops to the drop collectionaddDropsFromItemMap
(Map<org.bukkit.inventory.ItemStack, Double> drops) used to add a map of drops to the drop collectionaddMetaDataValue
(String key, org.bukkit.metadata.MetadataValue metadata) Used for adding metadata to the entity (Not to sure if I can make it save on server restart) (NOTE: I Suggest usingaddCustomNBTData(String, Object)
)addMetaDataValues
(Map<String, org.bukkit.metadata.MetadataValue> metadataValues) Used for adding a map of metadata values to the entity (NOTE: I Suggest usingaddCustomNBTDataValues(Map)
)addPotionEffect
(org.bukkit.potion.PotionEffect effect) Used for adding a potion effect to the list of effectsaddPotionEffects
(List<org.bukkit.potion.PotionEffect> effects) Used for adding a list of potion effects to the entityaddPotionEffects
(org.bukkit.potion.PotionEffect... effects) Used for adding an array of potion effects to the entitysetArmorBonus
(float armorBonus) Used for setting the armor bonus attribute (0.0 to 30.0, default 0.0)setArmorToughnessBonus
(float armorToughnessBonus) Used for setting the armor toughness bonus attribute (0.0 to 20.0, default 0.0)setAttackDamageBonus
(float attackDamageBonus) Used for setting the attack damage bonus (0.0 to 2048.0 default, 2.0)setAttackKnockBack
(float attackKnockBack) Used for setting the attack knock back attribute (0.0 to 5.0, default 0.0)setAttackSpeed
(float attackSpeed) Used for setting the attack speed attribute (0.0 to 1024.0, default 4)setBoots
(org.bukkit.inventory.ItemStack boots) Used for setting the entity bootssetChestplate
(org.bukkit.inventory.ItemStack chestplate) Used for setting the entity chestplatesetCustomNBTData
(Map<String, Object> customNBTData) Used for setting the custom NBTData mapsetCustomPathfinderGoal
(Class<?> customPathfinderGoal) Used for setting a custom pathfinder goal NOTE: THIS IS NOT ADDED YETsetDisplayName
(String displayName) Used for setting the display name of the entity (Color is translated once applied so no need to do it before)setDrops
(RandomCollection<ItemBuilder> drops) Used for setting the drop collection for entity deathsetDropsFromItemCollection
(RandomCollection<org.bukkit.inventory.ItemStack> itemStackDrops) Used for setting the drop collection for entity deathsetEntityInteractWithBlockDistance
(float entityInteractWithBlockDistance) Used to set the entity interaction with block distance attribute (0.0 to 64, default 4.5)setEntityInteractWithEntityDistance
(float entityInteractWithEntityDistance) Used to set the entity interaction with entity distance attribute (0.0 to 64.0, default 3.0)setEntityScale
(float entityScale) Used for setting the entity scale attribute (0.0625 to 16.0, default 1.0)setEntityType
(org.bukkit.entity.EntityType entityType) Used for setting the type of entity to spawnsetFlyingSpeed
(float flyingSpeed) Used for setting the flight speed attribute (0.0 to 1024.0, default 0.4)setFollowRange
(float followRange) Used for setting the entity follow range attribute (0.0 to 2048, default 32.0)setHelmet
(org.bukkit.inventory.ItemStack helmet) Used for setting the entity helmetsetHorseJumpStrength
(float horseJumpStrength) Used for setting the horse jump strength attribute (0.0 to 2.0, default 0.7)setKnockBackResistance
(float knockBackResistance) Used for setting the knock back resistance attribute (0.0 to 1.0, default 0.0)setLeggings
(org.bukkit.inventory.ItemStack leggings) Used for setting the entity leggingssetLuck
(float luck) Used for setting the luck attribute (-1024.0 to 1024.0, default 0.0)setMainHandItem
(org.bukkit.inventory.ItemStack mainHandItem) Used for setting the item in the entities main handsetMaxAbsorption
(float maxAbsorption) Used for setting the maximum absorption attribute (0.0 to 2048.0, default 0.0)setMaxHealth
(float maxHealth) Used for setting the maximum health attribute (0.0 to 1024.0, default 20.0)setMetadataValues
(Map<String, org.bukkit.metadata.MetadataValue> metadataValues) Used for setting the map of metadata values (NOTE: I suggest usingsetCustomNBTData(Map)
)setMovementSpeed
(float movementSpeed) Used for setting the entity movement speed attribute (0.0 to 1024.0, default depends on entity)setOffHandItem
(org.bukkit.inventory.ItemStack offHandItem) Used for setting the item in the entities offhandsetPotionEffects
(List<org.bukkit.potion.PotionEffect> potionEffects) Used for setting the list of potion effectssetStepHeight
(float stepHeight) Used for setting the entity step height attribute (0.0 to 10.0, default 0.6)setZombieReinforcements
(boolean zombieReinforcements) Used for setting the zombie reinforcements attribute (true or false, default false)org.bukkit.entity.Entity
spawn
(org.bukkit.Location location) Used for spawning the entity in the worldorg.bukkit.entity.Entity
spawn
(org.bukkit.Location location, org.bukkit.World world) Used for spawning the entity in the world
-
Constructor Details
-
EntityBuilder
public EntityBuilder()Used for creating a blank instance -
EntityBuilder
public EntityBuilder(org.bukkit.entity.EntityType type) Used for creating an instance with EntityType- Parameters:
type
- The EntityType you want to spawn
-
-
Method Details
-
setPotionEffects
Used for setting the list of potion effects- Parameters:
potionEffects
- The list of potion effects you want to set- Returns:
- The current builder instance
-
addPotionEffect
Used for adding a potion effect to the list of effects- Parameters:
effect
- The effect you want to add- Returns:
- The current builder instance
-
addPotionEffects
Used for adding an array of potion effects to the entity- Parameters:
effects
- The array of effects- Returns:
- The current builder instance
-
addPotionEffects
Used for adding a list of potion effects to the entity- Parameters:
effects
- The list of effects you want to add- Returns:
- The current builder instance
-
addDrop
Used for adding a drop to the collection- Parameters:
chance
- The weighted chanceitem
- The items you want added- Returns:
- The current builder instance
-
addDrops
used to add a map of drops to the drop collection- Parameters:
drops
- The map of drops- Returns:
- The current builder instance
-
addDrop
Used for adding a drop to the collection- Parameters:
chance
- The weighted chanceitem
- The items you want added- Returns:
- The current builder instance
-
addDropsFromItemMap
used to add a map of drops to the drop collection- Parameters:
drops
- The map of drops- Returns:
- The current builder instance
-
addMetaDataValue
Used for adding metadata to the entity (Not to sure if I can make it save on server restart) (NOTE: I Suggest usingaddCustomNBTData(String, Object)
)- Parameters:
key
- The key used for getting the metadata valuemetadata
- The metadata you want to store- Returns:
- The current builder instance
-
addMetaDataValues
public EntityBuilder addMetaDataValues(Map<String, org.bukkit.metadata.MetadataValue> metadataValues) Used for adding a map of metadata values to the entity (NOTE: I Suggest usingaddCustomNBTDataValues(Map)
)- Parameters:
metadataValues
- The map of metadata values- Returns:
- The current builder instance
-
addCustomNBTData
Used for adding custom NBTData to the entity- Parameters:
key
- The key used to gather the datacls
- The NBTData class (NOTE: can be essentially anything)- Returns:
- The current builder instance
-
addCustomNBTDataValues
Used for adding a map of NBTData to add to the entity- Parameters:
values
- The map of NBTData classes- Returns:
- The current builder instance
-
setArmorBonus
Used for setting the armor bonus attribute (0.0 to 30.0, default 0.0)- Parameters:
armorBonus
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setArmorToughnessBonus
Used for setting the armor toughness bonus attribute (0.0 to 20.0, default 0.0)- Parameters:
armorToughnessBonus
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setAttackDamageBonus
Used for setting the attack damage bonus (0.0 to 2048.0 default, 2.0)- Parameters:
attackDamageBonus
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setAttackKnockBack
Used for setting the attack knock back attribute (0.0 to 5.0, default 0.0)- Parameters:
attackKnockBack
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setAttackSpeed
Used for setting the attack speed attribute (0.0 to 1024.0, default 4)- Parameters:
attackSpeed
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setFlyingSpeed
Used for setting the flight speed attribute (0.0 to 1024.0, default 0.4)- Parameters:
flyingSpeed
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setFollowRange
Used for setting the entity follow range attribute (0.0 to 2048, default 32.0)- Parameters:
followRange
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setKnockBackResistance
Used for setting the knock back resistance attribute (0.0 to 1.0, default 0.0)- Parameters:
knockBackResistance
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setLuck
Used for setting the luck attribute (-1024.0 to 1024.0, default 0.0)- Parameters:
luck
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setMaxAbsorption
Used for setting the maximum absorption attribute (0.0 to 2048.0, default 0.0)- Parameters:
maxAbsorption
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setMaxHealth
Used for setting the maximum health attribute (0.0 to 1024.0, default 20.0)- Parameters:
maxHealth
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setMovementSpeed
Used for setting the entity movement speed attribute (0.0 to 1024.0, default depends on entity)- Parameters:
movementSpeed
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setHorseJumpStrength
Used for setting the horse jump strength attribute (0.0 to 2.0, default 0.7)- Parameters:
horseJumpStrength
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setEntityScale
Used for setting the entity scale attribute (0.0625 to 16.0, default 1.0)- Parameters:
entityScale
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setEntityInteractWithBlockDistance
Used to set the entity interaction with block distance attribute (0.0 to 64, default 4.5)- Parameters:
entityInteractWithBlockDistance
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setEntityInteractWithEntityDistance
Used to set the entity interaction with entity distance attribute (0.0 to 64.0, default 3.0)- Parameters:
entityInteractWithEntityDistance
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setStepHeight
Used for setting the entity step height attribute (0.0 to 10.0, default 0.6)- Parameters:
stepHeight
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setZombieReinforcements
Used for setting the zombie reinforcements attribute (true or false, default false)- Parameters:
zombieReinforcements
- The value for the attribute- Returns:
- The current builder instance
- See Also:
-
setEntityType
Used for setting the type of entity to spawn- Parameters:
entityType
- The EntityType you want to spawn- Returns:
- The current builder instance
-
setDisplayName
Used for setting the display name of the entity (Color is translated once applied so no need to do it before)- Parameters:
displayName
- The entity display name- Returns:
- The current builder instance
-
setHelmet
Used for setting the entity helmet- Parameters:
helmet
- The item you want to set for helmet- Returns:
- The current builder instance
-
setChestplate
Used for setting the entity chestplate- Parameters:
chestplate
- The item you want to set for the chestplate (NOTE: Must be a chestplate item)- Returns:
- The current builder instance
-
setLeggings
Used for setting the entity leggings- Parameters:
leggings
- The item you want to set for the leggings (NOTE: Must be a legging item)- Returns:
- The current builder instance
-
setBoots
Used for setting the entity boots- Parameters:
boots
- The item you want to set for the boots (NOTE: Must be a boot item)- Returns:
- The current builder instance
-
setMainHandItem
Used for setting the item in the entities main hand- Parameters:
mainHandItem
- The item you want to place in the main hand- Returns:
- The current builder instance
-
setOffHandItem
Used for setting the item in the entities offhand- Parameters:
offHandItem
- The item you want to place in the offhand- Returns:
- The current builder instance
-
setDrops
Used for setting the drop collection for entity death- Parameters:
drops
- TheRandomCollection
of ItemBuilder drops- Returns:
- The current builder instance
-
setDropsFromItemCollection
public EntityBuilder setDropsFromItemCollection(RandomCollection<org.bukkit.inventory.ItemStack> itemStackDrops) Used for setting the drop collection for entity death- Parameters:
itemStackDrops
- TheRandomCollection
of ItemStack drops- Returns:
- The current builder instance
-
setMetadataValues
public EntityBuilder setMetadataValues(Map<String, org.bukkit.metadata.MetadataValue> metadataValues) Used for setting the map of metadata values (NOTE: I suggest usingsetCustomNBTData(Map)
)- Parameters:
metadataValues
- The map of metadata values- Returns:
- The current builder instance
-
setCustomNBTData
Used for setting the custom NBTData map- Parameters:
customNBTData
- The map of custom NBTData- Returns:
- The current builder instance
-
setCustomPathfinderGoal
Used for setting a custom pathfinder goal NOTE: THIS IS NOT ADDED YET- Parameters:
customPathfinderGoal
- The class of the pathfinder goal- Returns:
- The current builder instance
-
spawn
public org.bukkit.entity.Entity spawn(org.bukkit.Location location, org.bukkit.World world) Used for spawning the entity in the world- Parameters:
location
- The location you want to spawn the entityworld
- The world you want to spawn the entity in- Returns:
- The entity that has just been spawned
- See Also:
-
spawn
public org.bukkit.entity.Entity spawn(org.bukkit.Location location) Used for spawning the entity in the world- Parameters:
location
- The location you want to spawn the entity (World must not be null)- Returns:
- The entity that has just been spawned
- See Also:
-