Because there are a finite, limited number of Allay mobs in a survival world, and because having lots of mobs in an area causes lag, and because a single Allay can only search for a single item at any given time, it seems to me that it would be better if fewer Allay, or even a single Allay, could be used to gather multiple items. Not necessarily many different items at once, but one type of item at a time and have a way to automatically change the item which the Allay seeks.
To accomplish this, we add a new dispenser feature:
First, the Allay must be in front of a dispenser, and that dispenser must have a special item in it. The special item needs either the Allay's owner's name or UUID in the item's NBT, or the Allay's UUID in it's NBT.
When that dispenser is activated, the Allay will try to put it's held item into the dispenser. The Allay will no longer be holding anything, and will be ready to accept a different item. If the dispenser was full, the item will be dropped as an entity, with a several second pickup delay, which the Allay should respect. In any case, the special item stays in the dispenser, without being consumed.
After this, the next time that Allay comes in contact with an item, that touched item will become it's new held item. If it has items in it's inventory which don't match, those are immediately thrown in the direction of it's note block or owner.
To make the special item, the player makes a Book & Quill, leaves the body of the book empty, signs it with his own name[1], and titles "Allay"]2] then uses it on his Allay. Either the Book & Quill becomes the special item, or the Book & Quill is the special item, and the Allay write's it's own UUID into the book's body.
[1] On Java, ignore this. [2] Any of the following titles should work: Whatever Allay localizes to in the player's language, or "minecraft:allay" or that Allay's particular name, if it's been renamed with a nametag.
Because there are a finite, limited number of Allay mobs in a survival world, and because having lots of mobs in an area causes lag, and because a single Allay can only search for a single item at any given time, it seems to me that it would be better if fewer Allay, or even a single Allay, could be used to gather multiple items. Not necessarily many different items at once, but one type of item at a time and have a way to automatically change the item which the Allay seeks.
To accomplish this, we add a new dispenser feature:
First, the Allay must be in front of a dispenser, and that dispenser must have a special item in it. The special item needs either the Allay's owner's name or UUID in the item's NBT, or the Allay's UUID in it's NBT.
When that dispenser is activated, the Allay will try to put it's held item into the dispenser. The Allay will no longer be holding anything, and will be ready to accept a different item. If the dispenser was full, the item will be dropped as an entity, with a several second pickup delay, which the Allay should respect. In any case, the special item stays in the dispenser, without being consumed.
After this, the next time that Allay comes in contact with an item, that touched item will become it's new held item. If it has items in it's inventory which don't match, those are immediately thrown in the direction of it's note block or owner.
To make the special item, the player makes a Book & Quill, leaves the body of the book empty, signs it with his own name[1], and titles "Allay"]2] then uses it on his Allay. Either the Book & Quill becomes the special item, or the Book & Quill is the special item, and the Allay write's it's own UUID into the book's body.
[1] On Java, ignore this. [2] Any of the following titles should work: Whatever Allay localizes to in the player's language, or "minecraft:allay" or that Allay's particular name, if it's been renamed with a nametag.