Interface Bat

All Superinterfaces:
Ambient, Attributable, Audience, CommandSender, Damageable, Entity, Frictional, HoverEventSource<HoverEvent.ShowEntity>, Leashable, LivingEntity, Lootable, Metadatable, Mob, Nameable, Permissible, PersistentDataHolder, PersistentDataViewHolder, Pointered, ProjectileSource, ServerOperator, Sound.Emitter

public interface Bat extends Ambient
Represents a Bat
  • Method Details

    • isAwake

      boolean isAwake()
      Checks the current waking state of this bat.

      This does not imply any persistence of state past the method call.

      Returns:
      true if the bat is awake or false if it is currently hanging from a block
    • setAwake

      void setAwake(boolean state)
      This method modifies the current waking state of this bat.

      This does not prevent a bat from spontaneously awaking itself, or from reattaching itself to a block.

      Parameters:
      state - the new state
    • getTargetLocation

      @Nullable Location getTargetLocation()
      Gets the location that this bat is currently trying to move towards.
      Returns:
      target location, or null if it's going to find a new location
    • setTargetLocation

      void setTargetLocation(@Nullable Location location)
      Sets the location that this bat is currently trying to move towards.

      This can be set to null to cause the bat to recalculate its target location

      Parameters:
      location - location to move towards (world is ignored, will always use the entity's world)