mojira.dev
MC-260602

'data modify from string' index failure does not return 0 for 'execute store success'

Issue/Expected result:{*}{*}

If you attempt to data modify from a string, but your end exceeds the length of the string, the command returns "unexpected error".

The expected result in my opinion is that since the command failed, we get a success of 0, however, as you will see, success erroneously returns 1

Steps to reproduce:

 

#simple setup for the following code to work
/summon marker ~ ~ ~ {Tags:["example"]}
/scoreboard objectives add test dummy
/scoreboard objectives setdisplay sidebar test
#Correctly success=1, marker->data.message has 'over'
/execute store success score @p test run data modify entity @e[type=marker,tag=example,limit=1] data.result set string entity @p SpawnDimension 10 14
#Marker data does not update, however, success is still true
/execute store success score @p test run data modify entity @e[type=marker,tag=example,limit=1] data.result set string entity @p SpawnDimension 10 100

Comments 2

I met the same thing.

This command does not return 1, it just skips execute store process.

scoreboard players set @p test 901247831
execute store success score @p test run data modify storage minecraft:test a set string storage minecraft:test a 100 // throws unexpected error
scoreboard players get @p test // returns 901247831

This commands skips execute store process due to unhandled exception; This command does not return 1, it just does not change the scoreboard.

By the fact that the command does not change the scoreboard, you can detect command failure.

still occurs at 23w14a

I also able to reproduce this

paulo khayat

slicedlime

Community Consensus

Platform

Normal

Commands, Save Data

1.19.4 Pre-release 1, 23w14a

1.20 Pre-release 2

Retrieved