diff --git a/src/main/java/com/portingdeadmods/modjam/content/augments/UnderwaterMovementSpeedAugment.java b/src/main/java/com/portingdeadmods/modjam/content/augments/UnderwaterMovementSpeedAugment.java new file mode 100644 index 00000000..66384e92 --- /dev/null +++ b/src/main/java/com/portingdeadmods/modjam/content/augments/UnderwaterMovementSpeedAugment.java @@ -0,0 +1,20 @@ +package com.portingdeadmods.modjam.content.augments; + +import com.portingdeadmods.modjam.capabilities.augmentation.Slot; +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.effect.MobEffects; +import net.neoforged.neoforge.event.tick.PlayerTickEvent; + +public class UnderwaterMovementSpeedAugment extends Augment{ + @Override + public int getId() { + return 6; + } + + @Override + public void serverTick(Slot slot, PlayerTickEvent.Post event) { + if (event.getEntity().isUnderWater()){ + event.getEntity().addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SPEED,20,1)); + } + } +} diff --git a/src/main/java/com/portingdeadmods/modjam/registries/MJAugments.java b/src/main/java/com/portingdeadmods/modjam/registries/MJAugments.java index 17fc89c8..6138c391 100644 --- a/src/main/java/com/portingdeadmods/modjam/registries/MJAugments.java +++ b/src/main/java/com/portingdeadmods/modjam/registries/MJAugments.java @@ -18,4 +18,5 @@ public final class MJAugments { public static final Supplier THROW_SNOWBALL = AUGMENTS.register("throw_snowball", ThrowSnowballAugment::new); public static final Supplier THROW_POTION_AUGMENT = AUGMENTS.register("throw_random_potion", ThrowRandomPotionAugments::new); public static final Supplier PREVENT_PLAYER_LOSE_AIR_AUGMENT = AUGMENTS.register("prevent_player_lose_air_supply", PreventPlayerLoseAirAugment::new); + public static final Supplier UNDERWATER_MOVEMENT_SPEED_AUGMENT = AUGMENTS.register("underwater_movement_speed", UnderwaterMovementSpeedAugment::new); }