@SubscribeEvent(priority = EventPriority.LOW) public static void onHeal(LivingHealEvent event) { EntityLivingBase entity = event.getEntityLiving(); if (!entity.hasCapability(CapabilityExtendedHealthSystem.INSTANCE, null)) return; event.setCanceled(true); if (!FirstAid.activeHealingConfig.allowOtherHealingItems) return; float amount = event.getAmount(); //Hacky shit to reduce vanilla regen if (FirstAid.activeHealingConfig.allowNaturalRegeneration && Arrays.stream(Thread.currentThread().getStackTrace()).anyMatch(stackTraceElement -> stackTraceElement.getClassName().equals(FoodStats.class.getName()))) amount = amount * (float) FirstAid.activeHealingConfig.naturalRegenMultiplier; else amount = amount * (float) FirstAid.activeHealingConfig.otherRegenMultiplier; HealthDistribution.distributeHealth(amount, (EntityPlayer) entity, true); }
@SubscribeEvent(priority = EventPriority.LOW) public void onLivingHeal(@Nonnull final LivingHealEvent event) { if (!ModOptions.enableDamagePopoffs) return; if (event == null || event.getEntity() == null || event.getEntity().world == null || event.getEntity().world.isRemote) return; // Just in case if (event.getAmount() <= 0 || event.getEntityLiving() == null || event.getEntityLiving().getHealth() == event.getEntityLiving().getMaxHealth()) return; final Entity entity = event.getEntityLiving(); final Locus point = new Locus(entity, RANGE); final PacketHealthChange packet = new PacketHealthChange(entity.getEntityId(), (float) entity.posX, (float) entity.posY + (entity.height / 2.0F), (float) entity.posZ, false, -(int) event.getAmount()); Network.sendToAllAround(point, packet); }
@SubscribeEvent public void onHeal(LivingHealEvent e) { if (e.getEntityLiving() instanceof EntityPlayer && Options.THIRST_HEALTH_REGEN_FIX) { EntityPlayer player = (EntityPlayer) e.getEntityLiving(); ThirstHandler thirstHandler = (ThirstHandler) ThirstHelper.getThirstData(player); int currentThirst = thirstHandler.getThirst(); if (currentThirst < 19) { e.setCanceled(true); } } }
@SubscribeEvent public void onLivingHeal(LivingHealEvent event) { if (event.getEntityLiving() instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.getEntityLiving(); PossessivePlayer possessivePlayer = PossessHandler.get(player); if (possessivePlayer != null) { possessivePlayer.getPossessing().heal(event.getAmount()); event.setCanceled(true); } } }
/** * TFC scaled healing handler * @param event */ @SubscribeEvent public void onHeal(LivingHealEvent event) { if(event.amount > 1 && event.amount < 9 && ConfigSettings.InstantHealingScaling) event.amount = event.amount * ConfigSettings.VanillaHealingMultipier; }
@SubscribeEvent public static void healEvent(LivingHealEvent event) { if (event.getEntity() instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.getEntity(); DriveStateCapability.IDriveState DRIVE = player.getCapability(ModCapabilities.DRIVE_STATE, null); if(DRIVE.getActiveDriveName().equals(Strings.Form_Anti)) { event.setCanceled(true); } } }
public static float onLivingHeal(EntityLivingBase entity, float amount) { LivingHealEvent event = new LivingHealEvent(entity, amount); return (MinecraftForge.EVENT_BUS.post(event) ? 0 : event.getAmount()); }
public static float onLivingHeal(EntityLivingBase entity, float amount) { LivingHealEvent event = new LivingHealEvent(entity, amount); return (MinecraftForge.EVENT_BUS.post(event) ? 0 : event.amount); }
@SubscribeEvent(priority = EventPriority.HIGHEST) public static void onLivingHeal(LivingHealEvent event) { if (event.getEntityLiving().isPotionActive(MobEffects.WITHER)) AlchemyEventSystem.markEventCanceled(event); }
@SubscribeEvent(priority = EventPriority.LOW) public void onLivingHeal(LivingHealEvent event) { if (isEquipmented(event.getEntityLiving())) event.setAmount(event.getAmount() * (1 + AMPLIFY)); }
void onHeal(LivingHealEvent event, EntityLivingBase healed, int amplifier);