mojira.dev
MC-255915

/data modify gives inaccurate error when value types don't match

The bug

When modifying NBT with the /data modify command but mismatching the type of value, it gives an inaccurate error message.

How to reproduce

  1. Run these two commands:

    /data modify storage a:b c set value [1,2]
    /data modify storage a:b c append value [3,4]
  2. Note the presented error message

Expected behaviour

It should give an error along the lines of (in this case);

List is of type Integer, cannot insert values of type List

Actual behaviour

This error is displayed instead:

Nothing changed. The specified properties already have these values

Notes

The current error message is generic, and assumes that if the operation failed, the specified values already exist, eventhough there could be a different reason why it didn't work. Therefor this error message is entirely wrong.

The error message could potentially report the specific types that are mismatching like suggested above, by using variables in the string, but should at least state that it is indeed about value types mismatching and not about something else.

Attachments

Comments 2

Can confirm in 1.19.3 and 23w06a

Jack McKalling

(Unassigned)

Confirmed

Platform

Low

Commands

1.19.2, 1.19.3, 1.21

Retrieved