Class EntityBuilder

java.lang.Object
dev.selena.luacore.utils.entities.EntityBuilder

public class EntityBuilder extends Object
THIS CLASS IS NOT AT ALL READY YET PLEASE DO NOT USE
  • 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

      public EntityBuilder setPotionEffects(List<org.bukkit.potion.PotionEffect> potionEffects)
      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

      public EntityBuilder addPotionEffect(org.bukkit.potion.PotionEffect effect)
      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

      public EntityBuilder addPotionEffects(org.bukkit.potion.PotionEffect... effects)
      Used for adding an array of potion effects to the entity
      Parameters:
      effects - The array of effects
      Returns:
      The current builder instance
    • addPotionEffects

      public EntityBuilder addPotionEffects(List<org.bukkit.potion.PotionEffect> effects)
      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

      public EntityBuilder addDrop(double chance, ItemBuilder item)
      Used for adding a drop to the collection
      Parameters:
      chance - The weighted chance
      item - The items you want added
      Returns:
      The current builder instance
    • addDrops

      public EntityBuilder addDrops(Map<ItemBuilder,Double> drops)
      used to add a map of drops to the drop collection
      Parameters:
      drops - The map of drops
      Returns:
      The current builder instance
    • addDrop

      public EntityBuilder addDrop(double chance, org.bukkit.inventory.ItemStack item)
      Used for adding a drop to the collection
      Parameters:
      chance - The weighted chance
      item - The items you want added
      Returns:
      The current builder instance
    • addDropsFromItemMap

      public EntityBuilder addDropsFromItemMap(Map<org.bukkit.inventory.ItemStack,Double> drops)
      used to add a map of drops to the drop collection
      Parameters:
      drops - The map of drops
      Returns:
      The current builder instance
    • addMetaDataValue

      public EntityBuilder addMetaDataValue(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 using addCustomNBTData(String, Object))
      Parameters:
      key - The key used for getting the metadata value
      metadata - 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 using addCustomNBTDataValues(Map))
      Parameters:
      metadataValues - The map of metadata values
      Returns:
      The current builder instance
    • addCustomNBTData

      public EntityBuilder addCustomNBTData(String key, Object cls)
      Used for adding custom NBTData to the entity
      Parameters:
      key - The key used to gather the data
      cls - The NBTData class (NOTE: can be essentially anything)
      Returns:
      The current builder instance
    • addCustomNBTDataValues

      public EntityBuilder addCustomNBTDataValues(Map<String,Object> values)
      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

      public EntityBuilder setArmorBonus(float armorBonus)
      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

      public EntityBuilder setArmorToughnessBonus(float armorToughnessBonus)
      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

      public EntityBuilder setAttackDamageBonus(float attackDamageBonus)
      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

      public EntityBuilder setAttackKnockBack(float attackKnockBack)
      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

      public EntityBuilder setAttackSpeed(float attackSpeed)
      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

      public EntityBuilder setFlyingSpeed(float flyingSpeed)
      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

      public EntityBuilder setFollowRange(float followRange)
      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

      public EntityBuilder setKnockBackResistance(float knockBackResistance)
      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

      public EntityBuilder setLuck(float luck)
      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

      public EntityBuilder setMaxAbsorption(float maxAbsorption)
      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

      public EntityBuilder setMaxHealth(float maxHealth)
      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

      public EntityBuilder setMovementSpeed(float movementSpeed)
      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

      public EntityBuilder setHorseJumpStrength(float horseJumpStrength)
      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

      public EntityBuilder setEntityScale(float entityScale)
      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

      public EntityBuilder setEntityInteractWithBlockDistance(float entityInteractWithBlockDistance)
      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

      public EntityBuilder setEntityInteractWithEntityDistance(float entityInteractWithEntityDistance)
      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

      public EntityBuilder setStepHeight(float stepHeight)
      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

      public EntityBuilder setZombieReinforcements(boolean zombieReinforcements)
      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

      public EntityBuilder setEntityType(org.bukkit.entity.EntityType entityType)
      Used for setting the type of entity to spawn
      Parameters:
      entityType - The EntityType you want to spawn
      Returns:
      The current builder instance
    • setDisplayName

      public EntityBuilder setDisplayName(String displayName)
      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

      public EntityBuilder setHelmet(org.bukkit.inventory.ItemStack helmet)
      Used for setting the entity helmet
      Parameters:
      helmet - The item you want to set for helmet
      Returns:
      The current builder instance
    • setChestplate

      public EntityBuilder setChestplate(org.bukkit.inventory.ItemStack chestplate)
      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

      public EntityBuilder setLeggings(org.bukkit.inventory.ItemStack leggings)
      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

      public EntityBuilder setBoots(org.bukkit.inventory.ItemStack boots)
      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

      public EntityBuilder setMainHandItem(org.bukkit.inventory.ItemStack mainHandItem)
      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

      public EntityBuilder setOffHandItem(org.bukkit.inventory.ItemStack offHandItem)
      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

      public EntityBuilder setDrops(RandomCollection<ItemBuilder> drops)
      Used for setting the drop collection for entity death
      Parameters:
      drops - The RandomCollection 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 - The RandomCollection 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 using setCustomNBTData(Map))
      Parameters:
      metadataValues - The map of metadata values
      Returns:
      The current builder instance
    • setCustomNBTData

      public EntityBuilder setCustomNBTData(Map<String,Object> customNBTData)
      Used for setting the custom NBTData map
      Parameters:
      customNBTData - The map of custom NBTData
      Returns:
      The current builder instance
    • setCustomPathfinderGoal

      public EntityBuilder setCustomPathfinderGoal(Class<?> customPathfinderGoal)
      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 entity
      world - 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: