Currently stuck on making a custom effect for forge 1.20.1 Im trying to add a certain number of hearts to a player once they consume a potion/custom item, i tried doing it with the vanilla effects and it didn't work the way i wanted it to work, so now im trying to make a custom effect that adds this configurable amount of hearts So far Ive been following KaupanJoes tutorial for both 1.21 and 1.20 and the effect doesn't seem to give any errors nor does its registration, however i cant seem to get it to work with applying it to the item itself ```package com.curseofaros.item;
import com.curseofaros.effect.ModEffects;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.food.FoodProperties; public class ModFoods { public static final FoodProperties FLASK_OF_LIFE = new FoodProperties.Builder() .fast() .alwaysEat() .nutrition(0) .saturationMod(0) .effect(() -> new MobEffectInstance(MobEffects.HEAL, 1, 2), 1.0f) .build(); public static final FoodProperties MEDIUM_POTION = new FoodProperties.Builder() .fast() .alwaysEat() .nutrition(0) .saturationMod(0) .effect(() -> new MobEffectInstance(ModEffects.MEDIUM_POTION_EFFECT.get())) .build(); public static final FoodProperties SMALL_POTION = new FoodProperties.Builder() .fast() .alwaysEat() .nutrition(0) .saturationMod(0) .effect(() -> new MobEffectInstance(MobEffects.HEAL, 1, 3), 1.0f) .build(); } (Sorry for the real shi formatting, don't really know how to do it smh, note im also fairly new to Java so i don't know a lot, please be patient and let me know if the error is simply a lack of understand of Java principles)
By
vastlysucks · Posted 5 hours ago 5 hr
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.