Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-271112

The set_attributes loot function only allows floats while the item component supports doubles

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.5
    • None
    • Confirmed
    • Commands
    • Low
    • Platform

      Expected behaviour:

      As the item component "attribute_modifiers" supports doubles, the "set_attribute_modifiers" loot table function should also support doubles.

      Observed behaviour:

      When modifying an item's data with /data or directly putting an attribute in the /give command, you have the full 'double' range of values. But when using an item modifier with "set_attribute_modifiers", the value gets converted to a float with less precision.

       

      How to reproduce:

      • Install the attached Datapack (1.20.5)
      • /reload
      • Run "/function report:run", it will give you a stone and a grass block.
      • Use "/data get entity @s SelectedItem" on both items and notice how the attribute values don't match, despite being the same in the datapack function.

            Unassigned Unassigned
            SilicatYT Silicat Youtube
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: