Facerig

Code

Nov 10th, 2026
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | Source Code | 0 0
  1. package net.mcreator.frdlvls.procedures;
  2.  
  3. /* imports omitted */
  4.  
  5. public class ConfusionOnEffectActiveTickProcedure {
  6.  
  7. public static void execute(double x, double y, double z, Entity entity) {
  8.  
  9. if (entity == null)
  10.  
  11. return;
  12.  
  13. double randominterger = 0;
  14.  
  15. if (entity instanceof ServerPlayer _player)
  16.  
  17. _player.sendSystemMessage(Component.literal("You feel dizzy..."), false);
  18.  
  19. randominterger = Mth.nextDouble(RandomSource.create(), 1, 4);
  20.  
  21. for (int _i1 = 0; _i1 < entity instanceof LivingEntity _livEnt && _livEnt.hasEffect(FrDlsModMobEffects.NAUSEA) ? _livEnt.getEffect(FrDlsModMobEffects.NAUSEA).getAmplifier() : 0; _i1++) {
  22.  
  23. entity.lookAt(EntityAnchorArgument.Anchor.EYES, new Vec3((x + Mth.nextDouble(RandomSource.create(), -10, 10)), (y + Mth.nextDouble(RandomSource.create(), -10, 10)), (z + Mth.nextDouble(RandomSource.create(), -10, 10))));
  24.  
  25. }
  26.  
  27. if (randominterger == 1) {
  28.  
  29. if (entity instanceof Player _player)
  30.  
  31. _player.getCooldowns().addCooldown((entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY), 60);
  32.  
  33. if (entity instanceof LivingEntity _entity)
  34.  
  35. _entity.swing(InteractionHand.MAIN_HAND, true);
  36.  
  37. if (entity instanceof Mob _entity)
  38.  
  39. _entity.getNavigation().stop();
  40.  
  41. } else if (randominterger == 2) {
  42.  
  43. for (int _i1 = 0; _i1 < entity instanceof LivingEntity _livEnt && _livEnt.hasEffect(FrDlsModMobEffects.NAUSEA) ? _livEnt.getEffect(FrDlsModMobEffects.NAUSEA).getAmplifier() : 0; _i1++) {
  44.  
  45. if (entity instanceof Player _player)
  46.  
  47. _player.causeFoodExhaustion((float) 0.25);
  48.  
  49. }
  50.  
  51. } else if (randominterger == 3) {
  52.  
  53. entity.stopRiding();
  54.  
  55. entity.push((Mth.nextDouble(RandomSource.create(), -3, 3)), (Mth.nextDouble(RandomSource.create(), -3, 3)), (Mth.nextDouble(RandomSource.create(), -3, 3)));
  56.  
  57. } else {
  58.  
  59. entity.lookAt(EntityAnchorArgument.Anchor.EYES, new Vec3((x + Mth.nextDouble(RandomSource.create(), -100, 100)), (y + Mth.nextDouble(RandomSource.create(), -100, 100)), (z + Mth.nextDouble(RandomSource.create(), -100, 100))));
  60.  
  61. }
  62.  
  63. }
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment