Interface Allay

All Superinterfaces:
Attributable, CommandSender, Creature, Damageable, Entity, InventoryHolder, LivingEntity, Lootable, Metadatable, Mob, Nameable, Permissible, PersistentDataHolder, ProjectileSource, ServerOperator

public interface Allay extends Creature, InventoryHolder
An Allay.
  • Method Details

    • 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 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 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 Location getJukebox()
      Gets the jukebox the allay is set to dance to.
      the location of the jukebox to dance if it exists