diff --git a/CHANGELOG.md b/CHANGELOG.md index aa9f73f..28ab4fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [1.20.2-2.4.0.3] - 2023-11-04 ### Fixed - MobBucketItems with non-bucketable entities were added to creative menu (found in Naturalist mod 4.0) +- milk bucket effect curing was triggered before advancement trigger (see https://github.com/neoforged/NeoForge/pull/170) ## [1.20.2-2.4.0.2] - 2023-10-30 ### Fixed diff --git a/src/main/java/cech12/bucketlib/api/item/UniversalBucketItem.java b/src/main/java/cech12/bucketlib/api/item/UniversalBucketItem.java index 14f812c..a93457a 100644 --- a/src/main/java/cech12/bucketlib/api/item/UniversalBucketItem.java +++ b/src/main/java/cech12/bucketlib/api/item/UniversalBucketItem.java @@ -386,13 +386,13 @@ private InteractionResult pickupEntityWith @Override @Nonnull public ItemStack finishUsingItem(@Nonnull ItemStack itemStack, @Nonnull Level level, @Nonnull LivingEntity player) { - if (!level.isClientSide) { - player.curePotionEffects(new ItemStack(Items.MILK_BUCKET)); - } if (player instanceof ServerPlayer serverPlayer) { CriteriaTriggers.CONSUME_ITEM.trigger(serverPlayer, new ItemStack(Items.MILK_BUCKET)); serverPlayer.awardStat(Stats.ITEM_USED.get(Items.MILK_BUCKET)); } + if (!level.isClientSide) { + player.curePotionEffects(new ItemStack(Items.MILK_BUCKET)); + } if (BucketLibUtil.notCreative(player)) { return BucketLibUtil.removeMilk(itemStack); }