Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.mcreator.objectpaitnings.procedures;
- import net.minecraft.world.entity.LivingEntity;
- import net.minecraft.world.entity.Entity;
- import net.minecraft.world.effect.MobEffects;
- import net.minecraft.world.effect.MobEffectInstance;
- public class GhoulProcedure {
- @Mod.EventBusSubscriber public class GhoulProcedure {
- @SubscribeEvent public static void onPlayerCriticalHit(CriticalHitEvent event) {
- execute(event,event.getTarget(),event.getEntity());
- }
- public static void execute(
- Entity entity,
- Entity sourceentity
- ) {
- if(
- entity == null ||
- sourceentity == null
- ) return ;
- if(entity instanceof LivingEntity _entity && !_entity.level().isClientSide())
- _entity.addEffect(new MobEffectInstance(MobEffects.POISON,60,1));if(sourceentity instanceof LivingEntity _entity && !_entity.level().isClientSide())
- _entity.addEffect(new MobEffectInstance(MobEffects.REGENERATION,60,1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement