Java Code Examples for net.minecraft.client.network.ClientPlayerEntity#isClimbing()
The following examples show how to use
net.minecraft.client.network.ClientPlayerEntity#isClimbing() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FastLadderHack.java From Wurst7 with GNU General Public License v3.0 | 5 votes |
@Override public void onUpdate() { ClientPlayerEntity player = MC.player; if(!player.isClimbing() || !player.horizontalCollision) return; if(player.input.movementForward == 0 && player.input.movementSideways == 0) return; Vec3d velocity = player.getVelocity(); player.setVelocity(velocity.x, 0.2872, velocity.z); }
Example 2
Source File: GlideHack.java From Wurst7 with GNU General Public License v3.0 | 5 votes |
@Override public void onUpdate() { ClientPlayerEntity player = MC.player; Vec3d v = player.getVelocity(); if(player.isOnGround() || player.isTouchingWater() || player.isInLava() || player.isClimbing() || v.y >= 0) return; if(minHeight.getValue() > 0) { Box box = player.getBoundingBox(); box = box.union(box.offset(0, -minHeight.getValue(), 0)); if(!MC.world.doesNotCollide(box)) return; BlockPos min = new BlockPos(new Vec3d(box.minX, box.minY, box.minZ)); BlockPos max = new BlockPos(new Vec3d(box.maxX, box.maxY, box.maxZ)); Stream<BlockPos> stream = StreamSupport .stream(BlockUtils.getAllInBox(min, max).spliterator(), true); // manual collision check, since liquids don't have bounding boxes if(stream.map(BlockUtils::getState).map(BlockState::getMaterial) .anyMatch(Material::isLiquid)) return; } player.setVelocity(v.x, Math.max(v.y, -fallSpeed.getValue()), v.z); player.flyingSpeed *= moveSpeed.getValueF(); }