Skip to content

Commit

Permalink
make golden head eat sound play for all players
Browse files Browse the repository at this point in the history
  • Loading branch information
Inf1nityy committed Dec 27, 2024
1 parent 63b9294 commit ca2f157
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.nexia.nexus.api.world.types.Minecraft;
import com.nexia.nexus.builder.implementation.world.effect.WrappedStatusEffectInstance;
import com.nexia.nexus.builder.implementation.world.item.WrappedItemStack;
import net.minecraft.core.BlockPos;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.effect.MobEffectInstance;
Expand All @@ -24,7 +25,7 @@ private void eatGoldenHead(NexiaPlayer player, ItemStack itemStack) {
player.addEffectInstance(new WrappedStatusEffectInstance(new MobEffectInstance(MobEffects.MOVEMENT_SPEED, 100)));
player.addEffectInstance(new WrappedStatusEffectInstance(new MobEffectInstance(MobEffects.ABSORPTION, 2400, 1)));
player.addEffectInstance(new WrappedStatusEffectInstance(new MobEffectInstance(MobEffects.REGENERATION, 100, 2)));
player.unwrap().playNotifySound(SoundEvents.PLAYER_BURP, SoundSource.PLAYERS, 0.5F, new Random().nextFloat() * 0.1F + 0.9F);
player.unwrap().level.playSound(null, new BlockPos(player.unwrap().position()), SoundEvents.PLAYER_BURP, SoundSource.PLAYERS, 0.5F, new Random().nextFloat() * 0.1F + 0.9F);

player.unwrap().getCooldowns().addCooldown(((WrappedItemStack) itemStack).unwrap().getItem(), 240);
if (!player.unwrap().isCreative()) itemStack.decrementCount();
Expand Down

0 comments on commit ca2f157

Please sign in to comment.