|
16 | 16 | import net.minecraft.item.ItemStack; |
17 | 17 | import net.minecraft.item.ItemUsageContext; |
18 | 18 | import net.minecraft.item.tooltip.TooltipType; |
| 19 | +import net.minecraft.particle.BlockStateParticleEffect; |
| 20 | +import net.minecraft.particle.ParticleTypes; |
19 | 21 | import net.minecraft.server.network.ServerPlayerEntity; |
20 | 22 | import net.minecraft.server.world.ServerWorld; |
21 | 23 | import net.minecraft.sound.SoundCategory; |
@@ -56,6 +58,16 @@ public ActionResult useOnBlock(ItemUsageContext context) { |
56 | 58 |
|
57 | 59 | world.playSound(null, context.getBlockPos(), ModSounds.CHISEL_USE, SoundCategory.BLOCKS); |
58 | 60 |
|
| 61 | + ((ServerWorld) world).spawnParticles(new BlockStateParticleEffect(ParticleTypes.BLOCK, clickedBlock.getDefaultState()), |
| 62 | + context.getBlockPos().getX() + 0.5, context.getBlockPos().getY() + 1.0, |
| 63 | + context.getBlockPos().getZ() + 0.5, 5, 0, 0, 0, 1); |
| 64 | + |
| 65 | + ((ServerWorld) world).spawnParticles(ParticleTypes.FLAME, |
| 66 | + context.getBlockPos().getX() + 0.5, context.getBlockPos().getY() + 1.5, |
| 67 | + context.getBlockPos().getZ() + 0.5, 10, 0, 0, 0, 3); |
| 68 | + |
| 69 | + |
| 70 | + |
59 | 71 | context.getStack().set(ModDataComponentTypes.COORDINATES, context.getBlockPos()); |
60 | 72 | } |
61 | 73 | } |
|
0 commit comments