mojira.dev
MCPE-234752

Disabling custom block icon auto-scaling in GUIs results in incorrect visual shift

Custom block model definitions support defining item display transformations to change how the auto-generated icon for a block appears in various contexts. The GUI context supports a special property, fit_to_frame, that determines if the generated icon should be auto-scaled to a constrained frame context (such as inventory slots). This property is enabled by default. Manually setting this property to false causes otherwise correctly framed icons to be shifted to the right in the command auto-complete interface.

Workaround possible

This bug can be manually worked around by carefully injecting zero-size cubes at specific locations into a separate model provided to the minecraft:item_visual component.

Demonstration

The following screenshot shows this bug in action:

CleanShot 006673.png

Note that the icon for bug_icon:custom_block_with_bugged_icon is incorrectly offset to the right. Despite this, the general UI icon is the same between both blocks:

CleanShot 006674.png

Reproduction

This example is taken from the behavior pack in the following world attached for convenience:

[media]

This world can be opened (in Minecraft Preview) for inspection or unzipped to access the code associated with such. Also included is a parallel block whose icon is not bugged in the command auto-complete list.

Attachments

Comments 3

For anyone wondering why this was marked as “Won’t Fix”, it’s because it was fixed… in newer geometry file format versions. The solution was tested with 1.26.30, and all seemed to render correctly.

This bug was more correctly “fixed” in https://feedback.minecraft.net/hc/en-us/articles/46506466842125-Minecraft-Beta-Preview-26-40-22-23:

  • Small geometries using the "item_display_transforms" -> "gui" -> "fit_to_frame": false option will now be properly centered in format_version 1.21.130 and above (MCPE-234752)

However, the geometry itself is now incorrectly centered in the space, even if the model/display configurations did not indicate such.

The attempted fix of this bug has led to a new bug: MCPE-240720.

Ciosciaa

(Unassigned)

1545734

Confirmed

Multiple

26.0.27 Preview

26.40

Retrieved