Skip to content

Match creative flying behavior to Java Edition#703

Open
MCbabel wants to merge 2 commits intosmartcmd:mainfrom
MCbabel:feature/creative-flying-java-edition
Open

Match creative flying behavior to Java Edition#703
MCbabel wants to merge 2 commits intosmartcmd:mainfrom
MCbabel:feature/creative-flying-java-edition

Conversation

@MCbabel
Copy link
Contributor

@MCbabel MCbabel commented Mar 6, 2026

Description

Adjusts creative mode flying to feel more like Java Edition. Not sure if this is something everyone would want, but I wanted to share these changes and see what people think.

Gameplay footage: https://youtu.be/4pWOwlfbAzA
Tested with both keyboard & mouse and controller - controller flying still works as expected.

Changes

Previous Behavior

Creative flying used a console-specific movement overlay where sprint-flying was pitch-dependent (looking down made you fly down), vertical movement was asymmetric (descending much faster than ascending), and sprint didn't noticeably increase horizontal flying speed.

Root Cause

The 4J console port added a separate sprint-fly movement path on top of the base travel system. This overlay used the full 3D view vector for direction (including pitch), had its own quadratic speed ramp-up, and bypassed the standard flyingSpeed multiplier. Additionally, onGround was forced true while flying, which caused LivingEntity::travel() to use ground movement speed instead of flyingSpeed.

New Behavior

  • Forward movement while flying is always horizontal regardless of where you look
  • Sprint (Ctrl) doubles flying speed
  • Ascend (Space) and descend (Shift) are the same speed
  • Smooth vertical deceleration when releasing keys
  • No jump impulse while flying (prevents unintended speed boosts)

Fix Implementation

LocalPlayer.cpp:

  • Removed the 4J sprint-fly overlay (viewVector-based movement + Player::move call)
  • Symmetric ascend/descend at 0.15 per tick
  • Removed yd = 0 override that killed vertical momentum

Player.cpp:

  • travel(): flyingSpeed uses sprint multiplier (2x), onGround temporarily set to false so LivingEntity::travel() applies air-friction physics
  • jumpFromGround(): early return when flying to prevent jump impulse stacking
  • Sprint speed bonus changed from 1.3x to 2x

Related Issues

  • I think I've only seen a few requests for this feature on Discord, but not here on GitHub.

@MCbabel
Copy link
Contributor Author

MCbabel commented Mar 6, 2026

If the feature is something that not everyone wants, it could perhaps be added to the game sooner or later as a setting that can be activated.

@codeHusky
Copy link
Collaborator

codeHusky commented Mar 6, 2026

I don’t personally think this is a good change. This isn’t a dedicated Windows fork of LCE, and even then the flying behavior in LCE is part of the distinct look and feel of the game. We should not gut it in favor of a less interesting flight system. It’s not like using the controller style flight with keyboard and mouse is a worse experience at all.

If we did accept this, it would be something behind an opt-in config setting. Improving the existing flight controls is fine, but eliminating the view directional flight kinda kills the fun IMO

@MotoLegacy
Copy link

+1 to the feedback here. Please do not integrate this as-is.

@MCbabel
Copy link
Contributor Author

MCbabel commented Mar 6, 2026

That's fair, I understand the concern about changing the core feel of LCE's flight. I'll update this to be an opt-in setting so it doesn't replace the default behavior. Working on it.

@codeHusky codeHusky marked this pull request as draft March 6, 2026 17:15
@GrimPlayzs
Copy link

LCE's flight behavior just feels odd and sometimes hard to control on Mouse and Keyboard, I'm for this change although yes it should be a toggle-able option.

@xgui4
Copy link

xgui4 commented Mar 6, 2026

i will rather keep the consle flying, or at least add this as a option.

@Fivebuss
Copy link

Fivebuss commented Mar 7, 2026

Console flying feels amazing, though a seperate option would be neat

@MCbabel MCbabel force-pushed the feature/creative-flying-java-edition branch from a69bd94 to 7c7f734 Compare March 7, 2026 03:40
MCbabel added 2 commits March 7, 2026 04:45
Adds a 'Java Flight Controls' checkbox to Help & Options > Settings > Options that enables Java Edition-style creative flying physics when toggled on.

When enabled:

- Symmetric ascend/descend (0.15 per tick each direction)

- Air friction-based movement (flyingSpeed through LivingEntity::travel)

- 2x sprint fly speed multiplier

- Vertical momentum preserved (no yd=0 reset per tick)

When disabled, the original 4J flying behavior is unchanged.

Demo: https://youtu.be/o-I0CFnV7sU

Changes:

- C++: New game setting eGameSetting_JavaFlightControls with bitmask persistence

- UI: Checkbox in SettingsOptionsMenu (all 6 resolution variants + .arc archive)

- Flying: Conditional logic in LocalPlayer::aiStep() and Player::travel()/jumpFromGround()
@MCbabel MCbabel force-pushed the feature/creative-flying-java-edition branch from 7c7f734 to 2344d9c Compare March 7, 2026 03:48
@MCbabel
Copy link
Contributor Author

MCbabel commented Mar 7, 2026

sorry for the messy force pushes, github sometimes confuses me a little
i hope everything is correct now

@MCbabel MCbabel marked this pull request as ready for review March 7, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants