Guest User

Issue with Code

a guest
Jun 24th, 2025
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. package net.mcreator.yofaddacompat.procedures;
  2.  
  3. import net.minecraftforge.registries.ForgeRegistries;
  4.  
  5. import net.minecraft.world.level.LevelAccessor;
  6. import net.minecraft.world.level.Level;
  7. import net.minecraft.world.item.ItemStack;
  8. import net.minecraft.sounds.SoundSource;
  9. import net.minecraft.server.level.ServerLevel;
  10. import net.minecraft.resources.ResourceLocation;
  11. import net.minecraft.core.particles.ParticleTypes;
  12. import net.minecraft.core.BlockPos;
  13.  
  14. import net.mcreator.ghostriderbyyofadda.network.GhostriderByYofaddaModVariables;
  15.  
  16. public class RippedContractRightclickedProcedure {
  17. public static void execute(LevelAccessor world, double x, double y, double z, ItemStack itemstack) {
  18. if (world instanceof ServerLevel _level)
  19. _level.sendParticles(ParticleTypes.ELECTRIC_SPARK, x, y, z, 12, 1, 1, 1, 0.5);
  20. if (world instanceof ServerLevel _level)
  21. _level.sendParticles(ParticleTypes.LAVA, x, y, z, 8, 1, 1, 1, 0.5);
  22. if (world instanceof Level _level) {
  23. if (!_level.isClientSide()) {
  24. _level.playSound(null, BlockPos.containing(x, y, z), ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.firework_rocket.large_blast")), SoundSource.PLAYERS, 1, 1);
  25. } else {
  26. _level.playLocalSound(x, y, z, ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.firework_rocket.large_blast")), SoundSource.PLAYERS, 1, 1, false);
  27. }
  28. }
  29. itemstack.shrink(1);
  30. GhostriderByYofaddaModVariables.PlayerVariables.RiderPossessed = false;
  31. }
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment