Advertisement
Guest User

Untitled

a guest
Oct 20th, 2024
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | Help | 0 0
  1. package net.mcreator.objectpaitnings.procedures; 
  2.  
  3. import net.minecraft.world.entity.LivingEntity; 
  4. import net.minecraft.world.entity.Entity; 
  5. import net.minecraft.world.effect.MobEffects; 
  6. import net.minecraft.world.effect.MobEffectInstance; 
  7.  
  8. public class GhoulProcedure { 
  9. @Mod.EventBusSubscriber public class GhoulProcedure {
  10. @SubscribeEvent public static void onPlayerCriticalHit(CriticalHitEvent event) {
  11. execute(event,event.getTarget(),event.getEntity());
  12. }
  13. public static void execute(
  14. Entity entity,
  15. Entity sourceentity
  16. ) {
  17. if(
  18. entity == null ||
  19. sourceentity == null
  20. ) return ;
  21. if(entity instanceof LivingEntity _entity && !_entity.level().isClientSide())
  22. _entity.addEffect(new MobEffectInstance(MobEffects.POISON,60,1));if(sourceentity instanceof LivingEntity _entity && !_entity.level().isClientSide())
  23. _entity.addEffect(new MobEffectInstance(MobEffects.REGENERATION,60,1));
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement