跳到主要内容

Minecraft Beta & Preview - 1.19.70.22

Entity Properties

  • Fixed an issue where Entity Property value changes could be discarded if done by events fired as part of removal of active behaviors caused by other events

实验性特性

Script API

Replaced general setVelocity call with methods to apply impulses to entities:

  • Added function clearVelocity(): void- Sets the current velocity of the Entity to zero
  • Added function applyImpulse(vector: Vector3): void- Applies impulse vector to the current velocity of the Entity
  • Added function applyKnockback(directionX: number, directionZ: number, horizontalStrength: number, verticalStrength: number): void- Applies knockback to the Entity in specified direction based on vertical and horizontal strength
  • Removed function setVelocity

General changes to more consistently use methods when working with simple data-only objects vs. properties:

  • BeforeExplosionEvent
    • Added function getImpactedBlocks(): Vector3[]- Gets the blocks locations that are impacted the by the explosion
    • Added function setImpactedBlocks(blocks: Vector3[]): void- Sets the blocks locations that are impacted the by the explosion
    • Removed property impactedBlocks
  • BeforeItemUseOnEvent
    • Added function getBlockLocation(): Vector3- Gets the location of the block being impacted
    • Removed property blockLocation
  • BlockInventoryComponent
    • Removed property location
  • BlockLavaContainerComponent
    • Removed property location
  • BlockPistonComponent
    • Added function getAttachedBlocks(): Vector3[]- Gets the blocks locations that are impacted by the activation of this piston
    • Removed property attachedBlocks
    • Removed property location
  • BlockPotionContainerComponent
    • Removed property location
  • BlockRecordPlayerComponent
    • Removed property location
  • BlockSignComponent
    • Removed property location
  • BlockSnowContainerComponent
    • Removed property location
  • BlockWaterContainerComponent
    • Removed property location
    • Added function getHeadLocation(): Vector3- Gets the head location of the Entity
    • Removed property headLocation
  • ExplosionEvent
    • Added function getImpactedBlocks(): Vector3[]- Gets the blocks locations that are impacted the by the explosion
    • Removed property impactedBlocks
  • ItemStartUseOnEvent
    • Added function getBlockLocation(): Vector3- Gets the location of the block being impacted
    • Added function getBuildBlockLocation(): Vector3- Gets the location of the resulting build block
    • Removed property blockLocation
    • Removed property buildBlockLocation
  • ItemStopUseOnEvent
    • Added function getBlockLocation(): Vector3- Gets the location of the block being impacted
    • Removed property blockLocation
  • ItemUseOnEvent
    • Added function getBlockLocation(): Vector3- Gets the location of the block being impacted
    • Removed property blockLocation
  • NavigationResult
    • Added function getPath(): Vector3[]- Gets the locations of the blocks that comprise the navigation route
    • Removed property path
  • Player
    • Added function getHeadLocation(): Vector3- Gets the head location of the Player
    • Removed property_headLocation_

ItemStack API improvements:

  • Added read-only property getMaxAmount: number- Returns the maximum stack size for the item
  • Added read-only property isStackable: bool- Returns whether the item is stackable
  • Added function isStackableWith(itemStack: ItemStack): bool- Returns whether the item can be stacked with the given item
  • Added read-only property type: ItemType- Returns the type of the item
  • Added function clone(): ItemStack- Returns a copy of the item stack
  • Added property keepOnDeath: bool- Sets whether the item is kept on death
  • Added property lockMode: ItemLockMode- Sets whether the item can be moved or dropped
  • Added function setCanPlaceOn(blockIdentifiers?: string[])- Sets which blocks the item can be placed on
  • Added function setCanDestroy(blockIdentifiers?: string[])- Sets which blocks this item can destroy