程序包 org.bukkit.entity

# 接口 Allay

所有超级接口:
  `Attributable`, `CommandSender`, `Creature`, `Damageable`, `Entity`, `InventoryHolder`, `LivingEntity`, `Lootable`, `Metadatable`, `Mob`, `Nameable`, `Permissible`, `PersistentDataHolder`, `ProjectileSource`, `ServerOperator`

public interface Allay extends Creature, InventoryHolder
An Allay.

- ## 嵌套类概要

  ## 从接口继承的嵌套类/接口 org.bukkit.entity.Entity

  `Entity.Spigot`

- ## 方法概要

  修饰符和类型
  方法
  说明
  `boolean`
  `canDuplicate()`
  Gets if the allay can duplicate.
  `@Nullable Allay`
  `duplicateAllay()`
  This make the current allay duplicate itself without dance or item necessary.
  `long`
  `getDuplicationCooldown()`
  Gets the cooldown for duplicating the allay.
  `@Nullable Location`
  `getJukebox()`
  Gets the jukebox the allay is set to dance to.
  `boolean`
  `isDancing()`
  Gets if the allay is dancing.
  `void`
  `resetDuplicationCooldown()`
  Reset the cooldown for duplication.
  `void`
  `setCanDuplicate(boolean canDuplicate)`
  Sets if the allay can duplicate.
  `void`
  `setDuplicationCooldown(long cooldown)`
  Sets the cooldown before the allay can duplicate again.
  `void`
  `startDancing()`
  Force sets the dancing status of the allay.
  `void`
  `startDancing(@NotNull Location location)`
  Causes the allay to start dancing because of the provided jukebox location.
  `void`
  `stopDancing()`
  Makes the allay stop dancing.

  ### 从接口继承的方法 org.bukkit.attribute.Attributable

  `getAttribute`

  ### 从接口继承的方法 org.bukkit.command.CommandSender

  `getName, sendMessage, sendMessage, sendMessage, sendMessage`

  ### 从接口继承的方法 org.bukkit.entity.Damageable

  `damage, damage, damage, getAbsorptionAmount, getHealth, getMaxHealth, resetMaxHealth, setAbsorptionAmount, setHealth, setMaxHealth`

  ### 从接口继承的方法 org.bukkit.entity.Entity

  `addPassenger, addScoreboardTag, copy, copy, createSnapshot, eject, getAsString, getBoundingBox, getEntityId, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedBy, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isFrozen, isGlowing, isInsideVehicle, isInvulnerable, isInWater, isInWorld, isOnGround, isPersistent, isSilent, isValid, isVisibleByDefault, isVisualFire, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, setVisibleByDefault, setVisualFire, spigot, teleport, teleport, teleport, teleport`

  ### 从接口继承的方法 org.bukkit.inventory.InventoryHolder

  `getInventory`

  ### 从接口继承的方法 org.bukkit.entity.LivingEntity

  `addPotionEffect, addPotionEffect, addPotionEffects, attack, canBreatheUnderwater, getActivePotionEffects, getArrowCooldown, getArrowsInBody, getCanPickupItems, getCategory, getCollidableExemptions, getDeathSound, getDrinkingSound, getEatingSound, getEquipment, getEyeHeight, getEyeHeight, getEyeLocation, getFallDamageSound, getFallDamageSoundBig, getFallDamageSoundSmall, getHurtSound, getItemInUse, getItemInUseTicks, getKiller, getLastDamage, getLastTwoTargetBlocks, getLeashHolder, getLineOfSight, getMaximumAir, getMaximumNoDamageTicks, getMemory, getNoActionTicks, getNoDamageTicks, getPotionEffect, getRemainingAir, getRemoveWhenFarAway, getTargetBlock, getTargetBlockExact, getTargetBlockExact, hasAI, hasLineOfSight, hasPotionEffect, isClimbing, isCollidable, isGliding, isInvisible, isLeashed, isRiptiding, isSleeping, isSwimming, playHurtAnimation, rayTraceBlocks, rayTraceBlocks, removePotionEffect, setAI, setArrowCooldown, setArrowsInBody, setCanPickupItems, setCollidable, setGliding, setInvisible, setItemInUseTicks, setLastDamage, setLeashHolder, setMaximumAir, setMaximumNoDamageTicks, setMemory, setNoActionTicks, setNoDamageTicks, setRemainingAir, setRemoveWhenFarAway, setSwimming, swingMainHand, swingOffHand`

  ### 从接口继承的方法 org.bukkit.loot.Lootable

  `getLootTable, getSeed, setLootTable, setSeed`

  ### 从接口继承的方法 org.bukkit.metadata.Metadatable

  `getMetadata, hasMetadata, removeMetadata, setMetadata`

  ### 从接口继承的方法 org.bukkit.entity.Mob

  `getAmbientSound, getTarget, isAware, setAware, setTarget`

  ### 从接口继承的方法 org.bukkit.Nameable

  `getCustomName, setCustomName`

  ### 从接口继承的方法 org.bukkit.permissions.Permissible

  `addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment`

  ### 从接口继承的方法 org.bukkit.persistence.PersistentDataHolder

  `getPersistentDataContainer`

  ### 从接口继承的方法 org.bukkit.projectiles.ProjectileSource

  `launchProjectile, launchProjectile`

  ### 从接口继承的方法 org.bukkit.permissions.ServerOperator

  `isOp, setOp`

- ## 方法详细资料

  - ### canDuplicate

    boolean canDuplicate()
    Gets if the allay can duplicate.
    Note: Duplication is based when the `getDuplicationCooldown()` its lower than zero.
    返回:
      if the allay can duplicate itself.

  - ### setCanDuplicate

    void setCanDuplicate(boolean canDuplicate)
    Sets if the allay can duplicate.
    Note: this value can be overridden later by `getDuplicationCooldown()` if is lower than zero. You can also use `setDuplicationCooldown(long)` to allow the allay to duplicate
    参数:
      `canDuplicate` - if the allay can duplicate itself

  - ### getDuplicationCooldown

    long getDuplicationCooldown()
    Gets the cooldown for duplicating the allay.
    返回:
      the time in ticks when allay can duplicate

  - ### setDuplicationCooldown

    void setDuplicationCooldown(long cooldown)
    Sets the cooldown before the allay can duplicate again.
    参数:
      `cooldown` - the cooldown, use a negative number to deny allay to duplicate again.

  - ### resetDuplicationCooldown

    void resetDuplicationCooldown()
    Reset the cooldown for duplication. This will set the cooldown ticks to the same value as is set after an Allay has duplicated.

  - ### isDancing

    boolean isDancing()
    Gets if the allay is dancing.
    返回:
      `True` if it is dancing, false otherwise.

  - ### startDancing

    void startDancing(@NotNull @NotNull Location location)
    Causes the allay to start dancing because of the provided jukebox location.
    参数:
      `location` - the location of the jukebox
    抛出:
      `IllegalArgumentException` - if the block at the location is not a jukebox

  - ### startDancing

    void startDancing()
    Force sets the dancing status of the allay.
    Note: This method forces the allay to dance, ignoring any nearby jukebox being required.

  - ### stopDancing

    void stopDancing()
    Makes the allay stop dancing.

  - ### duplicateAllay

    @Nullable @Nullable Allay duplicateAllay()
    This make the current allay duplicate itself without dance or item necessary. Note: this will fire a `CreatureSpawnEvent`
    返回:
      the new entity `Allay` or null if the spawn was cancelled

  - ### getJukebox

    @Nullable @Nullable Location getJukebox()
    Gets the jukebox the allay is set to dance to.
    返回:
      the location of the jukebox to dance if it exists