Class GlowVillager

All Implemented Interfaces:
net.kyori.adventure.audience.Audience, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowEntity>, org.bukkit.attribute.Attributable, org.bukkit.command.CommandSender, org.bukkit.entity.AbstractVillager, org.bukkit.entity.Ageable, org.bukkit.entity.Breedable, org.bukkit.entity.Creature, org.bukkit.entity.Damageable, org.bukkit.entity.Entity, org.bukkit.entity.LivingEntity, org.bukkit.entity.Mob, org.bukkit.entity.NPC, org.bukkit.entity.Villager, org.bukkit.inventory.InventoryHolder, org.bukkit.inventory.Merchant, org.bukkit.loot.Lootable, org.bukkit.metadata.Metadatable, org.bukkit.Nameable, org.bukkit.permissions.Permissible, org.bukkit.permissions.ServerOperator, org.bukkit.persistence.PersistentDataHolder, org.bukkit.projectiles.ProjectileSource

public class GlowVillager extends GlowAgeable implements org.bukkit.entity.Villager
  • Constructor Details

    • GlowVillager

      public GlowVillager(org.bukkit.Location location)
      Creates a villager with a random profession.
      Parameters:
      location - the location
  • Method Details

    • getRandomProfession

      public static org.bukkit.entity.Villager.Profession getRandomProfession(Random random)
      Gets a random Villager.Profession.
      Parameters:
      random - the random instance
      Returns:
      a random Villager.Profession
    • isValidProfession

      public static boolean isValidProfession(int professionId)
      Checks whether or not the given Villager.Profession ID is valid.
      Parameters:
      professionId - the ID of the Villager.Profession
      Returns:
      true if the ID is valid, false otherwise
    • getProfessionById

      public static org.bukkit.entity.Villager.Profession getProfessionById(int professionId)
      Gets the Villager.Profession corresponding to the given ID.
      Parameters:
      professionId - the ID of the Villager.Profession
      Returns:
      the corresponding Villager.Profession, or null if none exists
    • getProfession

      public org.bukkit.entity.Villager.Profession getProfession()
      Specified by:
      getProfession in interface org.bukkit.entity.Villager
    • setProfession

      public void setProfession(org.bukkit.entity.Villager.Profession profession)
      Specified by:
      setProfession in interface org.bukkit.entity.Villager
    • getVillagerType

      @NotNull public @NotNull org.bukkit.entity.Villager.Type getVillagerType()
      Specified by:
      getVillagerType in interface org.bukkit.entity.Villager
    • setVillagerType

      public void setVillagerType(@NotNull @NotNull org.bukkit.entity.Villager.Type type)
      Specified by:
      setVillagerType in interface org.bukkit.entity.Villager
    • getVillagerLevel

      public int getVillagerLevel()
      Specified by:
      getVillagerLevel in interface org.bukkit.entity.Villager
    • setVillagerLevel

      public void setVillagerLevel(int i)
      Specified by:
      setVillagerLevel in interface org.bukkit.entity.Villager
    • getVillagerExperience

      public int getVillagerExperience()
      Specified by:
      getVillagerExperience in interface org.bukkit.entity.Villager
    • setVillagerExperience

      public void setVillagerExperience(int i)
      Specified by:
      setVillagerExperience in interface org.bukkit.entity.Villager
    • getRestocksToday

      public int getRestocksToday()
      Specified by:
      getRestocksToday in interface org.bukkit.entity.Villager
    • setRestocksToday

      public void setRestocksToday(int i)
      Specified by:
      setRestocksToday in interface org.bukkit.entity.Villager
    • sleep

      public boolean sleep(@NotNull @NotNull org.bukkit.Location location)
      Specified by:
      sleep in interface org.bukkit.entity.Villager
    • wakeup

      public void wakeup()
      Specified by:
      wakeup in interface org.bukkit.entity.Villager
    • getReputation

      @Nullable public @Nullable com.destroystokyo.paper.entity.villager.Reputation getReputation(@NotNull @NotNull UUID uuid)
      Specified by:
      getReputation in interface org.bukkit.entity.Villager
    • getReputations

      @NotNull public @NotNull Map<UUID,​com.destroystokyo.paper.entity.villager.Reputation> getReputations()
      Specified by:
      getReputations in interface org.bukkit.entity.Villager
    • setReputations

      public void setReputations(@NotNull @NotNull Map<UUID,​com.destroystokyo.paper.entity.villager.Reputation> map)
      Specified by:
      setReputations in interface org.bukkit.entity.Villager
    • setReputation

      public void setReputation(@NotNull @NotNull UUID uuid, @NotNull @NotNull com.destroystokyo.paper.entity.villager.Reputation reputation)
      Specified by:
      setReputation in interface org.bukkit.entity.Villager
    • clearReputations

      public void clearReputations()
      Specified by:
      clearReputations in interface org.bukkit.entity.Villager
    • getRecipes

      public List<org.bukkit.inventory.MerchantRecipe> getRecipes()
      Specified by:
      getRecipes in interface org.bukkit.inventory.Merchant
    • setRecipes

      public void setRecipes(List<org.bukkit.inventory.MerchantRecipe> recipes)
      Specified by:
      setRecipes in interface org.bukkit.inventory.Merchant
    • getRecipe

      public org.bukkit.inventory.MerchantRecipe getRecipe(int index) throws IndexOutOfBoundsException
      Specified by:
      getRecipe in interface org.bukkit.inventory.Merchant
      Throws:
      IndexOutOfBoundsException
    • setRecipe

      public void setRecipe(int index, org.bukkit.inventory.MerchantRecipe recipe) throws IndexOutOfBoundsException
      Specified by:
      setRecipe in interface org.bukkit.inventory.Merchant
      Throws:
      IndexOutOfBoundsException
    • getRecipeCount

      public int getRecipeCount()
      Specified by:
      getRecipeCount in interface org.bukkit.inventory.Merchant
    • clearRecipes

      public void clearRecipes()
      Clears the recipes of this villager.
    • getInventory

      public org.bukkit.inventory.Inventory getInventory()
      Specified by:
      getInventory in interface org.bukkit.entity.AbstractVillager
      Specified by:
      getInventory in interface org.bukkit.inventory.InventoryHolder
    • resetOffers

      public void resetOffers()
      Specified by:
      resetOffers in interface org.bukkit.entity.AbstractVillager
    • isTrading

      public boolean isTrading()
      Specified by:
      isTrading in interface org.bukkit.inventory.Merchant
    • setCareerLevel

      public void setCareerLevel(int careerLevel)
      Set the current level of this villager's trading options.

      If 0, the next trade will assign a new career and set the career level to 1.

      Parameters:
      careerLevel - the level of this villager's trading options
    • entityInteract

      public boolean entityInteract(GlowPlayer player, InteractEntityMessage message)
      Overrides:
      entityInteract in class GlowAgeable
    • getHurtSound

      protected org.bukkit.Sound getHurtSound()
      Description copied from class: GlowLivingEntity
      Get the hurt sound of this entity, or null for silence.
      Overrides:
      getHurtSound in class GlowLivingEntity
      Returns:
      the hurt sound if available
    • getDeathSound

      protected org.bukkit.Sound getDeathSound()
      Description copied from class: GlowLivingEntity
      Get the death sound of this entity, or null for silence.
      Overrides:
      getDeathSound in class GlowLivingEntity
      Returns:
      the death sound if available
    • getAmbientSound

      protected org.bukkit.Sound getAmbientSound()
      Description copied from class: GlowLivingEntity
      Get the ambient sound this entity makes randomly, or null for silence.
      Overrides:
      getAmbientSound in class GlowLivingEntity
      Returns:
      the ambient sound if available
    • damage

      public void damage(double amount, org.bukkit.entity.Entity source, @NotNull @NotNull org.bukkit.event.entity.EntityDamageEvent.DamageCause cause)
      Specified by:
      damage in interface org.bukkit.entity.Damageable
      Overrides:
      damage in class GlowLivingEntity
    • getRiches

      public int getRiches()
    • setRiches

      public void setRiches(int riches)
    • getTrader

      public GlowHumanEntity getTrader()
      The trader this villager is currently trading with.
      Specified by:
      getTrader in interface org.bukkit.inventory.Merchant
    • setTrader

      public void setTrader(GlowHumanEntity trader)
      The trader this villager is currently trading with.
      Parameters:
      trader - the trader
    • isWilling

      public boolean isWilling()
      Whether or not this villager is willing to mate.
      Returns:
      true if this villager is willing to mate, false otherwise
    • setWilling

      public void setWilling(boolean willing)
      Whether or not this villager is willing to mate.
      Parameters:
      willing - true if this villager is willing to mate, false otherwise
    • getCareerLevel

      public int getCareerLevel()
      Get the current level of this villager's trading options.
      Returns:
      the current level of this villager's trading options