{{Infobox version
| edition = bedrock
| type = Preview
| image = Bedrock 1.20.40.22 PatchNotes.jpg
| image2 = Bedrock 1.20.40.22.png
| build = 18157335
| editorver = 0.4.5
| internal = '''Windows''': 1.20.4022.0<br>'''Xbox One''': 1.20.4022.70<br>'''Android, iOS, iPadOS''': 1.20.40.22
| server = 1.20.40.22
| versioncode = '''Android''':<br>
952004022（armeabi-v7a，33）<br>
962004022（x86，33）<br>
972004022（arm64-v8a，33）<br>
982004022（x86_64，33）<br>
| date = September 20, 2023
| serverdl = '''Server'''<br>[https://minecraft.azureedge.net/bin-win-preview/bedrock-server-1.20.40.22.zip Windows]<br>[https://minecraft.azureedge.net/bin-linux-preview/bedrock-server-1.20.40.22.zip Linux]
| parent = 1.20.40
| prevparent = 1.20.30
| prev = Preview 1.20.40.21
| next = Preview 1.20.40.23
| nextparent = 1.20.41 
}}<onlyinclude>

'''Beta 1.20.40.22''' (Android) or '''Preview 1.20.40.22''' (Windows, iOS, iPadOS, Xbox) is the third beta/''Preview'' version for [[Bedrock Edition 1.20.40]], released on September 20, 2023,<ref>{{cite|url=https://feedback.minecraft.net/hc/en-us/articles/19648957981965-Minecraft-Beta-Preview-1-20-40-22|title=Minecraft - Beta & ''Preview'' 1.20.40.22|website=Minecraft Feedback|date=September 20, 2023}}</ref> which brings more parity with {{JE}} and fixes bugs.

== Additions ==
=== General ===
; [[Controls]]
* Added the ability to customize touch controls.

; [[Options]]
* Added "Customize Controls" experimental ''touch'' option, OFF by default.
** Enables the ability to customize touch controls.
*** It can only be done within a world.

== Changes ==
=== Gameplay ===
; [[Game rule]]s
* The <code>spawnradius</code> game rule is now set to <code>10</code> by default to match {{JE}}.

=== Items ===
; [[Goat Horn]]s
* Now have a range of 256 blocks.

=== Mobs ===
; [[Iron Golem]] and [[Snow Golem]]
* Now have a crumbling-like [[particle]] effect when they are created.

; [[Witch]]
* Now target [[player]]s within a 16 block distance.

== Experimental ==
These additions and changes are accessible by enabling the "Beta APIs", "Molang Features", "Experimental Cameras", and "Render Dragon Features for Creators" experimental toggles.
=== Changes ===
==== Technical ====
; [[API]]
* Camera APIs moved from ''beta'' to <code>1.6.0</code>.
* Released <code>Entity.is*</code> API’s from ''beta'' to <code>1.6.0</code>:
** <code>isSleeping</code>.
** <code>isSneaking</code>.
** <code>isSprinting</code>.
** <code>isSwimming</code>.
** <code>isClimbing</code>.
** <code>isOnGround</code>.
** <code>isInWater</code>.
** <code>isFalling</code>.
* Released player level & XP APIs from ''beta'' to <code>1.6.0</code>:
** <code>addLevels</code>.
** <code>addExperience</code>.
** <code>level</code>.
** <code>getTotalXP</code>.
** <code>xpEarnedAtCurrentLevel</code>.
** <code>totalXpNeededForNextLevel</code>.
** <code>resetLevel</code>.
* Released <code>Player.is*</code> API’s from ''beta'' to <code>1.6.0</code>:
** <code>isEmoting</code>.
** <code>isGliding</code>.
** <code>isJumping</code>.
** <code>isFlying</code>.
* Updated all methods besides show on <code>ActionFormData</code>, <code>MessageFormData</code>, and <code>ModalFormData</code> to be callable in read-only mode.
* <code>BlockInventoryComponent</code>
** container member variable now correctly reflects it can be a <code>Container</code> or <code>undefined</code>.
* Fixed a versioning bug preventing <code>@minecraft/server-ui</code> module from working with <code>@minecraft/server</code> above version <code>1.2.0</code>.
* <code>WeatherType</code> moved to <code>1.6.0</code>:
** Moved function <code>setWeather</code> to <code>1.6.0</code>.
** Moved event/property <code>entityRemove</code> from ''beta'' to <code>1.6.0</code>.
** Moved event/property <code>entityRemove</code> from ''beta'' to <code>1.6.0</code>.
* Moved class <code>EntityRemovedAfterEvent</code> from ''beta'' to <code>1.6.0</code>.
* Moved class <code>EntityRemoveAfterEventSignal</code> from ''beta''  to <code>1.6.0</code>.
* Moved class <code>EntityRemovedBeforeEvent</code> from ''beta'' to <code>1.6.0</code>.
* Moved class <code>EntityRemoveBeforeEventSignal</code> from ''beta'' to <code>1.6.0</code>.
** Moved event/property <code>entityLoad</code> from ''beta'' to <code>1.6.0</code>.
* Moved class <code>EntityLoadAfterEvent</code> from ''beta'' to <code>1.6.0</code>.
* Moved class <code>EntityLoadAfterEventSignal</code> from ''beta'' to <code>1.6.0</code>.
** Moved event/property <code>entitySpawn</code> from ''beta'' to <code>1.6.0</code>.
* Moved enum <code>EntityInitializationCause</code> from ''beta'' to <code>1.6.0</code>.
* Moved class <code>EntitySpawnAfterEvent</code> from ''beta'' to <code>1.6.0</code>.
* Moved class <code>EntitySpawnAfterEventSignal</code> from ''beta'' to <code>1.6.0</code>.
** Moved event/property <code>playerBreakBlock</code> from ''beta'' to <code>1.6.0</code>.
** Moved event/property <code>playerBreakBlock</code> from ''beta'' to <code>1.6.0</code>.
* Moved class <code>PlayerBreakBlockAfterEvent</code> from ''beta'' to <code>1.6.0</code>.
* Moved class <code>PlayerBreakBlockAfterEventSignal</code> from ''beta'' to <code>1.6.0</code>.
* Moved class <code>PlayerBreakBlockBeforeEvent</code> from ''beta'' to <code>1.6.0</code>.
* Moved class <code>PlayerBreakBlockBeforeEventSignal</code> from ''beta'' to <code>1.6.0</code>.
** Moved event/property <code>playerPlaceBlock</code> from ''beta'' to <code>1.6.0</code>.
* Moved class <code>PlayerPlaceBlockAfterEvent</code> from ''beta'' to <code>1.6.0</code>.
* Moved class <code>PlayerPlaceBlockAfterEventSignal</code> from ''beta'' to <code>1.6.0</code>.
* Moved class <code>BlockEventSignalOptions</code> from ''beta'' to <code>1.6.0</code>.
** Move <code>isAir(): boolean</code> from ''beta'' to <code>1.6.0</code>.
** Move <code>isLiquid(): boolean</code> from ''beta'' to <code>1.6.0</code>.
** Moved <code>amount</code> from ''beta'' to <code>1.6.0</code>.
** Moved <code>keepOnDeath: boolean</code> from ''beta'' to <code>1.6.0</code>.
** Moved <code>lockMode: ItemLockMode</code> from ''beta'' to <code>1.6.0</code>.
** Moved <code>nameTag?: string</code> from ''beta'' to <code>1.6.0</code>.
** Moved <code>clone(): ItemStack</code> from ''beta'' to <code>1.6.0</code>.
** Moved <code>getTags(): string[]</code> from ''beta'' to <code>1.6.0</code>.
** Moved <code>hasTag(tag: string): boolean</code> from ''beta'' to <code>1.6.0</code>.
** Moved <code>setCanDestroy(blockIdentifiers?: string[]): void</code> from ''beta'' to <code>1.6.0</code>.
** Moved <code>getCanDestroy(): string[]</code> from ''beta'' to 1.6.0.
** Moved <code>setCanPlaceOn(blockIdentifiers?: string[]): void</code> from ''beta'' to <code>1.6.0</code>.
** Moved <code>getCanPlaceOn(): string[]</code> from ''beta'' to <code>1.6.0</code>.
** Moved function <code>getProperty</code> to <code>1.6.0</code>.
** Moved function <code>resetProperty</code> to <code>1.6.0</code>.
** Moved function <code>setProperty</code> to <code>1.6.0</code>.
* Added function <code>getWeather</code>.

; [[JSON]]
* The <code>behavior.random_look_around_and_sit</code> now has the field <code>continue_sitting_on_reload</code>.
* <code>behavior.is_scenting</code> renamed to generic <code>behavior.timer_flag_1</code>.
* <code>behavior.is_rising</code> renamed to generic <code>behavior.timer_flag_2</code>.
* <code>behavior.is_feeling_happy</code> renamed to generic <code>behavior.timer_flag_3</code>.
* <code>behavior.timer_flag 1</code>: Fires an event when this behavior starts, then waits for a duration before stopping. When stopping due to that timeout or due to being interrupted by another behavior, fires another event. <code>query.timer_flag_1</code> will return <code>1.0</code> on both the client and server when this behavior is running, and <code>0.0</code> otherwise.
* <code>behavior.timer_flag 2</code>: Fires an event when this behavior starts, then waits for a duration before stopping. When stopping due to that timeout or due to being interrupted by another behavior, fires another event. <code>query.timer_flag_2</code> will return <code>1.0</code> on both the client and server when this behavior is running, and <code>0.0</code> otherwise.
* <code>behavior.timer_flag 3</code>: Fires an event when this behavior starts, then waits for a duration before stopping. When stopping due to that timeout or due to being interrupted by another behavior, fires another event. <code>query.timer_flag_3</code> will return <code>1.0</code> on both the client and server when this behavior is running, and <code>0.0</code> otherwise.

; [[Molang]]
* Added a new <code>query.is_in_lava</code> query function to Molang, to know if a mob is currently in [[lava]].

; [[Add-on|Render Dragon Features for Creators]]
* Disabled the "Deferred Technical Preview" on some Android devices that don’t support the current requirements for compute [[shader]]s (<code>GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS >= 256</code>).

== Fixes ==
{{fixes|project=MCPE|fixedin=1.20.40.22 Preview
|;From released versions before 1.20.0
|41103|Lava flowing down or fully spread out does not change to cobblestone when touched by water from the side.
|153254|Goat Horn has a very short sound range with other players.
|168913|Invalid data in <code>sound_definitions.json</code> can crash the game.
|169067|Editing sign in angle/side will edit back instead of the front.
|;From the version 1.20.0
|169666|Camels appear to slide when walking.
|172369|Camels indefinitely dash while in lava.
|172846|Camel's legs won't stop moving when idle.
|172917|There is no chat message for when skipping the night is not possible with <code>playerssleepingpercentage</code> set above 100.
|173028|"Detected lost connection" and "Abandoned connection closed" error message is untranslated.
|173189|[ScriptAPI] Some characters are counted as 2 or 3 characters in the character count check of the <code>setLore()</code> method.
|;From the previous development versions
|173934|Crash when enabling "Deferred Render" experimental feature.
|otherissuescount=3}}
; Others
* Fixed an extremely rare bug (~0.000003% chance) that could cause item frames to not drop their item when hit or destroyed.
* Fixed a bug where closing the game while having the portfolio open resulted in a crash.
* Autocompleting text now moves the caret to end of the line.</onlyinclude>

== References ==
{{reflist}}

== Navigation ==
{{Navbox Bedrock Edition versions|1.2x}}

[[Category:Bedrock Edition 1.20.40 betas]]
[[Category:Betas released in 2023]]

[[de:Bedrock Edition beta 1.20.40.22]]
[[es:Bedrock Edition beta 1.20.40.22]]
[[pt:Edição Bedrock Preview 1.20.40.22]]
[[uk:Preview 1.20.40.22 (Bedrock Edition)]]
[[zh:基岩版1.20.40.22]]
