From b027fb1945568b4db485210c1ca8b992aab34d1f Mon Sep 17 00:00:00 2001 From: Vos Date: Tue, 11 Nov 2025 11:27:29 -0600 Subject: [PATCH] Lemon Effects --- .../com/acethewildfire/acesbs/AcesBS.java | 3 ++ .../acesbs/effect/LemonEffect.java | 25 ++++++++++++++++ .../acesbs/effect/ModEffects.java | 28 ++++++++++++++++++ .../acesbs/item/ModFoodComponent.java | 3 +- .../resources/assets/acesbs/lang/en_us.json | 6 ++++ .../acesbs/textures/mob_effect/lemon.png | Bin 0 -> 4420 bytes 6 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/acethewildfire/acesbs/effect/LemonEffect.java create mode 100644 src/main/java/com/acethewildfire/acesbs/effect/ModEffects.java create mode 100644 src/main/resources/assets/acesbs/textures/mob_effect/lemon.png diff --git a/src/main/java/com/acethewildfire/acesbs/AcesBS.java b/src/main/java/com/acethewildfire/acesbs/AcesBS.java index d1a547c..aacaeec 100644 --- a/src/main/java/com/acethewildfire/acesbs/AcesBS.java +++ b/src/main/java/com/acethewildfire/acesbs/AcesBS.java @@ -2,6 +2,7 @@ package com.acethewildfire.acesbs; import com.acethewildfire.acesbs.block.ModBlocks; import com.acethewildfire.acesbs.component.ModDataComponentTypes; +import com.acethewildfire.acesbs.effect.ModEffects; import com.acethewildfire.acesbs.item.ModItemGroups; import com.acethewildfire.acesbs.item.ModItems; import com.acethewildfire.acesbs.sounds.ModSounds; @@ -12,6 +13,7 @@ import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.event.player.AttackEntityCallback; import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; +import net.fabricmc.fabric.api.renderer.v1.Renderer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -34,6 +36,7 @@ public class AcesBS implements ModInitializer { ModItems.registerModItems(); ModBlocks.registerModBlocks(); ModSounds.registerSounds(); + ModEffects.registerEffects(); ModDataComponentTypes.registerDataComponentsTypes(); diff --git a/src/main/java/com/acethewildfire/acesbs/effect/LemonEffect.java b/src/main/java/com/acethewildfire/acesbs/effect/LemonEffect.java new file mode 100644 index 0000000..3668a58 --- /dev/null +++ b/src/main/java/com/acethewildfire/acesbs/effect/LemonEffect.java @@ -0,0 +1,25 @@ +package com.acethewildfire.acesbs.effect; + +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.effect.StatusEffect; +import net.minecraft.entity.effect.StatusEffectCategory; + +public class LemonEffect extends StatusEffect { + public LemonEffect(StatusEffectCategory category, int color) { + super(category, color); + } + + @Override + public boolean applyUpdateEffect(LivingEntity entity, int amplifier) { + + entity.damage(entity.getDamageSources().wither(), 0.1F); + return true; + + } + + @Override + public boolean canApplyUpdateEffect(int duration, int amplifier) { + return true; + } + +} diff --git a/src/main/java/com/acethewildfire/acesbs/effect/ModEffects.java b/src/main/java/com/acethewildfire/acesbs/effect/ModEffects.java new file mode 100644 index 0000000..2aab1da --- /dev/null +++ b/src/main/java/com/acethewildfire/acesbs/effect/ModEffects.java @@ -0,0 +1,28 @@ +package com.acethewildfire.acesbs.effect; + +import com.acethewildfire.acesbs.AcesBS; +import net.minecraft.entity.attribute.EntityAttribute; +import net.minecraft.entity.attribute.EntityAttributeModifier; +import net.minecraft.entity.attribute.EntityAttributes; +import net.minecraft.entity.effect.StatusEffect; +import net.minecraft.entity.effect.StatusEffectCategory; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; +import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.util.Identifier; + +public class ModEffects { + + public static final RegistryEntry LEMON = registerStatusEffect("lemon", + new LemonEffect(StatusEffectCategory.HARMFUL, 0xfae640) + .addAttributeModifier(EntityAttributes.GENERIC_MOVEMENT_SPEED, Identifier.of(AcesBS.MOD_ID, "lemon"), + -0.75F, EntityAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL)); + + private static RegistryEntry registerStatusEffect (String name, StatusEffect effect){ + return Registry.registerReference(Registries.STATUS_EFFECT, Identifier.of(AcesBS.MOD_ID, name), effect); + } + + public static void registerEffects(){ + AcesBS.LOGGER.info("Registering Mod Effects for " + AcesBS.MOD_ID); + } +} diff --git a/src/main/java/com/acethewildfire/acesbs/item/ModFoodComponent.java b/src/main/java/com/acethewildfire/acesbs/item/ModFoodComponent.java index c404ee3..fec6145 100644 --- a/src/main/java/com/acethewildfire/acesbs/item/ModFoodComponent.java +++ b/src/main/java/com/acethewildfire/acesbs/item/ModFoodComponent.java @@ -1,5 +1,6 @@ package com.acethewildfire.acesbs.item; +import com.acethewildfire.acesbs.effect.ModEffects; import net.minecraft.component.type.FoodComponent; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; @@ -9,7 +10,7 @@ public class ModFoodComponent { public static final FoodComponent LEMON = new FoodComponent.Builder() .nutrition(3) .saturationModifier(0.25f) - .statusEffect(new StatusEffectInstance(StatusEffects.BLINDNESS, 200), 0.3f) + .statusEffect(new StatusEffectInstance(ModEffects.LEMON, 200), 0.8f) .build(); public static final FoodComponent COOKED_LEMON = new FoodComponent.Builder() .nutrition(6) diff --git a/src/main/resources/assets/acesbs/lang/en_us.json b/src/main/resources/assets/acesbs/lang/en_us.json index e5e9ccd..ed41b62 100644 --- a/src/main/resources/assets/acesbs/lang/en_us.json +++ b/src/main/resources/assets/acesbs/lang/en_us.json @@ -13,6 +13,12 @@ "item.minecraft.lingering_potion.effect.blindness": "Lingering Potion of Blindness", "item.minecraft.tipped_arrow.effect.blindness": "Arrow of Blindness", + "effect.acesbs.lemon": "Puckered", + "item.acesbs.potion.effect.lemon": "Potion of Puckered", + "item.acesbs.splash_potion.effect.lemon": "Splash Potion of Puckered", + "item.acesbs.lingering_potion.effect.lemon": "Lingering Potion of Puckered", + "item.acesbs.tipped_arrow.effect.lemon": "Arrow of Puckered", + "item.acesbs.prisma_steel": "Prisma Steel", "item.acesbs.prisma_steel_sword": "Prisma Steel Sword", "item.acesbs.prisma_steel_pickaxe": "Prisma Steel Pickaxe", diff --git a/src/main/resources/assets/acesbs/textures/mob_effect/lemon.png b/src/main/resources/assets/acesbs/textures/mob_effect/lemon.png new file mode 100644 index 0000000000000000000000000000000000000000..a18998d1b3ecc779f8970a9e12923881ee3d177e GIT binary patch literal 4420 zcmeHKdr%X19$yX(2wE$rg4NnJc%xJ|+1)%y0s&*fBd1XcL9m97o84bvg=AxPLmuk+ zsM>nuWSlwMlnbA6;uS4{_a*1H6~M=hptVrQrF^K{ z!#UV8fC>ROK!KliAc+6+?_O~}*Mvs*+({}QHR_OO+LNl=l9V4_d+W0I{?)vy`fs0}Z?~oVhkCYkQiuJjw`s+97k42@#75R=%rP5{eJR64cdx0?XE)7D z*xY%bYVuz+ZHDF<#_yQ;Nh{~(&)u-8bxFw=AAa4MUSiMAwM`rS<%ZYO-^!1QFD`n~ zHrjAEs=3IWD^$dtTo8lVPkeR!jqZl-fBrjVUdb1KSRsj9cW7y*x@uzV=}E++-$v|; zXnwwO=fN62HsIg(*Hw=m{U-j#(hl$1ZH8)wY@8K0Yp1KQ`Bt;yowv^g-qoBsR5^e3 zqEza_=q)eR$?BheRCoQoMnz&~T1wWm8I$Me=XT?@FT8wDxzhTIswF-~HfQ%SP3`xR zTUWQA#BHr_^R^n*=82OlG9^+*nPYr$^7SL7`*)sg4YW3;fBQ)Bb>+wTk%?zg)qk4r zdD^x1Zv8PwU`4AXX4d+K_$xmoL~W>_SI=JQJae=?E#m3<#;S|ob4S))THN|h5f&UZ z))^W9Ws#*LQs!G%F{_B2nRWlOxE9dWv$f%1^w`c{^whdKbvHC?ko%w4R!{Bfdj8G) z*{lBXRr}tKhMr}g-RvAMP@bC4x4Sr4n&m7k!9vSI9nCpq6vNqp%*R8u&nNRKWSpm1PH44SIZnz+5`z{PA8-kjA9L}EB19O&1bEuRx&@YVp&}+_ z=e&YmDusHqFFvQ+V(Eu>@x3fSKIDGNEhl8S-074L_TYt#atP8J&`)~sR@lk%T)=Z) z4-GQPflEjn48hR-{%)_QER+sI%Rw1%LQ@`&N(>n?%WTQ%_Yf&4W}WVk7bJU#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