Package be.seeseemelk.mockbukkit.entity
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,Frictional,PersistentDataViewHolder,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>,Attributable,CommandSender,Damageable,Entity,LivingEntity,Metadatable,Nameable,Permissible,ServerOperator,PersistentDataHolder,ProjectileSource
- Direct Known Subclasses:
ArmorStandMock,HumanEntityMock,MobMock
Mock implementation of a
LivingEntity.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bukkit.entity.Entity
Entity.Spigot -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanWhether the entity is alive.protected Map<Attribute, AttributeInstanceMock> The attributes this entity has.protected doubleHow much health the entity has.Fields inherited from class be.seeseemelk.mockbukkit.entity.EntityMock
entityData, perms, server -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLivingEntityMock(@NotNull ServerMock server, @NotNull UUID uuid) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddPotionEffect(@NotNull PotionEffect effect) booleanaddPotionEffect(@NotNull PotionEffect effect, boolean force) Deprecated.addPotionEffect(@NotNull PotionEffect effect, EntityPotionEffectEvent.Cause cause) Adds a potion effect.booleanaddPotionEffects(@NotNull Collection<PotionEffect> effects) addPotionEffects(@NotNull Collection<PotionEffect> effects, EntityPotionEffectEvent.Cause cause) Adds multiple potion effects.voidvoidbroadcastSlotBreak(@NotNull EquipmentSlot slot) voidbroadcastSlotBreak(@NotNull EquipmentSlot slot, @NotNull Collection<Player> players) booleanbooleancanUseEquipmentSlot(@NotNull EquipmentSlot equipmentSlot) voidbooleanvoidvoiddamage(double amount) voiddamage(double amount, @NotNull DamageSource source) voidvoiddamageItemStack(@NotNull EquipmentSlot slot, int amount) @NotNull ItemStackdamageItemStack(@NotNull ItemStack stack, int amount) double@Nullable ItemStack@NotNull EquipmentSlotintint@NotNull Collection<PotionEffect> intintintgetAttribute(@NotNull Attribute attribute) intintfloatboolean@NotNull EntityCategory@Nullable Sound@NotNull SoundgetDrinkingSound(@NotNull ItemStack itemStack) @NotNull SoundgetEatingSound(@NotNull ItemStack itemStack) protected EntityStateGet the current state of this entity@Nullable EntityEquipmentdoubledoublegetEyeHeight(boolean ignorePose) protected doublegetEyeHeight(EntityState pose) @NotNull Location@NotNull SoundgetFallDamageSound(int fallHeight) @NotNull Sound@NotNull Soundfloat@NotNull net.kyori.adventure.util.TriState@NotNull EquipmentSlotintdoublefloat@Nullable Sound@Nullable ItemStackintint@Nullable PlayerdoublegetLastTwoTargetBlocks(Set<Material> transparent, int maxDistance) @NotNull EntitygetLineOfSight(Set<Material> transparent, int maxDistance) doubleintint<T> TintintintintgetPotionEffect(@NotNull PotionEffectType type) intbooleanintfloat@Nullable BlockgetTargetBlock(int maxDistance, @NotNull TargetBlockInfo.FluidMode fluidMode) @NotNull BlockgetTargetBlock(Set<Material> transparent, int maxDistance) @Nullable BlockgetTargetBlockExact(int maxDistance) @Nullable BlockgetTargetBlockExact(int maxDistance, @NotNull FluidCollisionMode fluidCollisionMode) @Nullable BlockFacegetTargetBlockFace(int maxDistance, @NotNull TargetBlockInfo.FluidMode fluidMode) @Nullable BlockFacegetTargetBlockFace(int maxDistance, @NotNull FluidCollisionMode fluidMode) @Nullable TargetBlockInfogetTargetBlockInfo(int maxDistance, @NotNull TargetBlockInfo.FluidMode fluidMode) @Nullable EntitygetTargetEntity(int maxDistance, boolean ignoreBlocks) @Nullable TargetEntityInfogetTargetEntityInfo(int maxDistance, boolean ignoreBlocks) floatbooleanbooleanhasAI()booleanhasLineOfSight(@NotNull Location location) booleanhasLineOfSight(@NotNull Entity other) booleanhasPotionEffect(@NotNull PotionEffectType type) voidheal(double amount, EntityRegainHealthEvent.RegainReason regainReason) booleanbooleanbooleanisDead()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisValid()voidknockback(double strength, double directionX, double directionZ) <T extends Projectile>
TlaunchProjectile(@NotNull Class<? extends T> projectile) <T extends Projectile>
TlaunchProjectile(@NotNull Class<? extends T> projectile, @Nullable Vector velocity) <T extends Projectile>
TlaunchProjectile(@NotNull Class<? extends T> projectile, @Nullable Vector velocity, @Nullable Consumer<? super T> function) voidplayHurtAnimation(float yaw) voidplayPickupItemAnimation(@NotNull Item item, int quantity) @Nullable RayTraceResultrayTraceBlocks(double maxDistance) @Nullable RayTraceResultrayTraceBlocks(double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode) @Nullable RayTraceResultrayTraceEntities(int maxDistance, boolean ignoreBlocks) voidregisterAttribute(@NotNull Attribute attribute) voidremove()voidremovePotionEffect(@NotNull PotionEffectType type) voidvoidsetAbsorptionAmount(double amount) voidsetActiveItemRemainingTime(@org.jetbrains.annotations.Range(from=0L, to=2147483647L) int ticks) voidsetAI(boolean ai) voidsetArrowCooldown(int ticks) voidsetArrowsInBody(int count) voidsetArrowsInBody(int count, boolean fireEvent) voidsetArrowsStuck(int arrows) voidsetBeeStingerCooldown(int ticks) voidsetBeeStingersInBody(int count) voidsetBodyYaw(float bodyYaw) voidsetCanPickupItems(boolean pickup) voidsetClimbing(boolean climbing) Set whether this entity is climbing.voidsetCollidable(boolean collidable) voidsetFrictionState(@NotNull net.kyori.adventure.util.TriState state) voidsetGliding(boolean gliding) voidsetHealth(double health) voidsetHurtDirection(float hurtDirection) voidsetItemInUseTicks(int ticks) voidsetJumping(boolean jumping) voidvoidsetLastDamage(double damage) booleansetLeashHolder(Entity holder) voidsetMaxHealth(double health) voidsetMaximumAir(int ticks) voidsetMaximumNoDamageTicks(int ticks) <T> voidvoidsetNextArrowRemoval(@org.jetbrains.annotations.Range(from=0L, to=2147483647L) int i) voidsetNextBeeStingerRemoval(@org.jetbrains.annotations.Range(from=0L, to=2147483647L) int i) voidsetNoActionTicks(int ticks) voidsetNoDamageTicks(int ticks) voidsetRemainingAir(int ticks) voidsetRemoveWhenFarAway(boolean remove) voidsetRiptiding(boolean isRiptiding) voidsetShieldBlockingDelay(int delay) voidsetSleeping(boolean sleeping) Set whether this entity is slumbering.voidsetSwimming(boolean swimming) simulateDamage(double amount, @NotNull DamageSource source) Simulate damage to this entity and throw an event.simulateDamage(double amount, @Nullable Entity source) Simulate damage to this entity and throw an eventvoidstartUsingItem(@NotNull EquipmentSlot hand) voidvoidbooleanteleport(@NotNull Location location, @NotNull PlayerTeleportEvent.TeleportCause cause) Methods inherited from class be.seeseemelk.mockbukkit.entity.EntityMock
addAttachment, addAttachment, addAttachment, addAttachment, addPassenger, addScoreboardTag, asHoverEvent, assertLocation, assertNotTeleported, assertTeleported, broadcastHurtAnimation, clearMetadata, clearTeleported, collidesAt, copy, copy, createSnapshot, customName, customName, eject, equals, fromMobSpawner, getAsString, getBoundingBox, getChunk, getCustomName, getEffectivePermissions, getEntityId, getEntityProperty, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getMetadata, getName, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPersistentDataContainer, getPistonMoveReaction, getPitch, getPortalCooldown, getPose, getScheduler, getScoreboardEntry, getScoreboardEntryName, getScoreboardTags, getServer, getSpawnCategory, getSubType, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTeleportCause, getTicksLived, getTrackedBy, getTrackedPlayers, getTransitivePassengers, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, getX, getY, getYaw, getZ, hasFixedPose, hasGravity, hashCode, hasMetadata, hasNoPhysics, hasPassengers, hasPermission, hasPermission, hasTeleported, isCustomNameVisible, isEmpty, isFreezeTickingLocked, isFrozen, isGlowing, isInBubbleColumn, isInLava, isInPowderedSnow, isInRain, isInsideVehicle, isInvisible, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isInWorld, isOnGround, isOp, isPermissionSet, isPermissionSet, isPersistent, isSilent, isSneaking, isTicking, isUnderWater, isVisibleByDefault, isVisualFire, leaveVehicle, lockFreezeTicks, name, nextComponentMessage, playEffect, recalculatePermissions, remove, removeAttachment, removeMetadata, removePassenger, removeScoreboardTag, sendMessage, sendMessage, sendMessage, sendMessage, setCustomName, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvisible, setInvulnerable, setInWater, setLastDamageCause, setLocation, setMetadata, setName, setNoPhysics, setOnGround, setOp, setPassenger, setPersistent, setPortalCooldown, setPose, setRotation, setSilent, setSneaking, setSpawnReason, setTicksLived, setVelocity, setVisibleByDefault, setVisualFire, spawnAt, spawnAt, spigot, teamDisplayName, teleport, teleport, teleport, teleport, teleportAsync, teleportWithoutEvent, tick, wouldCollideUsingMethods inherited from class org.bukkit.command.CommandSender.Spigot
sendMessage, sendMessage, sendMessage, sendMessageMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.kyori.adventure.audience.Audience
clearResourcePacks, clearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, sendResourcePacks, sendTitlePart, showBossBar, showTitle, stopSound, stopSoundMethods inherited from interface org.bukkit.command.CommandSender
getName, name, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlainMessage, sendRichMessage, sendRichMessageMethods inherited from interface org.bukkit.entity.Damageable
healMethods inherited from interface org.bukkit.entity.Entity
addPassenger, addScoreboardTag, asHoverEvent, broadcastHurtAnimation, collidesAt, copy, copy, createSnapshot, eject, fromMobSpawner, getAsString, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPitch, getPortalCooldown, getPose, getScheduler, getScoreboardEntryName, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedBy, getTrackedPlayers, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, getX, getY, getYaw, getZ, hasFixedPose, hasGravity, hasNoPhysics, isCustomNameVisible, isEmpty, isFreezeTickingLocked, isFrozen, isGlowing, isInBubbleColumn, isInLava, isInPowderedSnow, isInRain, isInsideVehicle, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isInWorld, isOnGround, isPersistent, isSilent, isSneaking, isTicking, isUnderWater, isVisibleByDefault, isVisualFire, leaveVehicle, lockFreezeTicks, playEffect, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setNoPhysics, setPassenger, setPersistent, setPortalCooldown, setPose, setPose, setRotation, setSilent, setSneaking, setTicksLived, setVelocity, setVisibleByDefault, setVisualFire, spawnAt, spawnAt, spigot, teamDisplayName, teleport, teleport, teleport, teleport, teleport, teleportAsync, teleportAsync, teleportAsync, wouldCollideUsingMethods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEventMethods inherited from interface org.bukkit.entity.LivingEntity
getTargetBlock, getTargetBlockFace, getTargetBlockInfo, getTargetEntity, getTargetEntityInfo, isInvisible, playPickupItemAnimation, rayTraceEntities, setInvisible, swingHandMethods inherited from interface be.seeseemelk.mockbukkit.command.MessageTarget
assertNoMoreSaid, assertSaid, assertSaid, nextMessageMethods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.Nameable
customName, customName, getCustomName, setCustomNameMethods inherited from interface org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, permissionValue, permissionValue, recalculatePermissions, removeAttachmentMethods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainerMethods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom, pointersMethods inherited from interface org.bukkit.permissions.ServerOperator
isOp, setOp
-
Field Details
-
health
protected double healthHow much health the entity has. -
alive
protected boolean aliveWhether the entity is alive. -
attributes
The attributes this entity has.
-
-
Constructor Details
-
LivingEntityMock
- Parameters:
server- The server to create the entity on.uuid- The UUID of the entity.
-
-
Method Details
-
getHealth
public double getHealth()- Specified by:
getHealthin interfaceDamageable
-
remove
public void remove()- Specified by:
removein interfaceEntity- Overrides:
removein classEntityMock
-
isDead
public boolean isDead()- Specified by:
isDeadin interfaceEntity- Overrides:
isDeadin classEntityMock
-
isValid
public boolean isValid()- Specified by:
isValidin interfaceEntity- Overrides:
isValidin classEntityMock
-
setHealth
public void setHealth(double health) - Specified by:
setHealthin interfaceDamageable
-
getAbsorptionAmount
public double getAbsorptionAmount()- Specified by:
getAbsorptionAmountin interfaceDamageable
-
setAbsorptionAmount
public void setAbsorptionAmount(double amount) - Specified by:
setAbsorptionAmountin interfaceDamageable
-
getMaxHealth
public double getMaxHealth()- Specified by:
getMaxHealthin interfaceDamageable
-
setMaxHealth
public void setMaxHealth(double health) - Specified by:
setMaxHealthin interfaceDamageable
-
resetMaxHealth
public void resetMaxHealth()- Specified by:
resetMaxHealthin interfaceDamageable
-
damage
public void damage(double amount) - Specified by:
damagein interfaceDamageable
-
damage
- Specified by:
damagein interfaceDamageable
-
damage
- Specified by:
damagein interfaceDamageable
-
simulateDamage
Simulate damage to this entity and throw an event.- Parameters:
amount-The amount of damage to be done
source-The damager
- Returns:
The EntityDamageEvent that got thrown
-
simulateDamage
Simulate damage to this entity and throw an event- Parameters:
amount-The amount of damage to be done
source-The damager
- Returns:
The event that got thrown
-
getAttribute
- Specified by:
getAttributein interfaceAttributable
-
registerAttribute
- Specified by:
registerAttributein interfaceAttributable
-
launchProjectile
@NotNull public <T extends Projectile> T launchProjectile(@NotNull @NotNull Class<? extends T> projectile) - Specified by:
launchProjectilein interfaceProjectileSource
-
launchProjectile
@NotNull public <T extends Projectile> T launchProjectile(@NotNull @NotNull Class<? extends T> projectile, @Nullable @Nullable Vector velocity) - Specified by:
launchProjectilein interfaceProjectileSource
-
launchProjectile
@NotNull public <T extends Projectile> T launchProjectile(@NotNull @NotNull Class<? extends T> projectile, @Nullable @Nullable Vector velocity, @Nullable @Nullable Consumer<? super T> function) - Specified by:
launchProjectilein interfaceProjectileSource
-
startUsingItem
- Specified by:
startUsingItemin interfaceLivingEntity
-
getItemInUse
- Specified by:
getItemInUsein interfaceLivingEntity
-
getItemInUseTicks
public int getItemInUseTicks()- Specified by:
getItemInUseTicksin interfaceLivingEntity
-
setItemInUseTicks
public void setItemInUseTicks(int ticks) - Specified by:
setItemInUseTicksin interfaceLivingEntity
-
completeUsingActiveItem
public void completeUsingActiveItem()- Specified by:
completeUsingActiveItemin interfaceLivingEntity
-
getActiveItemRemainingTime
public int getActiveItemRemainingTime()- Specified by:
getActiveItemRemainingTimein interfaceLivingEntity
-
getEyeHeight
-
getEyeHeight
public double getEyeHeight(boolean ignorePose) - Specified by:
getEyeHeightin interfaceLivingEntity
-
getEyeHeight
public double getEyeHeight()- Specified by:
getEyeHeightin interfaceLivingEntity
-
getEntityState
Description copied from class:EntityMockGet the current state of this entity- Overrides:
getEntityStatein classEntityMock- Returns:
- The current state of this entity
-
setActiveItemRemainingTime
public void setActiveItemRemainingTime(@org.jetbrains.annotations.Range(from=0L, to=2147483647L) int ticks) - Specified by:
setActiveItemRemainingTimein interfaceLivingEntity
-
hasActiveItem
public boolean hasActiveItem()- Specified by:
hasActiveItemin interfaceLivingEntity
-
getActiveItemUsedTime
public int getActiveItemUsedTime()- Specified by:
getActiveItemUsedTimein interfaceLivingEntity
-
getActiveItemHand
- Specified by:
getActiveItemHandin interfaceLivingEntity
-
getEyeLocation
- Specified by:
getEyeLocationin interfaceLivingEntity
-
getLineOfSight
- Specified by:
getLineOfSightin interfaceLivingEntity
-
getTargetBlock
- Specified by:
getTargetBlockin interfaceLivingEntity
-
getTargetBlock
@Nullable public @Nullable Block getTargetBlock(int maxDistance, @NotNull TargetBlockInfo.FluidMode fluidMode) - Specified by:
getTargetBlockin interfaceLivingEntity
-
getTargetBlockFace
@Nullable public @Nullable BlockFace getTargetBlockFace(int maxDistance, @NotNull TargetBlockInfo.FluidMode fluidMode) - Specified by:
getTargetBlockFacein interfaceLivingEntity
-
getTargetBlockInfo
@Nullable public @Nullable TargetBlockInfo getTargetBlockInfo(int maxDistance, @NotNull TargetBlockInfo.FluidMode fluidMode) - Specified by:
getTargetBlockInfoin interfaceLivingEntity
-
getTargetEntity
- Specified by:
getTargetEntityin interfaceLivingEntity
-
getTargetEntityInfo
@Nullable public @Nullable TargetEntityInfo getTargetEntityInfo(int maxDistance, boolean ignoreBlocks) - Specified by:
getTargetEntityInfoin interfaceLivingEntity
-
getLastTwoTargetBlocks
@NotNull public @NotNull List<Block> getLastTwoTargetBlocks(Set<Material> transparent, int maxDistance) - Specified by:
getLastTwoTargetBlocksin interfaceLivingEntity
-
getTargetBlockExact
- Specified by:
getTargetBlockExactin interfaceLivingEntity
-
getTargetBlockExact
@Nullable public @Nullable Block getTargetBlockExact(int maxDistance, @NotNull @NotNull FluidCollisionMode fluidCollisionMode) - Specified by:
getTargetBlockExactin interfaceLivingEntity
-
rayTraceBlocks
- Specified by:
rayTraceBlocksin interfaceLivingEntity
-
rayTraceBlocks
@Nullable public @Nullable RayTraceResult rayTraceBlocks(double maxDistance, @NotNull @NotNull FluidCollisionMode fluidCollisionMode) - Specified by:
rayTraceBlocksin interfaceLivingEntity
-
getRemainingAir
public int getRemainingAir()- Specified by:
getRemainingAirin interfaceLivingEntity
-
setRemainingAir
public void setRemainingAir(int ticks) - Specified by:
setRemainingAirin interfaceLivingEntity
-
getMaximumAir
public int getMaximumAir()- Specified by:
getMaximumAirin interfaceLivingEntity
-
setMaximumAir
public void setMaximumAir(int ticks) - Specified by:
setMaximumAirin interfaceLivingEntity
-
getMaximumNoDamageTicks
public int getMaximumNoDamageTicks()- Specified by:
getMaximumNoDamageTicksin interfaceLivingEntity
-
setMaximumNoDamageTicks
public void setMaximumNoDamageTicks(int ticks) - Specified by:
setMaximumNoDamageTicksin interfaceLivingEntity
-
getLastDamage
public double getLastDamage()- Specified by:
getLastDamagein interfaceLivingEntity
-
setLastDamage
public void setLastDamage(double damage) - Specified by:
setLastDamagein interfaceLivingEntity
-
getNoDamageTicks
public int getNoDamageTicks()- Specified by:
getNoDamageTicksin interfaceLivingEntity
-
setNoDamageTicks
public void setNoDamageTicks(int ticks) - Specified by:
setNoDamageTicksin interfaceLivingEntity
-
getNoActionTicks
public int getNoActionTicks()- Specified by:
getNoActionTicksin interfaceLivingEntity
-
setNoActionTicks
public void setNoActionTicks(int ticks) - Specified by:
setNoActionTicksin interfaceLivingEntity
-
getKiller
- Specified by:
getKillerin interfaceLivingEntity
-
setKiller
- Specified by:
setKillerin interfaceLivingEntity
-
addPotionEffect
- Specified by:
addPotionEffectin interfaceLivingEntity
-
addPotionEffect
@Deprecated(since="1.15") public boolean addPotionEffect(@NotNull @NotNull PotionEffect effect, boolean force) Deprecated.- Specified by:
addPotionEffectin interfaceLivingEntity
-
addPotionEffect
public EntityPotionEffectEvent addPotionEffect(@NotNull @NotNull PotionEffect effect, EntityPotionEffectEvent.Cause cause) Adds a potion effect. If the event is canceled, no effect will be added.- Parameters:
effect- The Potion Effect to add.cause- The cause.- Returns:
- The event containing details about adding the potion effect.
-
addPotionEffects
public List<EntityPotionEffectEvent> addPotionEffects(@NotNull @NotNull Collection<PotionEffect> effects, EntityPotionEffectEvent.Cause cause) Adds multiple potion effects. If one event is canceled, the effect from that event won't be added.- Parameters:
effects- The Potion Effects to add.cause- The cause.- Returns:
- A list of events containing details about adding the potion effects.
-
addPotionEffects
- Specified by:
addPotionEffectsin interfaceLivingEntity
-
hasPotionEffect
- Specified by:
hasPotionEffectin interfaceLivingEntity
-
getPotionEffect
- Specified by:
getPotionEffectin interfaceLivingEntity
-
removePotionEffect
- Specified by:
removePotionEffectin interfaceLivingEntity
-
getActivePotionEffects
- Specified by:
getActivePotionEffectsin interfaceLivingEntity
-
clearActivePotionEffects
public boolean clearActivePotionEffects()- Specified by:
clearActivePotionEffectsin interfaceLivingEntity
-
hasLineOfSight
- Specified by:
hasLineOfSightin interfaceLivingEntity
-
hasLineOfSight
- Specified by:
hasLineOfSightin interfaceLivingEntity
-
getRemoveWhenFarAway
public boolean getRemoveWhenFarAway()- Specified by:
getRemoveWhenFarAwayin interfaceLivingEntity
-
setRemoveWhenFarAway
public void setRemoveWhenFarAway(boolean remove) - Specified by:
setRemoveWhenFarAwayin interfaceLivingEntity
-
getEquipment
- Specified by:
getEquipmentin interfaceLivingEntity
-
setCanPickupItems
public void setCanPickupItems(boolean pickup) - Specified by:
setCanPickupItemsin interfaceLivingEntity
-
getCanPickupItems
public boolean getCanPickupItems()- Specified by:
getCanPickupItemsin interfaceLivingEntity
-
teleport
public boolean teleport(@NotNull @NotNull Location location, @NotNull PlayerTeleportEvent.TeleportCause cause) - Specified by:
teleportin interfaceEntity- Overrides:
teleportin classEntityMock
-
isLeashed
public boolean isLeashed()- Specified by:
isLeashedin interfaceLivingEntity
-
getLeashHolder
- Specified by:
getLeashHolderin interfaceLivingEntity- Throws:
IllegalStateException
-
setLeashHolder
- Specified by:
setLeashHolderin interfaceLivingEntity
-
isGliding
public boolean isGliding()- Specified by:
isGlidingin interfaceLivingEntity
-
setGliding
public void setGliding(boolean gliding) - Specified by:
setGlidingin interfaceLivingEntity
-
isSwimming
public boolean isSwimming()- Specified by:
isSwimmingin interfaceLivingEntity
-
setSwimming
public void setSwimming(boolean swimming) - Specified by:
setSwimmingin interfaceLivingEntity
-
isRiptiding
public boolean isRiptiding()- Specified by:
isRiptidingin interfaceLivingEntity
-
setRiptiding
public void setRiptiding(boolean isRiptiding) - Specified by:
setRiptidingin interfaceLivingEntity
-
setSleeping
public void setSleeping(boolean sleeping) Set whether this entity is slumbering.- Parameters:
sleeping- If this entity is slumbering
-
isSleeping
public boolean isSleeping()- Specified by:
isSleepingin interfaceLivingEntity
-
setClimbing
public void setClimbing(boolean climbing) Set whether this entity is climbing.- Parameters:
climbing- If this entity is climbing
-
isClimbing
public boolean isClimbing()- Specified by:
isClimbingin interfaceLivingEntity
-
setAI
public void setAI(boolean ai) - Specified by:
setAIin interfaceLivingEntity
-
hasAI
public boolean hasAI()- Specified by:
hasAIin interfaceLivingEntity
-
attack
- Specified by:
attackin interfaceLivingEntity
-
swingMainHand
public void swingMainHand()- Specified by:
swingMainHandin interfaceLivingEntity
-
swingOffHand
public void swingOffHand()- Specified by:
swingOffHandin interfaceLivingEntity
-
playHurtAnimation
public void playHurtAnimation(float yaw) - Specified by:
playHurtAnimationin interfaceLivingEntity
-
setCollidable
public void setCollidable(boolean collidable) - Specified by:
setCollidablein interfaceLivingEntity
-
isCollidable
public boolean isCollidable()- Specified by:
isCollidablein interfaceLivingEntity
-
getCollidableExemptions
- Specified by:
getCollidableExemptionsin interfaceLivingEntity
-
getMemory
- Specified by:
getMemoryin interfaceLivingEntity
-
setMemory
- Specified by:
setMemoryin interfaceLivingEntity
-
getHurtSound
- Specified by:
getHurtSoundin interfaceLivingEntity
-
getDeathSound
- Specified by:
getDeathSoundin interfaceLivingEntity
-
getFallDamageSound
- Specified by:
getFallDamageSoundin interfaceLivingEntity
-
getFallDamageSoundSmall
- Specified by:
getFallDamageSoundSmallin interfaceLivingEntity
-
getFallDamageSoundBig
- Specified by:
getFallDamageSoundBigin interfaceLivingEntity
-
getDrinkingSound
- Specified by:
getDrinkingSoundin interfaceLivingEntity
-
getEatingSound
- Specified by:
getEatingSoundin interfaceLivingEntity
-
canBreatheUnderwater
public boolean canBreatheUnderwater()- Specified by:
canBreatheUnderwaterin interfaceLivingEntity
-
getCategory
- Specified by:
getCategoryin interfaceLivingEntity
-
setArrowsInBody
public void setArrowsInBody(int count) - Specified by:
setArrowsInBodyin interfaceLivingEntity
-
getBeeStingerCooldown
public int getBeeStingerCooldown()- Specified by:
getBeeStingerCooldownin interfaceLivingEntity
-
setBeeStingerCooldown
public void setBeeStingerCooldown(int ticks) - Specified by:
setBeeStingerCooldownin interfaceLivingEntity
-
getBeeStingersInBody
public int getBeeStingersInBody()- Specified by:
getBeeStingersInBodyin interfaceLivingEntity
-
setBeeStingersInBody
public void setBeeStingersInBody(int count) - Specified by:
setBeeStingersInBodyin interfaceLivingEntity
-
setNextArrowRemoval
public void setNextArrowRemoval(@org.jetbrains.annotations.Range(from=0L, to=2147483647L) int i) - Specified by:
setNextArrowRemovalin interfaceLivingEntity
-
getNextArrowRemoval
public int getNextArrowRemoval()- Specified by:
getNextArrowRemovalin interfaceLivingEntity
-
setNextBeeStingerRemoval
public void setNextBeeStingerRemoval(@org.jetbrains.annotations.Range(from=0L, to=2147483647L) int i) - Specified by:
setNextBeeStingerRemovalin interfaceLivingEntity
-
getNextBeeStingerRemoval
public int getNextBeeStingerRemoval()- Specified by:
getNextBeeStingerRemovalin interfaceLivingEntity
-
getArrowsInBody
public int getArrowsInBody()- Specified by:
getArrowsInBodyin interfaceLivingEntity
-
setArrowCooldown
public void setArrowCooldown(int ticks) - Specified by:
setArrowCooldownin interfaceLivingEntity
-
getArrowCooldown
public int getArrowCooldown()- Specified by:
getArrowCooldownin interfaceLivingEntity
-
getArrowsStuck
public int getArrowsStuck()- Specified by:
getArrowsStuckin interfaceLivingEntity
-
setArrowsStuck
public void setArrowsStuck(int arrows) - Specified by:
setArrowsStuckin interfaceLivingEntity
-
getShieldBlockingDelay
public int getShieldBlockingDelay()- Specified by:
getShieldBlockingDelayin interfaceLivingEntity
-
setShieldBlockingDelay
public void setShieldBlockingDelay(int delay) - Specified by:
setShieldBlockingDelayin interfaceLivingEntity
-
getActiveItem
- Specified by:
getActiveItemin interfaceLivingEntity
-
clearActiveItem
public void clearActiveItem()- Specified by:
clearActiveItemin interfaceLivingEntity
-
getItemUseRemainingTime
public int getItemUseRemainingTime()- Specified by:
getItemUseRemainingTimein interfaceLivingEntity
-
getHandRaisedTime
public int getHandRaisedTime()- Specified by:
getHandRaisedTimein interfaceLivingEntity
-
isHandRaised
public boolean isHandRaised()- Specified by:
isHandRaisedin interfaceLivingEntity
-
getHandRaised
- Specified by:
getHandRaisedin interfaceLivingEntity
-
isJumping
public boolean isJumping()- Specified by:
isJumpingin interfaceLivingEntity
-
setJumping
public void setJumping(boolean jumping) - Specified by:
setJumpingin interfaceLivingEntity
-
playPickupItemAnimation
- Specified by:
playPickupItemAnimationin interfaceLivingEntity
-
getHurtDirection
public float getHurtDirection()- Specified by:
getHurtDirectionin interfaceLivingEntity
-
setHurtDirection
public void setHurtDirection(float hurtDirection) - Specified by:
setHurtDirectionin interfaceLivingEntity
-
knockback
public void knockback(double strength, double directionX, double directionZ) - Specified by:
knockbackin interfaceLivingEntity
-
broadcastSlotBreak
- Specified by:
broadcastSlotBreakin interfaceLivingEntity
-
broadcastSlotBreak
public void broadcastSlotBreak(@NotNull @NotNull EquipmentSlot slot, @NotNull @NotNull Collection<Player> players) - Specified by:
broadcastSlotBreakin interfaceLivingEntity
-
damageItemStack
- Specified by:
damageItemStackin interfaceLivingEntity
-
damageItemStack
- Specified by:
damageItemStackin interfaceLivingEntity
-
getFrictionState
@NotNull public @NotNull net.kyori.adventure.util.TriState getFrictionState()- Specified by:
getFrictionStatein interfaceFrictional
-
setFrictionState
public void setFrictionState(@NotNull @NotNull net.kyori.adventure.util.TriState state) - Specified by:
setFrictionStatein interfaceFrictional
-
getTargetBlockFace
@Nullable public @Nullable BlockFace getTargetBlockFace(int maxDistance, @NotNull @NotNull FluidCollisionMode fluidMode) - Specified by:
getTargetBlockFacein interfaceLivingEntity
-
rayTraceEntities
- Specified by:
rayTraceEntitiesin interfaceLivingEntity
-
setArrowsInBody
public void setArrowsInBody(int count, boolean fireEvent) - Specified by:
setArrowsInBodyin interfaceLivingEntity
-
getBodyYaw
public float getBodyYaw()- Specified by:
getBodyYawin interfaceLivingEntity
-
setBodyYaw
public void setBodyYaw(float bodyYaw) - Specified by:
setBodyYawin interfaceLivingEntity
-
getForwardsMovement
public float getForwardsMovement()- Specified by:
getForwardsMovementin interfaceLivingEntity
-
getUpwardsMovement
public float getUpwardsMovement()- Specified by:
getUpwardsMovementin interfaceLivingEntity
-
getSidewaysMovement
public float getSidewaysMovement()- Specified by:
getSidewaysMovementin interfaceLivingEntity
-
heal
- Specified by:
healin interfaceDamageable
-
canUseEquipmentSlot
- Specified by:
canUseEquipmentSlotin interfaceLivingEntity
-