Commands like /attribute
, /data merge storage
, /scoreboard
and others accept empty identifiers, which only work when the command is run from a command block and not through the chat (due to MC-65034).
How to reproduce:
Execute any of the following example commands through a command block (not in chat):
/attribute @p generic.max_health modifier add 2 add_value
/data merge storage {TestTag:1b}
/scoreboard objectives add dummy
(Note the double space where the identifier would usually go in each one of the above commands.)
Notice that the command block actually succeeds, and that you can interact with the attribute modifier/data storage/scoreboard objective you created by using subsequent commands.
Expected result:
A command with an empty identifier specified would fail.
Observed result:
A command with an empty identifier succeeds and actually creates an empty identifier.
Original description:
What happens:
The following command works when run in a command block (note that it doesn't work in chat due to MC-65034):
/attribute @p generic.max_health modifier add 2 add_value
(Note the extra space between 'add' and '2', which sets the identifier of the modifier to be an empty string)
On a related note, this command works in both the chat and in a command block, and creates a modifier with the same ID
/attribute @p generic.max_health modifier add minecraft: 2 add_value
In either case, the modifier can be removed by running the following command
/attribute @p generic.max_health modifier remove minecraft:
But it cannot be removed using this command, even in a command block
/attribute @p generic.max_health modifier remove
(Note the extra space after 'remove')
What is expected:
The attribute command should fail to run if no ID is provided, and an empty string should not count as a valid ID. Further, 'minecraft:' and 'example:' should also probably be invalid IDs, as they are only a namespace without an identifier name.
Comments 3
Upon further review, this is not limited to the attribute command at all. Empty identifiers can be used in other commands inside of command blocks, such as storage identifiers with the data command. There is still the issue of commands in chat working different than commands in command blocks though, since chat removes double spaces, and also with the trailing space being trimmed from command blocks that prevent removing the modifier with the empty string ID.
Thank you for your report!
After consideration, the issue is being closed as Working as Intended.
Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.
Full Version History – Snapshot Version History – The official Minecraft feedback site
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
Regarding the empty path of
minecraft:
identifiers, do resources such asdata/minecraft/worldgen/world_preset/.json
not result in such an identifier?