Skip to content

Commit

Permalink
spawn particles
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaupenjoe committed Jan 30, 2025
1 parent c5188ca commit 27a3761
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import net.kaupenjoe.tutorialmod.sound.ModSounds;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.core.particles.BlockParticleOption;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvents;
Expand Down Expand Up @@ -51,6 +53,14 @@ public InteractionResult useOn(UseOnContext context) {

level.playSound(null, context.getClickedPos(), ModSounds.CHISEL_USE.get(), SoundSource.BLOCKS);

((ServerLevel) level).sendParticles(new BlockParticleOption(ParticleTypes.BLOCK, clickedBlock.defaultBlockState()),
context.getClickedPos().getX() + 0.5, context.getClickedPos().getY() + 1.0,
context.getClickedPos().getZ() + 0.5, 5, 0, 0, 0, 1);

((ServerLevel) level).sendParticles(ParticleTypes.DOLPHIN,
context.getClickedPos().getX() + 0.5, context.getClickedPos().getY() + 1.5,
context.getClickedPos().getZ() + 0.5, 5, 0, 0, 0, 3);

context.getItemInHand().set(ModDataComponents.COORDINATES, context.getClickedPos());
}
}
Expand Down

0 comments on commit 27a3761

Please sign in to comment.