Mojira Archive
MCM-1640

1.19.70 beta creator API method BlockPermutation.resolve() fails to resolve custom block properties

Partner Rank: 2 (Important)

Partner Team Reporting: Oreville Studios

Verification builds and Platforms: 1.19.70.24_rc0

Summary:

Using the native resolve() method to resolve custom block permutations with the beta creator APIs as part of the BlockPermutation class fails to resolve all custom block properties in 1.19.70.

 

For example, if a custom block at 0, -60, 0 with the identifier of test:color_block with a block property of test:color with valid values of "red" and "blue" is attempted to be resolved with the "blue" block property using the resolve() method with the following JavaScript:

 
const blueColor = BlockPermutation.resolve("test:color_block", { "test:color": "blue" });
world.getDimension("overworld").getBlock({ x: 0, y: -60, z: 0 }).setPermutation(blueColor);

then the following content log will be thrown:

[Scripting][error]-Failed to resolve block "test:color_block" with properties {"test:color":"blue"}

 

Omitting property arguments from the .resolve() method, however, will allow custom block permutations to be resolved. The following JavaScript will successfully resolve a custom block permutation with the default block properties without throwing a content log error:

 
const defaultColor = BlockPermutation.resolve("test:color_block");
world.getDimension("overworld").getBlock({ x: 0, y: -60, z: 0 }).setPermutation(defaultColor);
 

We are currently able to successfully change and write custom block permutations with the beta APIs in 1.19.63 using IntBlockProperty.value, BoolBlockProperty.value, and StringBlockProperty.value, but in 1.19.70 these were deprecated in favor of .resolve().

 

Impact:

While this does not impact any live content nor intend to ship any products with beta APIs, leaving this issue unresolved will significantly decrease our ability to swiftly develop important upcoming content because we rely heavily on the ability to be able to change and manipulate custom block permutations during the development process using the beta APIs.

 

Repro Steps:

  1. Download and start the world attached to this bug report.
  2. Click the button that says "Press Button to Change to Red Block Permutation" or the button that says "Press Button to Change to Red Block Permutation". This will trigger a script event that should change the block next to the button to either a red or blue block.

Observed Results:

The block permutation does not change and an error appears in the content log.

Expected Results:

The block permutation should change to the specified permutation when you click the button and no error should appear in the content log.

Screenshots/Videos attached: No.

Regression Builds: 1.19.63

Notes: See attachments for a copy of the repro world. Resolving vanilla properties works as expected and can be verified in the world by clicking the buttons labeled "Press Button to Change to Dry Sponge Permutation" and "Press Button to Change to Wet Sponge Permutation". Resolving default permutations for both vanilla and custom blocks can also be verified working in game by clicking the buttons labeled as "Press Button to Change to Default Color Block Permutation" and "Press Button to Change to Default Sponge Permutation"

Unresolved

Lukas Voigts

2023-02-26, 09:05 PM

2023-03-03, 11:22 PM

2

0

Future Release

-