跳到主要内容

Minecraft Beta & Preview - 1.19.70.23

实验性特性

Script API

BlockPermutation

BlockPermutation has been significantly refactored! Every BlockPermutation now share a unique JavaScript handle so exact equality (===) will work for permutations that share exactly the same state values. We've also added utility methods that make interacting with permutations easier, which includes the removal of the XBlockProperty classes and now directly return properties (boolean | number | string) or a while collection of properties ( Record<string, boolean | number | string>__).

  • Added method _matches(blockName: string, properties?: BlockProperties): boolean_which is used to match a block with optional states against a BlockPermutation.
  • Added method _withProperty(name: string, value: boolean | number | string): BlockPermutation;_which returns a new block permutation with a given property set to a specific value. Throws if the provided data cannot be resolved as a valid block permutation.
  • Added function _static resolve(blockName: string, properties?: BlockProperties): BlockPermutation_which resolve a BlockPermutation from a block name and optional states. Throws if the provided data cannot be resolved as a valid block permutation.
  • Updated methods _getProperty_and getAllProperties to return values directly instead of wrapped into class objects. Example code: Before:

_const blockPermutation = MinecraftBlockTypes.stoneSlab.createDefaultBlockPermutation();__blockPermutation.getProperty(MinecraftBlockProperties.stoneSlabType).value = 'stone_brick';__blockPermutation.getProperty(MinecraftBlockProperties.topSlotBit).value = true;

_

Now:

const blockPermutation = BlockPermutation.resolve('minecraft:stone_slab', {    stone_slab_type: 'stone_brick',    top_slot_bit: true,__}); 

BlockProperties

Added new class to expose BlockPropertyType.

BlockPropertyType

Added new class to track "definitional" data about block properties. This is how you can find which values are valid for each block property.

Blocks

  • Released block properties and permutations out of experimental in JSON formats 1.19.70 and higher
  • Added a content warning when loading world with more than 65536 custom block permutations. Custom block permutation counts are logged in debug log