Posted August 31, 20205 yr My effect does nothing in this code package com.sonplaying.bufffood.effects; import javax.annotation.Nullable; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.potion.Effect; import net.minecraft.potion.EffectType; public class SecondWindEffect extends Effect { public SecondWindEffect(EffectType typeIn, int liquidColorIn) { super(typeIn, liquidColorIn); } @Override public void performEffect(LivingEntity a, int amplifier) { if (a.getHealth() < a.getMaxHealth()) { a.heal(1.0F); } } public void affectEntity(@Nullable Entity source, @Nullable Entity indirectSource, LivingEntity a, int amplifier, double health) { this.performEffect(a, amplifier); } } What's wrong with this?
August 31, 20205 yr Author 3 minutes ago, poopoodice said: How do you apply the effect? Have you register the effect type? I registered the effect in my registryhandler. I put the type EffectType.BENEFICIAL... wait, what do you mean effect type? Is it POTION_TYPE? Do i have to register that as well?
August 31, 20205 yr Sorry I mean "effect". Can you show us how you register it? Also Quote How do you apply the effect? Edited August 31, 20205 yr by poopoodice
August 31, 20205 yr Author 1 hour ago, poopoodice said: Sorry I mean "effect". Can you show us how you register it? Also i only registered public static final RegistryObject<SecondWindEffect> SECOND_WIND_EFFECT = EFFECTS.register("second_wind_effect", () -> new SecondWindEffect(EffectType.BENEFICIAL, 152512));
September 4, 20205 yr Author On 8/31/2020 at 5:12 PM, diesieben07 said: performEffect is only called if isReady returns true that tick (it returns false by default). Yes, it works. I've put return this == REGISTRY.EFFECT_NAME.get(); and it works. But it's different though. I've put heal, right? It's really fast for some reason. How do i slow it down? Do i just change the float value?
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.