Class GlowAgeable

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.Ageable, org.bukkit.entity.Creature, org.bukkit.entity.Damageable, org.bukkit.entity.Entity, org.bukkit.entity.LivingEntity, org.bukkit.entity.Mob, 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
Direct Known Subclasses:
GlowAnimal, GlowVillager

public class GlowAgeable extends GlowCreature implements org.bukkit.entity.Ageable
Represents a creature that ages, such as a sheep.
  • Field Details

    • width

      protected float width
    • height

      protected float height
  • Constructor Details

    • GlowAgeable

      public GlowAgeable(org.bukkit.Location location, org.bukkit.entity.EntityType type, double maxHealth)
      Creates a new ageable creature.
      Parameters:
      location - The location of the creature.
      type - The type of monster.
      maxHealth - The max health of the creature.
  • Method Details

    • pulse

      public void pulse()
      Description copied from class: GlowEntity
      Called every game cycle. Subclasses should implement this to implement periodic functionality e.g. mob AI.
      Overrides:
      pulse in class GlowLivingEntity
    • setAge

      public final void setAge(int age)
      Specified by:
      setAge in interface org.bukkit.entity.Ageable
    • getAgeLock

      public final boolean getAgeLock()
      Specified by:
      getAgeLock in interface org.bukkit.entity.Ageable
    • setBaby

      public final void setBaby()
      Specified by:
      setBaby in interface org.bukkit.entity.Ageable
    • setAdult

      public final void setAdult()
      Specified by:
      setAdult in interface org.bukkit.entity.Ageable
    • isAdult

      public final boolean isAdult()
      Specified by:
      isAdult in interface org.bukkit.entity.Ageable
    • canBreed

      public boolean canBreed()
      Specified by:
      canBreed in interface org.bukkit.entity.Ageable
    • canGrow

      public boolean canGrow()
      Gets whether this entity can grow when fed.
      Returns:
      true if this entity can grow when fed, false otherwise.
    • setBreed

      public void setBreed(boolean breed)
      Specified by:
      setBreed in interface org.bukkit.entity.Ageable
    • setScaleForAge

      public void setScaleForAge(boolean isAdult)
    • createSpawnMessage

      public List<com.flowpowered.network.Message> createSpawnMessage()
      Description copied from class: GlowEntity
      Creates a list of Messages which can be sent to a client to spawn this entity. Implementations in concrete subclasses may return a shallowly immutable list.
      Overrides:
      createSpawnMessage in class GlowCreature
      Returns:
      A list of messages which can spawn this entity.
    • setScale

      protected final void setScale(float scale)
    • entityInteract

      public boolean entityInteract(GlowPlayer player, InteractEntityMessage message)
      Overrides:
      entityInteract in class GlowLivingEntity
    • createBaby

      public org.bukkit.entity.Ageable createBaby()
      Creates a baby clone of this creature, as when right-clicking it with a spawn egg.
      Returns:
      a baby clone of this creature
    • getSoundPitch

      protected float getSoundPitch()
      Description copied from class: GlowLivingEntity
      The pitch of the sounds this entity makes.
      Overrides:
      getSoundPitch in class GlowLivingEntity
      Returns:
      the pitch of the sounds
    • grow

      public void grow(int age)
      Grows an ageable creature.
      Parameters:
      age - The age to add to the ageable creature.
    • computeGrowthAmount

      protected int computeGrowthAmount(org.bukkit.Material material)
      Computes the growth amount using a specific material for the current ageable creature. Always returns 0 for an adult or if the material is not food for the creature.
      Parameters:
      material - The food used to compute the growth amount.
      Returns:
      The age gained using the given food.
    • getAge

      public int getAge()
      Specified by:
      getAge in interface org.bukkit.entity.Ageable
    • setAgeLock

      public void setAgeLock(boolean ageLock)
      Specified by:
      setAgeLock in interface org.bukkit.entity.Ageable
    • getForcedAge

      public int getForcedAge()
    • setForcedAge

      public void setForcedAge(int forcedAge)
    • getLoveModeTicks

      public int getLoveModeTicks()
    • setLoveModeTicks

      public void setLoveModeTicks(int loveModeTicks)
    • getParent

      public GlowAgeable getParent()
    • setParent

      public void setParent(GlowAgeable parent)