Mojira Archive
MC-269068

Inconsistent display of 'default' components

It seems that ALL items currently have at least 4 components:

  • lore
  • enchantments
  • attribute_modifiers
  • repair_cost

These have the default values: [], {levels:{}}, {modifiers:[]}, 0

On the other hand:

components like

  • custom_name
  • can_break
  • can_place_on
  • custom_data
  • ...

Do not have any 'defaults'

so they simply are not always on each item.

 

However, trying to set the value for these to a reasonable default, makes for unusual behavior.

Trying to remove ( using `!<component>: {}` syntax in an item modifier) these components will result in 'success' without actually modifying the item or removing the component.

Further. The top 4 components show up on every item in the tooltip '4 component(s)'. But using '/data get ...', the `components:` data contains 0 such elements.

This is quite misleading.

 

Reproduction steps:

Grab any regular item like a stick (f3+h to enable tooltips)

4 Components are displayed as a . minimum

Now use /data get @s SelectedItem.

Observe how no components show up (bc they're default)

 

Consistency

It would be reasonable to either hide the `X component(s)` on items when the value is default.

Then, for any REMOVED components (e.g. removing damage from a sword) it should have a tooltip `X removed component(s)`

 

For the `/data get` command, the result should display the default values.

Invalid

AgentM

2024-03-03, 01:51 PM

2024-03-04, 02:17 PM

2024-03-04, 02:17 PM

0

0

Confirmed

(Unassigned)

24w09a

-