Skip to main content

Minecraft - 1.20.40 (Bedrock)

Updated Add-On Template Packs

  • Updated Add-On templates for 1.20.40 with new resources, behaviors, and documentation are available to download at aka.ms/MCAddonPacks

Stability and Performance

  • The Sounds definition file sound_definitions.json will no longer crash the game if the wrong json type is used for a specific sound definition (MCPE-168913)

Commands

  • Re-entering a world no longer breaks command autocomplete after a command using "@e[type=item]" was used (MCPE-164734)
  • The /damage command with the "override" cause now causes damage through post hit invulnerability (MCPE-160290)
  • The recipe command color has been changed to white instead of blue (MCPE-173362)

Mobs

  • Added a new “query.is_in_lava” Query Function to Molang, to know if a mob is currently in Lava

Molang

  • Molang updated to version 1.20.40 which replaces "block_property" and "has_block_property" with "block_state" and "has_block_state"
    • This is a Molang Versioned Change that only takes effect for Molang expressions in packs that use a min_engine_version of 1.20.40 or higher

Trade Tables

  • Trade items now have a "filters" property to determine if a trade should be considered
  • Trade items no longer support the "biome" property to check villager biome types, the "is_mark_variant" filter can be used in the "filters" property instead to check the villager biome type

Script API

  • Released World.getMoonPhaseMoonPhase, and MoonPhaseCount v1.6.0
  • Camera APIs moved from beta to 1.6.0
    • Camera 
      • setCamera
      • fade
      • clear
    • EasingType
    • CameraSetRotationOptions
    • CameraSetFacingOptions
    • CameraSetPostionOptions
    • CameraDefaultOptions
    • CameraSetLocationOptions
  • Changed the names of the CameraSetOptions options to not include the word 'Script'
  • Released Entity.is* APIs from beta to 1.6.0
    • isSleeping
    • isSneaking
    • isSprinting
    • isSwimming
    • isClimbing
    • isOnGround
    • isInWater
    • isFalling
  • Released Player level & XP APIs from beta to 1.6.0
    • addLevels
    • addExperience
    • level
    • getTotalXP
    • xpEarnedAtCurrentLevel
    • totalXpNeededForNextLevel
    • resetLevel
  • Released Player.is* APIs from beta to 1.6.0
    • isEmoting
    • isGliding
    • isJumping
    • isFlying
  • Updated all methods besides show on ActionFormDataMessageFormData, and ModalFormData to be callable in read-only mode
  • BlockInventoryComponent
    • container member variable now correctly reflects it can be a Container or undefined
  • Fixed a versioning bug preventing @minecraft/server-ui module from working with @minecraft/server above version 1.2.0
  • WeatherType moved to 1.6.0
    • Moved function setWeather to 1.6.0
    • Moved event/property entityRemove from beta to 1.6.0
    • Moved event/property entityRemove from beta to 1.6.0
  • Moved class EntityRemovedAfterEvent from beta to 1.6.0
  • Moved class EntityRemoveAfterEventSignal from beta to 1.6.0
  • Moved class EntityRemovedBeforeEvent from beta to 1.6.0
  • Moved class EntityRemoveBeforeEventSignal from beta to 1.6.0
    • Moved event/property entityLoad from beta to 1.6.0
  • Moved class EntityLoadAfterEvent from beta to 1.6.0
  • Moved class EntityLoadAfterEventSignal from beta to 1.6.0
    • Moved event/property entitySpawn from beta to 1.6.0
  • Moved enum EntityInitializationCause from beta to 1.6.0
  • Moved class EntitySpawnAfterEvent from beta to 1.6.0
  • Moved class EntitySpawnAfterEventSignal from beta to 1.6.0
    • Moved event/property playerBreakBlock from beta to 1.6.0
    • Moved event/property playerBreakBlock from beta to 1.6.0
  • Moved class PlayerBreakBlockAfterEvent from beta to 1.6.0
  • Moved class PlayerBreakBlockAfterEventSignal from beta to 1.6.0
  • Moved class PlayerBreakBlockBeforeEvent from beta to 1.6.0
  • Moved class PlayerBreakBlockBeforeEventSignal from beta to 1.6.0
    • Moved event/property playerPlaceBlock from beta to 1.6.0
  • Moved class PlayerPlaceBlockAfterEvent from beta to 1.6.0
  • Moved class PlayerPlaceBlockAfterEventSignal from beta to 1.6.0
  • Moved class BlockEventSignalOptions from beta to 1.6.0
    • Move isAir(): boolean from beta to 1.6.0
    • Move isLiquid(): boolean from beta to 1.6.0
    • Moved amount from beta to 1.6.0
    • Moved keepOnDeath: boolean from beta to 1.6.0
    • Moved lockMode: ItemLockMode from beta to 1.6.0
    • Moved nameTag?: string from beta to 1.6.0
    • Moved clone(): ItemStack from beta to 1.6.0
    • Moved getTags(): string[] from beta to 1.6.0
    • Moved hasTag(tag: string): boolean from beta to 1.6.0
    • Moved setCanDestroy(blockIdentifiers?: string[]): void from beta to 1.6.0
    • Moved getCanDestroy(): string[] from beta to 1.6.0
    • Moved setCanPlaceOn(blockIdentifiers?: string[]): void from beta to 1.6.0
    • Moved getCanPlaceOn(): string[] from beta to 1.6.0
    • Moved function getProperty to 1.6.0
    • Moved function resetProperty to 1.6.0
    • Moved function setProperty to 1.6.0
  • Moved getRotation from beta to 1.6.0
  • Move setRotation from beta to 1.6.0
  • Released PlayerDimensionChangeAfterEvent from beta to 1.6.0

Blocks

  • "minecraft:transformation" now prevents blocks from being transformed past the 30x30x30 pixel limit and "minecraft:unit_cube" from being translated or scaled. Invalid block will instead display the "update" block (MCPE-173799)
  • Chest blocks, Trapped Chest blocks, Ender Chest blocks, and Stonecutter blocks now use state "minecraft:cardinal_direction" instead of "facing_direction", this state uses string values ["south", "west", "north", and "east"] instead of [0, 1, 2, 3, 5, 6]

Items

  • Added a content error when attempting to load a damage sensor with an invalid "cause" value
  • Allow single value parsing for "minecraft:icon" item component
  • The Camel mob Dash Component can now be applied to rideable mobs other than Horse, Donkey, and Mule using “minecraft:dash
  • Deprecated "minecraft:weapon" component starting in version 1.20.40
  • Deprecated "minecraft:on_use" component starting in version 1.20.40
  • Deprecated "minecraft:on_use_on" component starting in version 1.20.40

Entity Components

  • Unlocked “behavior.random_search_and_dig” for creators to use

  • "target_blocks" field added. List of blocks that the mob can dig on. Default if "target_blocks" isn't added is Dirt, Grass, Podzol, Dirt with Roots, Moss, Mud, and Muddy Mangrove Roots

  • "item_table" field added. Path to a loot table that specifies what the mob can dig up. "item_table" takes precedence over "items"

  • Content errors added if the behavior has trouble reading or finding "item_table" and if unable to get an item from "items"

  • 'on_item_found' event now fires on item found AND digging finished. Before the event firing caused the digging to stop early

  • The “behavior.random_look_around_and_sit” now has the field “continue_sitting_on_reload” exposed for Creators to use. This is how the Camel stays sitting on reload

  • behavior.is_scenting” renamed to generic “behavior.timer_flag_1” and released to creators

  • behavior.is_rising” renamed to generic “behavior.timer_flag_2” and released to creators

  • behavior.is_feeling_happy” renamed to generic “behavior.timer_flag_3” and released to creators

  • behavior.timer_flag 1”: 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. query.timer_flag_1 will return 1.0 on both the client and server when this behavior is running, and 0.0 otherwise

  • behavior.timer_flag 2”: 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. query.timer_flag_2 will return 1.0 on both the client and server when this behavior is running, and 0.0 otherwise

  • behavior.timer_flag 3”: 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. query.timer_flag_3 will return 1.0 on both the client and server when this behavior is running, and 0.0 otherwise

Experimental Features

Script API

  • Added function getWeather
  • Added the chat(message: string) method
  • Changed ItemTypes.get to return ItemType | undefined
  • Changed source on ItemDefinitionTriggeredAfterEvent to be optional
  • Added the following methods to Player
    • above(steps?: number): Block | undefined;
    • below(steps?: number): Block | undefined;
    • north(steps?: number): Block | undefined;
    • east(steps?: number): Block | undefined;
    • south(steps?: number): Block | undefined;
    • west(steps?: number): Block | undefined;
    • offset(offset: Vector3): Block | undefined;
    • center(): Vector3;
    • bottomCenter(): Vector3;
    • Made getItemStack function return ItemStack or undefined
  • BlockStates
    • Made get function return BlockStateType or undefined
  • getSculkSpreader
    • Made getSculkSpreader return SculkSpreader or undefined
  • Updated ExplosionAfterEvent and ExplosionBeforeEvent
    • getUpdatedBlocks() will now return Block[]
    • setUpdatesBlocks(blocks: Block[]) now takes in a Block[]
  • Added the following methods to Player playMusic(trackId: string, musicOptions?: MusicOptions): void; queueMusic(trackId: string, musicOptions?: MusicOptions): void; stopMusic(): void;
  • Dynamic Properties
    • Property registration is no longer required and propertyRegistry has been removed from the worldInitialize event
    • Removed limits on the count and size of properties that can set on an entity or the world
    • Default values have been removed. getProperty will now always return undefined for unset properties
    • String dynamic property values are now restricted to a length of 32767 bytes
  • Dynamic Properties
    • Removed function removeDynamicProperty - Please use setDynamicProperty with a value of undefined to remove a property
    • Added function getDynamicPropertyIds - Returns an array of all dynamic property ids on an entity/world used by the behavior pack
    • Added function getDynamicPropertyTotalByteCount - Returns the total number of bytes used by all dynamic properties on an entity/world by the behavior pack
    • Added function clearDynamicProperties - Removes all dynamic properties added by this behavior pack from an entity/world
  • Dynamic Properties
    • Dynamic property numbers are now stored with double precision (64 bits)
  • Adding PlayerInteractWithBlock + PlayerInteractWithEntity before & after events
  • Adding PlayerDimensionChangeBeforeEvent and PlayerDimensionChangeAfterEvent in beta
  • Added matches function called on an entity, which takes in EntityQueryOptions and returns true if the entity matches and false otherwise
  • Added PlayerLeaveBeforeEvent - This event fires when a player leaves the server, before the Player object is removed