mojira.dev
MC-257861

Villagers and Piglin no longer seek out Items

The bug

Villagers are no longer able to explicitly walk towards their wanted items.

The same goes for Piglin admiring items.

To reproduce

  1. Summon a piglin.

  2. Ensure the mobGriefing gamerule is true.

  3. Throw gold items at the piglin.

Expected result

The piglin would play the admiring sound and go pick up the gold item.

Observed result

The piglin ignores the item, and only plays the admiring sound.

Code analysis

This is caused by changes to the GoToWantedItem Behavior. It includes a check for item pickup cooldowns using MemoryModuleType.ITEM_PICKUP_COOLDOWN_TICKS for use by the allay AI.

The actual issue stems from the BehaviorBuilder refactor and using instance.registered(MemoryModuleType.ITEM_PICKUP_COOLDOWN_TICKS) in GoToWantedItem. This memory module is not registered for Villagers and Piglin causing the Behavior to never run.

Comments 0

No comments.

andre111_

Felix Jones

Confirmed

Platform

Very Important

Mob behaviour

22w46a, 1.19.3 Pre-release 2

1.19.3 Pre-release 3

Retrieved