Can confirm in 26.1 snap9
In SimpleContainer has:
public ItemStack removeItem(final int slot, final int count) {
ItemStack result = ContainerHelper.removeItem(this.items, slot, count);
if (!result.isEmpty()) {
this.setChanged();
}
return result;
}And in HopperBlockEntity
private static boolean tryTakeInItemFromSlot(final Hopper hopper, final Container container, final int slot, final Direction direction) {
ItemStack itemStack = container.getItem(slot);
if (!itemStack.isEmpty() && canTakeItemFromContainer(hopper, container, itemStack, slot, direction)) {
int originalCount = itemStack.getCount();
ItemStack result = addItem(container, hopper, container.removeItem(slot, 1), null);
if (result.isEmpty()) {
container.setChanged();
return true;
}Even if addItem(...) fails, simply calling it ends up calling removeItem(...) which calls this.setChanged().
The setChanged() empties the composter (in ComposterBlock.OutputContainer):
public void setChanged() {
ComposterBlock.empty(null, this.state, this.level, this.pos);
this.changed = true;
}If the hopper is full (inventoryFull()), this doesn't happen because tryTakeInItemFromSlot(...)is not called.
The same thing happens when feeding a panda an item that is not in #panda_eats_from_ground. This significantly affects data packs with items in #panda_food that are not in #panda_eats_from_ground.
See https://minecraft.wiki/w/Item_tag_(Java_Edition)#panda_eats_from_ground%5D for a detailed explanation of the behavior.
This could be solved simply by removing the tag's condition from Panda.handleEating() on the line:
if (this.getEatCounter() > 100 && this.getItemBySlot(EquipmentSlot.MAINHAND).is(ItemTags.PANDA_EATS_FROM_GROUND)) {
Based on the code analysis, it's only possible if:
The villager is sleeping
The villager is making is trading
Or, the item is a
villager_spawn_eggIt's also necessary that the item doesn't have any other effect when interacting with the villager. For example, if it's a villager spawn egg by default, it will summon a baby villager, but it's possible to remove
minecraft:entity_data.Try using, for example: