use of com.viste.realisticarmortiers.data.EventEquipmentGlobalVar in project RealisticArmorTiers by IsakViste.
the class Equiped method addPotionEffect.
public static void addPotionEffect(ServerPlayerEntity player, PotionEffect setEffect) {
EventEquipmentGlobalVar global = new EventEquipmentGlobalVar();
RegistryObject<Effect> potionEffect = RegistryObject.of(new ResourceLocation(setEffect.id), ForgeRegistries.POTIONS);
if (player.hasEffect(potionEffect.get())) {
player.removeEffect(potionEffect.get());
}
player.addEffect(new EffectInstance(potionEffect.get(), global.getPotionDur(), setEffect.efficiency - 1));
}
Aggregations