summaryrefslogtreecommitdiff
path: root/src/main/java/com/arslaancodes/arslaansmagichax/modules/impl/Waterwalk.java
diff options
context:
space:
mode:
authorArslaan Pathan <[email protected]>2026-09-26 17:05:36 +1200
committerArslaan Pathan <[email protected]>2026-09-26 17:05:36 +1200
commit14c68eb5ba16774f581d95a39e64a7b303954ffc (patch)
tree2888ef11f47c6a639d440300ef580c247ad1bcb1 /src/main/java/com/arslaancodes/arslaansmagichax/modules/impl/Waterwalk.java
parent766ba1c1d977442332cadaaeca93d795baa559df (diff)
downloadarslaansmagichax-14c68eb5ba16774f581d95a39e64a7b303954ffc.tar.xz
arslaansmagichax-14c68eb5ba16774f581d95a39e64a7b303954ffc.zip
migration to 26.2 - run migrateMappings with old loom then bring it back to new
Diffstat (limited to 'src/main/java/com/arslaancodes/arslaansmagichax/modules/impl/Waterwalk.java')
-rw-r--r--src/main/java/com/arslaancodes/arslaansmagichax/modules/impl/Waterwalk.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/com/arslaancodes/arslaansmagichax/modules/impl/Waterwalk.java b/src/main/java/com/arslaancodes/arslaansmagichax/modules/impl/Waterwalk.java
new file mode 100644
index 0000000..7949203
--- /dev/null
+++ b/src/main/java/com/arslaancodes/arslaansmagichax/modules/impl/Waterwalk.java
@@ -0,0 +1,28 @@
+package com.arslaancodes.arslaansmagichax.modules.impl;
+
+import com.arslaancodes.arslaansmagichax.modules.Category;
+import com.arslaancodes.arslaansmagichax.modules.Module;
+import net.minecraft.core.BlockPos;
+import net.minecraft.world.level.block.Blocks;
+
+public class Waterwalk extends Module {
+ public Waterwalk() {
+ super("Waterwalk", "Allows you to walk on water.", -1, Category.MOVEMENT);
+ }
+
+ @Override
+ public void tick() {
+ if (!this.isEnabled() || mc.player == null) return;
+
+ BlockPos blockBelow = mc.player.blockPosition().below();
+
+ if (mc.level.getBlockState(blockBelow).is(Blocks.WATER)) {
+ if (mc.player.getDeltaMovement().y < 0) {
+ mc.player.setDeltaMovement(mc.player.getDeltaMovement().x, 0.0, mc.player.getDeltaMovement().z);
+
+ if (!mc.player.isJumping()) mc.player.setPosRaw(mc.player.getX(), Math.floor(mc.player.getY()), mc.player.getZ());
+ }
+ mc.player.setOnGround(true);
+ }
+ }
+} \ No newline at end of file