跳到主要内容

Minecraft Beta - 1.18.20.21 (Xbox / Windows / Android)

  • A world with "StorageVersion" 8 or lower will be increased to 9 and have its "RandomSeed" upgraded from using only the lower 32 bits of a 64-bit number to using the full 64-bit range while still representing the same number. This is only relevant for negative 32-bit seeds, which need a sign bit extension

**Additional Modding Capabilities Experiment/JavaScript APIs

**

Important! In this release and starting with this beta, we are removing the Additional Modding Capabilities experiment.  This experiment contained experimental JavaScript APIs launched in 2018 – and with this removal, JavaScript within worlds associated with this API will no longer function.  GameTest Framework – a separate JavaScript API – should not be impacted, nor should behavior pack/resource pack type add-ons more broadly. You can read more about this via this article.

 Commands

  • Added '/tickingarea' command preload overload
  • Entities must now be loaded for an area to be considered fully loaded and ticking

Molang

  • Molang expressions inside animation scripts for actor resource definition (pre_animation and initialize) that contain capital letters are properly evaluated now with format_version 1.18.20 or higher

User Interface

  • The loading progress screen now shows when loading ticking areas marked for preload

实验性特性

Commands

  • Added a new '/volumearea ' command to create, remove, and list volumes in the world

GameTest Framework

New Module! We added a mojang-minecraft-ui module with API structures for creating simple dialog boxes:

  • Added ActionFormData/ModalFormData/MessageFormData types in the mojang-minecraft-ui namespace. More documentation on the new namespace will be showing up on the Minecraft Creator documentation site.

mojang-minecraft module updates:

  • World
    • Updated property directionto blockFace in world.events.beforeItemUseOn and world.events.itemUseOn

      • Added event World.event.beforeDataDrivenEntityTriggerEvent - Fires before the data driven trigger is applied
      • Added event World.event.dataDrivenEntityTriggerEvent - Fires after the data driven trigger is applied
      • For the above events, each accept an optional EntityDataDrivenTriggerEventOptions
    • (Breaking Change) property entityremoved

    • Added property entities: Entity[] - If specified, will restrict to just the specified entities

    • Changed return type of function getPlayersto PlayerIterator

  • EntityDataDrivenTriggerEventOptions
    • Inherited from EntityEventOptions

    • property eventTypes: string[] - If specified, will restrict to events with the specified name (I.E minecraft:ageable_grow_up)

    • (Inherited) property entities: Entity[] - If specified, will restrict to just the specified entities

    • (Inherited) property entityTypes: string[] - If specified, will restrict to entities with the specified type (I.E minecraft:creeper)

  • DefinitionModifier
    • read only property componentGroupsToAdd: string[] - List of component groups that will be added as part of this modifier

    • read only property componentGroupsToRemove: string[] - List of component groups that will be removed as part of this modifier

    • property triggers: Trigger[] - List of triggers that will fire as part of this modifier

  • Trigger
    • property eventName: string - Event name of the trigger

  • DataDrivenEntityTriggerEvent
    • read only property entity: Entity - Entity that the event triggered on

    • read only property id: string - name of the event

  • BeforeDataDrivenEntityTriggerEvent
    • read only property entity: Entity - Entity that the event triggered on

    • read only property id: string - name of the event

    • property modifiers: DefinitionModifier[] - List of modifiers that will be applied when the event triggers

    • property cancel: bool - If true, the event will not be triggered

  • EnchantmentType
    • Added EnchantmentType class

    • Read-only property id: string - The name of the enchantment type

    • Read-only property maxLevel: int - The maximum level this type of enchantment can have

  • EnchantmentInstance
    • Added EnchantmentInstance class. This represents a binding of an EnchantmentType and level that can be added to an item

    • Constructor EnchantmentInstance(type: EnchantmentType, level : int)

    • Read-only property type: EnchantmentType - The enchantment type of this instance

    • Property level: int - The level of this enchantment instance

  • EnchantmentSlot
    • Added EnchantmentSlot enum. This enum represents the item slot or type that an enchantment can be applied to

  • EnchantmentList
    • Added EnchantmentList class. This class represents a collection of enchantments that can be applied to an item

    • Constructor EnchantmentList(slot : EnchantSlot)

    • Read-only property slot: EnchantSlot - The item slot/type that this collection is to be applied to

    • Read-only property allEnchantments: EnchantmentInstance[] - All enchantments as part of this enchantment collection

    • Method canAddEnchantment(instance : EnchantmentInstance): bool - Returns whether or not the provided EnchantmentInstance can be added to this collection

    • Method addEnchantment(instance : EnchantmentInstance): bool - Attempts to add the enchantment to this collection. Returns true if successful

    • Method removeEnchantment(type : EnchantmentType)- Removes an EnchantmentInstance with type type from this collection if present

    • Method hasEnchantment(type : EnchantmentType): int - If this collection has an EnchantmentInstance with type type, returns the level of the enchantment. Returns 0 if not present

  • ItemEnchantmentComponent
    • Added ItemEnchantmentComponent Item component class.
      |
  • ItemStack
    • Property enchantments: EnchantmentList - Gets a copy of the current set of enchantments on this ItemStack. Or allows the user to set the EnchantmentList for the ItemStack
    • Method removeAllEnchantments- Removes any enchantments that might be present on this ItemStack
    • Added function setLore(loreList: string[]): void- Sets the lore text for the item
    • Added function getLore(): string[]- Gets the lore text for the item