- Выберите загрузчик игры
- Vanilla
- Forge
- Fabric
- NeoForge
- OptiFine
- ForgeOptiFine
- Прочие моды
Java:
@FieldDefaults(level = AccessLevel.PRIVATE, makeFinal = true)
public class AirJump extends Module {
StopWatch stopWatch = new StopWatch();
SelectSetting mode = new SelectSetting("Mode").value("Polar Block Collision");
public AirJump() {
super("AirJump", "Air Jump", "Jump in air", ModuleCategory.MOVEMENT);
setup(mode);
}
@EventHandler
public void onJump(JumpEvent e) {
stopWatch.reset();
}
@EventHandler
public void onPostTick(PostTickEvent e) {
if (mode.isSelected("Polar Block Collision")) {
Box playerBox = mc.player.getBoundingBox(EntityPose.STANDING).offset(mc.player.getEntityPos()).contract(1e-3);
if (stopWatch.finished(400) && BlockPos.stream(playerBox.withMinY(playerBox.getCenter().getY() - 0.2F).withMaxY(playerBox.minY + 0.4F)).anyMatch(this::hasCollision)) {
mc.player.setOnGround(true);
mc.player.velocity.y = 0.6;
}
}
}
private boolean hasCollision(BlockPos blockPos) {
return mc.world.getBlockState(blockPos).getCollisionShape(mc.world, blockPos).getBoundingBoxes().stream().anyMatch(box -> box.getLengthY() > 0.1);
}
}
Пожалуйста, авторизуйтесь для просмотра ссылки.