跳到主要内容

Minecraft Beta & Preview - 1.19.60.22

Components

  • Added "inventory" as a possible "domain" value for the "has_equipment" filter, which allows to check for items stored in the actor's inventory
  • Added an "equip_item_slot" field to the "interact" component
    • If set, an item held by the player will be equipped to the specified slot upon successful interaction
    • If an item is already present in the specified slot, it will be moved to the player's inventory
    • Equipping an item removes it from the player's inventory, unless the player is in Creative Mode

Technical Experimental Features

Script API

  • Block

    • Added function getRedstonePower(): number- Gets the Redstone signal strength of the Block if it is part of a circuit, otherwise returns undefined
  • Added /scriptevent command as part of the Beta APIs experiment. This is what will trigger system.events.scriptEventReceive events (see below)

    • Usage: /scriptevent <messsageId: string> [message: ???]

    • messageId must be namespaced, use of the minecraft namespace is invalid (e.g. "/scriptevent give:coal", "/scriptevent my_scripts:spawn_sheep")

    • message is optional, with a max length of 256 characters

  • events.scriptEventReceive

    • Added system event events.scriptEventReceive

    • Added read-only property id: String_-_ The namespaced ID of the event

    • Added read-only property message: String- The content of the message the event was sent with

    • Added read-only property sourceBlock: Block- The command block that triggered/executed the command call if applicable, otherwise undefined

    • Added read-only property sourceEntity: Entity- The player/entity that executed the command call if applicable, otherwise undefined

    • Added read-only property initiator: Entity- The player that caused an NPC to execute the command call if applicable, otherwise undefined

    • Added read-only property sourceType: MessageSourceType- The type of source the event was triggered by

    • _subscribe()_can filter by valid namespace string using the ScriptEventMessageFilterOptions class

  • ScriptEventMessageFilterOptions

    • Added ScriptEventMessageFilterOptions class
    • Added property namespaces: string[]- An array of namespaces to filter on
  • Simulated Player

    • Added property isSprinting- Used to get or set if the sprinting state of the simulated player is set to true

General

  • Ensure Block Permutation Conditions cannot have side effects (i.e. 'math.random', 'math.random_integer', and variable assignment)