diff --git a/src/entity/Living.php b/src/entity/Living.php index a6902ae69..e695ba425 100644 --- a/src/entity/Living.php +++ b/src/entity/Living.php @@ -158,7 +158,7 @@ abstract class Living extends Entity{ } }; $this->armorInventory->getListeners()->add(new CallbackInventoryListener( - function(Inventory $inventory, int $slot, Item $oldItem) : void{ + function(Inventory $inventory, int $slot, Item $oldItem) use ($playArmorSound) : void{ $playArmorSound($inventory->getItem($slot), $oldItem); }, function(Inventory $inventory, array $oldContents) use ($playArmorSound) : void{