Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.mcreator.frdlvls.procedures;
- /* imports omitted */
- public class ConfusionOnEffectActiveTickProcedure {
- public static void execute(double x, double y, double z, Entity entity) {
- if (entity == null)
- return;
- double randominterger = 0;
- if (entity instanceof ServerPlayer _player)
- _player.sendSystemMessage(Component.literal("You feel dizzy..."), false);
- randominterger = Mth.nextDouble(RandomSource.create(), 1, 4);
- for (int _i1 = 0; _i1 < entity instanceof LivingEntity _livEnt && _livEnt.hasEffect(FrDlsModMobEffects.NAUSEA) ? _livEnt.getEffect(FrDlsModMobEffects.NAUSEA).getAmplifier() : 0; _i1++) {
- 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))));
- }
- if (randominterger == 1) {
- if (entity instanceof Player _player)
- _player.getCooldowns().addCooldown((entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY), 60);
- if (entity instanceof LivingEntity _entity)
- _entity.swing(InteractionHand.MAIN_HAND, true);
- if (entity instanceof Mob _entity)
- _entity.getNavigation().stop();
- } else if (randominterger == 2) {
- for (int _i1 = 0; _i1 < entity instanceof LivingEntity _livEnt && _livEnt.hasEffect(FrDlsModMobEffects.NAUSEA) ? _livEnt.getEffect(FrDlsModMobEffects.NAUSEA).getAmplifier() : 0; _i1++) {
- if (entity instanceof Player _player)
- _player.causeFoodExhaustion((float) 0.25);
- }
- } else if (randominterger == 3) {
- entity.stopRiding();
- entity.push((Mth.nextDouble(RandomSource.create(), -3, 3)), (Mth.nextDouble(RandomSource.create(), -3, 3)), (Mth.nextDouble(RandomSource.create(), -3, 3)));
- } else {
- 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))));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment