Skip to content

Commit

Permalink
Update MobBottleItem.java
Browse files Browse the repository at this point in the history
  • Loading branch information
AViewFromTheTop committed Jan 31, 2025
1 parent b8de7c3 commit ca770e6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import net.minecraft.core.component.DataComponents;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundSource;
import net.minecraft.stats.Stats;
import net.minecraft.util.Mth;
import net.minecraft.world.InteractionHand;
Expand Down Expand Up @@ -79,7 +80,7 @@ public InteractionResult use(@NotNull Level level, @NotNull Player player, @NotN

if (!player.getAbilities().instabuild) player.setItemInHand(interactionHand, ItemUtils.createFilledResult(stack, player, new ItemStack(Items.GLASS_BOTTLE)));
player.awardStat(Stats.ITEM_USED.get(stack.getItem()));
player.playSound(this.releaseSound, 0.75F, level.getRandom().nextFloat() * 0.2F + 0.9F);
level.playSound(player, player.getX(), player.getEyeY(), player.getZ(), this.releaseSound, SoundSource.NEUTRAL, 0.75F, level.getRandom().nextFloat() * 0.2F + 0.9F);
if (stack.has(DataComponents.CUSTOM_NAME)) {
entity.setCustomName(stack.getHoverName());
}
Expand Down

0 comments on commit ca770e6

Please sign in to comment.