Skip to content

Commit 27a3761

Browse files
KaupenjoeKaupenjoe
authored andcommitted
spawn particles
1 parent c5188ca commit 27a3761

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/main/java/net/kaupenjoe/tutorialmod/item/custom/ChiselItem.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import net.kaupenjoe.tutorialmod.sound.ModSounds;
66
import net.minecraft.client.gui.screens.Screen;
77
import net.minecraft.client.multiplayer.ClientLevel;
8+
import net.minecraft.core.particles.BlockParticleOption;
9+
import net.minecraft.core.particles.ParticleTypes;
810
import net.minecraft.network.chat.Component;
911
import net.minecraft.server.level.ServerLevel;
1012
import net.minecraft.sounds.SoundEvents;
@@ -51,6 +53,14 @@ public InteractionResult useOn(UseOnContext context) {
5153

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

56+
((ServerLevel) level).sendParticles(new BlockParticleOption(ParticleTypes.BLOCK, clickedBlock.defaultBlockState()),
57+
context.getClickedPos().getX() + 0.5, context.getClickedPos().getY() + 1.0,
58+
context.getClickedPos().getZ() + 0.5, 5, 0, 0, 0, 1);
59+
60+
((ServerLevel) level).sendParticles(ParticleTypes.DOLPHIN,
61+
context.getClickedPos().getX() + 0.5, context.getClickedPos().getY() + 1.5,
62+
context.getClickedPos().getZ() + 0.5, 5, 0, 0, 0, 3);
63+
5464
context.getItemInHand().set(ModDataComponents.COORDINATES, context.getClickedPos());
5565
}
5666
}

0 commit comments

Comments
 (0)