Skip to content

Commit

Permalink
UnderwaterMovementSpeedAugment
Browse files Browse the repository at this point in the history
  • Loading branch information
ktpatient committed Sep 9, 2024
1 parent 0be9d76 commit 724b692
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ public final class MJAugments {
public static final Supplier<ThrowSnowballAugment> THROW_SNOWBALL = AUGMENTS.register("throw_snowball", ThrowSnowballAugment::new);
public static final Supplier<ThrowRandomPotionAugments> THROW_POTION_AUGMENT = AUGMENTS.register("throw_random_potion", ThrowRandomPotionAugments::new);
public static final Supplier<PreventPlayerLoseAirAugment> PREVENT_PLAYER_LOSE_AIR_AUGMENT = AUGMENTS.register("prevent_player_lose_air_supply", PreventPlayerLoseAirAugment::new);
public static final Supplier<UnderwaterMovementSpeedAugment> UNDERWATER_MOVEMENT_SPEED_AUGMENT = AUGMENTS.register("underwater_movement_speed", UnderwaterMovementSpeedAugment::new);
}

0 comments on commit 724b692

Please sign in to comment.