Allay

The allay is a flying passive mob that collects and delivers items for any player that gives it something or any note block it hears recently playing.

Spawning
Allays can be found surrounding pillager outposts, confined inside dark oak cages. One to three allays can spawn in each cage. They spawn here with a 50% chance. Allays can also spawn inside jail cells within woodland mansions. One to three allays can spawn in each cell. They spawn here with a 50% chance.

Behavior
The allay's luminous texture allows it to be seen clearly in the dark, although it doesn't illuminate its surroundings.

The allay is small, peaceful and flies aimlessly until a player gives it an item with their key. The allay starts following the player and seeks out dropped versions of the same item to deliver them to its player. The allay returns to wandering around if any player takes its item back by an empty hand on it.

The allay locks onto the player that last gave it an item. This allay follows the player from up to a 64-block cubic area away and seeks items up to a 32-block cubic are away from the player. After delivering items, the allay has a delay of three seconds until it can seek items again. An allay has a single inventory slot to hold a stack of items (usually 64 items) in addition to the item it got from the player. While the allay does not discern enchantments, special item names or items in shulker boxes when it seeks, it still carries such items in separate trips.

Allays don't pick up any items if the game rule if set to, but the player can still give the allay items with the  key.

If the allay hears a note block play within 16 blocks of its location while delivering items, it will instead deliver its items to the note block and then spend 30 seconds around that particular note block, seeking items around it and returning them to it instead of its player. The allay returns to targeting its player after 30 seconds. A vibration particle emanates from the note block and reaches the allay to indicate the allay has locked on to the note block. Because the allay and the note block interact via a vibration particle, placing wool between the note block and the allay can prevent this sound interaction.

The allay can pick up items within a radius of about 1.3 blocks from itself and drop items up to 3 blocks away from its player or note block.

An allay performs a dance animation when there is a nearby jukebox playing. If the jukebox stops playing or if the allay gets too far away from the jukebox, it stops dancing. If the allay is given an amethyst shard while dancing, it plays a small amethyst sound, makes a heart animation and duplicates into another allay. After that duplication, both allays have a five minute cooldown before being able to duplicate again.

The allay cannot enter water, although it attempts to gather items that are under water.

Allays cannot be harmed by their interacted owners. If they are harmed by another source, they fly away for a few seconds. When killed, allays drop the items they were holding. If an allay dies while holding a totem of undying, it instead returns to full health and the totem is destroyed, as with any mob holding a totem of undying. Allays naturally regenerate per second if damaged.

In Java Edition, a lead or a named name tag performs the item's normal function, instead of giving it to the allay.

Teleportation
When a player teleports through a nether portal, the player's allay teleports also, even if it does not enter the portal.

When a player teleports through an end portal, the allay teleports to the End only if a player gives the allay an item before teleporting and must be nearby the player as they teleport.

Allays holding an item follow the player through a portal if they are 21 blocks horizontally to the player or if they are within 22 blocks vertically of the player's legs. Allays do not travel through portals regardless of how close they are if they are tethered to a fence with a lead.

Sounds

 * Allays use the Friendly Creatures sound category for entity-dependent sound events.



ID




Entity data
Allays have entity data associated with them that contain various properties.




 * See Bedrock Edition level format/Entity format.
 * See Bedrock Edition level format/Entity format.

Trivia

 * The allay was originally planned for the Nether Update.
 * Some previous names considered for the allay were the wisp and the pixie.
 * The allays were created to solve the problem of how players would build structures and collect resources in Minecraft Legends while focusing on defending the overworld.
 * The reason why allay duplication uses amethyst shards is because the item is renewable, has a musical sound that fits with the allay, and it adds more value to amethyst geodes.
 * According to the "meet the allay" article on Minecraft.net, the reason why allays can be tamed by players is because they form a "magical connection" when that player gives it an item. This bond is what prevents players from accidentally harming their allay.
 * Originally, Mojang considered having allays naturally spawn within forest biomes. However, the reason they went with pillager outposts and woodland mansions, was because they wanted to highlight the companionship aspect.
 * Despite that they are flying mobs, allays can destroy turtle eggs when on top of them.