Class LivingEntityMock

java.lang.Object
org.bukkit.command.CommandSender.Spigot
org.bukkit.entity.Entity.Spigot
be.seeseemelk.mockbukkit.entity.EntityMock
be.seeseemelk.mockbukkit.entity.LivingEntityMock
All Implemented Interfaces:
MessageTarget, net.kyori.adventure.audience.Audience, net.kyori.adventure.pointer.Pointered, net.kyori.adventure.sound.Sound.Emitter, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowEntity>, org.bukkit.attribute.Attributable, org.bukkit.command.CommandSender, org.bukkit.entity.Damageable, org.bukkit.entity.Entity, org.bukkit.entity.LivingEntity, 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:
ArmorStandMock, HumanEntityMock, MobMock

public abstract class LivingEntityMock extends EntityMock implements org.bukkit.entity.LivingEntity
  • Field Details

    • health

      protected double health
    • alive

      protected boolean alive
    • attributes

      protected Map<org.bukkit.attribute.Attribute,AttributeInstanceMock> attributes
  • Constructor Details

    • LivingEntityMock

      protected LivingEntityMock(@NotNull @NotNull ServerMock server, @NotNull @NotNull UUID uuid)
  • Method Details

    • getHealth

      public double getHealth()
      Specified by:
      getHealth in interface org.bukkit.entity.Damageable
    • remove

      public void remove()
      Specified by:
      remove in interface org.bukkit.entity.Entity
      Overrides:
      remove in class EntityMock
    • isDead

      public boolean isDead()
      Specified by:
      isDead in interface org.bukkit.entity.Entity
      Overrides:
      isDead in class EntityMock
    • isValid

      public boolean isValid()
      Specified by:
      isValid in interface org.bukkit.entity.Entity
      Overrides:
      isValid in class EntityMock
    • setHealth

      public void setHealth(double health)
      Specified by:
      setHealth in interface org.bukkit.entity.Damageable
    • getAbsorptionAmount

      public double getAbsorptionAmount()
      Specified by:
      getAbsorptionAmount in interface org.bukkit.entity.Damageable
    • setAbsorptionAmount

      public void setAbsorptionAmount(double amount)
      Specified by:
      setAbsorptionAmount in interface org.bukkit.entity.Damageable
    • getMaxHealth

      public double getMaxHealth()
      Specified by:
      getMaxHealth in interface org.bukkit.entity.Damageable
    • setMaxHealth

      public void setMaxHealth(double health)
      Specified by:
      setMaxHealth in interface org.bukkit.entity.Damageable
    • resetMaxHealth

      public void resetMaxHealth()
      Specified by:
      resetMaxHealth in interface org.bukkit.entity.Damageable
    • damage

      public void damage(double amount)
      Specified by:
      damage in interface org.bukkit.entity.Damageable
    • damage

      public void damage(double amount, @Nullable @Nullable org.bukkit.entity.Entity source)
      Specified by:
      damage in interface org.bukkit.entity.Damageable
    • getAttribute

      public org.bukkit.attribute.AttributeInstance getAttribute(@NotNull @NotNull org.bukkit.attribute.Attribute attribute)
      Specified by:
      getAttribute in interface org.bukkit.attribute.Attributable
    • registerAttribute

      public void registerAttribute(@NotNull @NotNull org.bukkit.attribute.Attribute attribute)
      Specified by:
      registerAttribute in interface org.bukkit.attribute.Attributable
    • launchProjectile

      @NotNull public <T extends org.bukkit.entity.Projectile> T launchProjectile(@NotNull @NotNull Class<? extends T> projectile)
      Specified by:
      launchProjectile in interface org.bukkit.projectiles.ProjectileSource
    • launchProjectile

      @NotNull public <T extends org.bukkit.entity.Projectile> T launchProjectile(@NotNull @NotNull Class<? extends T> projectile, @Nullable @Nullable org.bukkit.util.Vector velocity)
      Specified by:
      launchProjectile in interface org.bukkit.projectiles.ProjectileSource
    • getEyeHeight

      public double getEyeHeight()
      Specified by:
      getEyeHeight in interface org.bukkit.entity.LivingEntity
    • getEyeHeight

      public double getEyeHeight(boolean ignorePose)
      Specified by:
      getEyeHeight in interface org.bukkit.entity.LivingEntity
    • getEyeLocation

      @NotNull public @NotNull org.bukkit.Location getEyeLocation()
      Specified by:
      getEyeLocation in interface org.bukkit.entity.LivingEntity
    • getLineOfSight

      @NotNull public @NotNull List<org.bukkit.block.Block> getLineOfSight(Set<org.bukkit.Material> transparent, int maxDistance)
      Specified by:
      getLineOfSight in interface org.bukkit.entity.LivingEntity
    • getTargetBlock

      @NotNull public @NotNull org.bukkit.block.Block getTargetBlock(Set<org.bukkit.Material> transparent, int maxDistance)
      Specified by:
      getTargetBlock in interface org.bukkit.entity.LivingEntity
    • getTargetBlock

      @Nullable public @Nullable org.bukkit.block.Block getTargetBlock(int maxDistance, @NotNull com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode)
      Specified by:
      getTargetBlock in interface org.bukkit.entity.LivingEntity
    • getTargetBlockFace

      @Nullable public @Nullable org.bukkit.block.BlockFace getTargetBlockFace(int maxDistance, @NotNull com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode)
      Specified by:
      getTargetBlockFace in interface org.bukkit.entity.LivingEntity
    • getTargetBlockInfo

      @Nullable public @Nullable com.destroystokyo.paper.block.TargetBlockInfo getTargetBlockInfo(int maxDistance, @NotNull com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode)
      Specified by:
      getTargetBlockInfo in interface org.bukkit.entity.LivingEntity
    • getTargetEntity

      @Nullable public @Nullable org.bukkit.entity.Entity getTargetEntity(int maxDistance, boolean ignoreBlocks)
      Specified by:
      getTargetEntity in interface org.bukkit.entity.LivingEntity
    • getTargetEntityInfo

      @Nullable public @Nullable com.destroystokyo.paper.entity.TargetEntityInfo getTargetEntityInfo(int maxDistance, boolean ignoreBlocks)
      Specified by:
      getTargetEntityInfo in interface org.bukkit.entity.LivingEntity
    • getLastTwoTargetBlocks

      @NotNull public @NotNull List<org.bukkit.block.Block> getLastTwoTargetBlocks(Set<org.bukkit.Material> transparent, int maxDistance)
      Specified by:
      getLastTwoTargetBlocks in interface org.bukkit.entity.LivingEntity
    • getTargetBlockExact

      @Nullable public @Nullable org.bukkit.block.Block getTargetBlockExact(int maxDistance)
      Specified by:
      getTargetBlockExact in interface org.bukkit.entity.LivingEntity
    • getTargetBlockExact

      @Nullable public @Nullable org.bukkit.block.Block getTargetBlockExact(int maxDistance, @NotNull @NotNull org.bukkit.FluidCollisionMode fluidCollisionMode)
      Specified by:
      getTargetBlockExact in interface org.bukkit.entity.LivingEntity
    • rayTraceBlocks

      @Nullable public @Nullable org.bukkit.util.RayTraceResult rayTraceBlocks(double maxDistance)
      Specified by:
      rayTraceBlocks in interface org.bukkit.entity.LivingEntity
    • rayTraceBlocks

      @Nullable public @Nullable org.bukkit.util.RayTraceResult rayTraceBlocks(double maxDistance, @NotNull @NotNull org.bukkit.FluidCollisionMode fluidCollisionMode)
      Specified by:
      rayTraceBlocks in interface org.bukkit.entity.LivingEntity
    • getRemainingAir

      public int getRemainingAir()
      Specified by:
      getRemainingAir in interface org.bukkit.entity.LivingEntity
    • setRemainingAir

      public void setRemainingAir(int ticks)
      Specified by:
      setRemainingAir in interface org.bukkit.entity.LivingEntity
    • getMaximumAir

      public int getMaximumAir()
      Specified by:
      getMaximumAir in interface org.bukkit.entity.LivingEntity
    • setMaximumAir

      public void setMaximumAir(int ticks)
      Specified by:
      setMaximumAir in interface org.bukkit.entity.LivingEntity
    • getMaximumNoDamageTicks

      public int getMaximumNoDamageTicks()
      Specified by:
      getMaximumNoDamageTicks in interface org.bukkit.entity.LivingEntity
    • setMaximumNoDamageTicks

      public void setMaximumNoDamageTicks(int ticks)
      Specified by:
      setMaximumNoDamageTicks in interface org.bukkit.entity.LivingEntity
    • getLastDamage

      public double getLastDamage()
      Specified by:
      getLastDamage in interface org.bukkit.entity.LivingEntity
    • setLastDamage

      public void setLastDamage(double damage)
      Specified by:
      setLastDamage in interface org.bukkit.entity.LivingEntity
    • getNoDamageTicks

      public int getNoDamageTicks()
      Specified by:
      getNoDamageTicks in interface org.bukkit.entity.LivingEntity
    • setNoDamageTicks

      public void setNoDamageTicks(int ticks)
      Specified by:
      setNoDamageTicks in interface org.bukkit.entity.LivingEntity
    • getKiller

      @Nullable public @Nullable org.bukkit.entity.Player getKiller()
      Specified by:
      getKiller in interface org.bukkit.entity.LivingEntity
    • setKiller

      public void setKiller(@Nullable @Nullable org.bukkit.entity.Player killer)
      Specified by:
      setKiller in interface org.bukkit.entity.LivingEntity
    • addPotionEffect

      public boolean addPotionEffect(@NotNull @NotNull org.bukkit.potion.PotionEffect effect)
      Specified by:
      addPotionEffect in interface org.bukkit.entity.LivingEntity
    • addPotionEffect

      @Deprecated public boolean addPotionEffect(@NotNull @NotNull org.bukkit.potion.PotionEffect effect, boolean force)
      Deprecated.
      Specified by:
      addPotionEffect in interface org.bukkit.entity.LivingEntity
    • addPotionEffects

      public boolean addPotionEffects(@NotNull @NotNull Collection<org.bukkit.potion.PotionEffect> effects)
      Specified by:
      addPotionEffects in interface org.bukkit.entity.LivingEntity
    • hasPotionEffect

      public boolean hasPotionEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type)
      Specified by:
      hasPotionEffect in interface org.bukkit.entity.LivingEntity
    • getPotionEffect

      public org.bukkit.potion.PotionEffect getPotionEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type)
      Specified by:
      getPotionEffect in interface org.bukkit.entity.LivingEntity
    • removePotionEffect

      public void removePotionEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type)
      Specified by:
      removePotionEffect in interface org.bukkit.entity.LivingEntity
    • getActivePotionEffects

      @NotNull public @NotNull Collection<org.bukkit.potion.PotionEffect> getActivePotionEffects()
      Specified by:
      getActivePotionEffects in interface org.bukkit.entity.LivingEntity
    • hasLineOfSight

      public boolean hasLineOfSight(@NotNull @NotNull org.bukkit.entity.Entity other)
      Specified by:
      hasLineOfSight in interface org.bukkit.entity.LivingEntity
    • hasLineOfSight

      public boolean hasLineOfSight(@NotNull @NotNull org.bukkit.Location location)
      Specified by:
      hasLineOfSight in interface org.bukkit.entity.LivingEntity
    • getRemoveWhenFarAway

      public boolean getRemoveWhenFarAway()
      Specified by:
      getRemoveWhenFarAway in interface org.bukkit.entity.LivingEntity
    • setRemoveWhenFarAway

      public void setRemoveWhenFarAway(boolean remove)
      Specified by:
      setRemoveWhenFarAway in interface org.bukkit.entity.LivingEntity
    • getEquipment

      @Nullable public @Nullable org.bukkit.inventory.EntityEquipment getEquipment()
      Specified by:
      getEquipment in interface org.bukkit.entity.LivingEntity
    • setCanPickupItems

      public void setCanPickupItems(boolean pickup)
      Specified by:
      setCanPickupItems in interface org.bukkit.entity.LivingEntity
    • getCanPickupItems

      public boolean getCanPickupItems()
      Specified by:
      getCanPickupItems in interface org.bukkit.entity.LivingEntity
    • teleport

      public boolean teleport(@NotNull @NotNull org.bukkit.Location location, @NotNull org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause)
      Specified by:
      teleport in interface org.bukkit.entity.Entity
      Overrides:
      teleport in class EntityMock
    • isLeashed

      public boolean isLeashed()
      Specified by:
      isLeashed in interface org.bukkit.entity.LivingEntity
    • getLeashHolder

      @NotNull public @NotNull org.bukkit.entity.Entity getLeashHolder() throws IllegalStateException
      Specified by:
      getLeashHolder in interface org.bukkit.entity.LivingEntity
      Throws:
      IllegalStateException
    • setLeashHolder

      public boolean setLeashHolder(org.bukkit.entity.Entity holder)
      Specified by:
      setLeashHolder in interface org.bukkit.entity.LivingEntity
    • isGliding

      public boolean isGliding()
      Specified by:
      isGliding in interface org.bukkit.entity.LivingEntity
    • setGliding

      public void setGliding(boolean gliding)
      Specified by:
      setGliding in interface org.bukkit.entity.LivingEntity
    • isSwimming

      public boolean isSwimming()
      Specified by:
      isSwimming in interface org.bukkit.entity.LivingEntity
    • setSwimming

      public void setSwimming(boolean swimming)
      Specified by:
      setSwimming in interface org.bukkit.entity.LivingEntity
    • isRiptiding

      public boolean isRiptiding()
      Specified by:
      isRiptiding in interface org.bukkit.entity.LivingEntity
    • isSleeping

      public boolean isSleeping()
      Specified by:
      isSleeping in interface org.bukkit.entity.LivingEntity
    • isClimbing

      public boolean isClimbing()
      Specified by:
      isClimbing in interface org.bukkit.entity.LivingEntity
    • setAI

      public void setAI(boolean ai)
      Specified by:
      setAI in interface org.bukkit.entity.LivingEntity
    • hasAI

      public boolean hasAI()
      Specified by:
      hasAI in interface org.bukkit.entity.LivingEntity
    • attack

      public void attack(@NotNull @NotNull org.bukkit.entity.Entity target)
      Specified by:
      attack in interface org.bukkit.entity.LivingEntity
    • swingMainHand

      public void swingMainHand()
      Specified by:
      swingMainHand in interface org.bukkit.entity.LivingEntity
    • swingOffHand

      public void swingOffHand()
      Specified by:
      swingOffHand in interface org.bukkit.entity.LivingEntity
    • setCollidable

      public void setCollidable(boolean collidable)
      Specified by:
      setCollidable in interface org.bukkit.entity.LivingEntity
    • isCollidable

      public boolean isCollidable()
      Specified by:
      isCollidable in interface org.bukkit.entity.LivingEntity
    • getCollidableExemptions

      @NotNull public @NotNull Set<UUID> getCollidableExemptions()
      Specified by:
      getCollidableExemptions in interface org.bukkit.entity.LivingEntity
    • getMemory

      @Nullable public <T> T getMemory(@NotNull @NotNull org.bukkit.entity.memory.MemoryKey<T> memoryKey)
      Specified by:
      getMemory in interface org.bukkit.entity.LivingEntity
    • setMemory

      public <T> void setMemory(@NotNull @NotNull org.bukkit.entity.memory.MemoryKey<T> memoryKey, @Nullable T memoryValue)
      Specified by:
      setMemory in interface org.bukkit.entity.LivingEntity
    • getCategory

      @NotNull public @NotNull org.bukkit.entity.EntityCategory getCategory()
      Specified by:
      getCategory in interface org.bukkit.entity.LivingEntity
    • setArrowsInBody

      public void setArrowsInBody(int count)
      Specified by:
      setArrowsInBody in interface org.bukkit.entity.LivingEntity
    • getBeeStingerCooldown

      public int getBeeStingerCooldown()
      Specified by:
      getBeeStingerCooldown in interface org.bukkit.entity.LivingEntity
    • setBeeStingerCooldown

      public void setBeeStingerCooldown(int ticks)
      Specified by:
      setBeeStingerCooldown in interface org.bukkit.entity.LivingEntity
    • getBeeStingersInBody

      public int getBeeStingersInBody()
      Specified by:
      getBeeStingersInBody in interface org.bukkit.entity.LivingEntity
    • setBeeStingersInBody

      public void setBeeStingersInBody(int count)
      Specified by:
      setBeeStingersInBody in interface org.bukkit.entity.LivingEntity
    • getArrowsInBody

      public int getArrowsInBody()
      Specified by:
      getArrowsInBody in interface org.bukkit.entity.LivingEntity
    • setArrowCooldown

      public void setArrowCooldown(int ticks)
      Specified by:
      setArrowCooldown in interface org.bukkit.entity.LivingEntity
    • getArrowCooldown

      public int getArrowCooldown()
      Specified by:
      getArrowCooldown in interface org.bukkit.entity.LivingEntity
    • setInvisible

      public void setInvisible(boolean invisible)
      Specified by:
      setInvisible in interface org.bukkit.entity.LivingEntity
    • isInvisible

      public boolean isInvisible()
      Specified by:
      isInvisible in interface org.bukkit.entity.LivingEntity
    • getArrowsStuck

      public int getArrowsStuck()
      Specified by:
      getArrowsStuck in interface org.bukkit.entity.LivingEntity
    • setArrowsStuck

      public void setArrowsStuck(int arrows)
      Specified by:
      setArrowsStuck in interface org.bukkit.entity.LivingEntity
    • getShieldBlockingDelay

      public int getShieldBlockingDelay()
      Specified by:
      getShieldBlockingDelay in interface org.bukkit.entity.LivingEntity
    • setShieldBlockingDelay

      public void setShieldBlockingDelay(int delay)
      Specified by:
      setShieldBlockingDelay in interface org.bukkit.entity.LivingEntity
    • getActiveItem

      @Nullable public @Nullable org.bukkit.inventory.ItemStack getActiveItem()
      Specified by:
      getActiveItem in interface org.bukkit.entity.LivingEntity
    • clearActiveItem

      public void clearActiveItem()
      Specified by:
      clearActiveItem in interface org.bukkit.entity.LivingEntity
    • getItemUseRemainingTime

      public int getItemUseRemainingTime()
      Specified by:
      getItemUseRemainingTime in interface org.bukkit.entity.LivingEntity
    • getHandRaisedTime

      public int getHandRaisedTime()
      Specified by:
      getHandRaisedTime in interface org.bukkit.entity.LivingEntity
    • isHandRaised

      public boolean isHandRaised()
      Specified by:
      isHandRaised in interface org.bukkit.entity.LivingEntity
    • getHandRaised

      @NotNull public @NotNull org.bukkit.inventory.EquipmentSlot getHandRaised()
      Specified by:
      getHandRaised in interface org.bukkit.entity.LivingEntity
    • isJumping

      public boolean isJumping()
      Specified by:
      isJumping in interface org.bukkit.entity.LivingEntity
    • setJumping

      public void setJumping(boolean jumping)
      Specified by:
      setJumping in interface org.bukkit.entity.LivingEntity
    • playPickupItemAnimation

      public void playPickupItemAnimation(@NotNull @NotNull org.bukkit.entity.Item item, int quantity)
      Specified by:
      playPickupItemAnimation in interface org.bukkit.entity.LivingEntity
    • getHurtDirection

      public float getHurtDirection()
      Specified by:
      getHurtDirection in interface org.bukkit.entity.LivingEntity
    • setHurtDirection

      public void setHurtDirection(float hurtDirection)
      Specified by:
      setHurtDirection in interface org.bukkit.entity.LivingEntity