The Bug
When setting certain NBT fields to invalid characters (such as ? and =), an exception is outputted in the log. A large amount of exceptions can cause lag to most systems.
Examples of some fields that cause errors when invalid characters are entered include RecipesUsed, LootTable, Name, and possibly more.
Steps to Reproduce (Direct)
Run the command specified for all situations below, then look in the game logs. Note if there is a stack trace exception or not.
Placing Suspicious Sand with invalid LootTable:
Place down the block this command gives you, and check the log.
/give @s minecraft:suspicious_sand[minecraft:block_entity_data={id:brushable_block,LootTable:"?"}]FallingBlock entity with invalid Name:
This displays an error message in chat as well.
⚠️ Running the command below in a repeating command block causes high MSPT lag.
/summon minecraft:falling_block ~ ~ ~ {BlockState:{"Name":"?"}}FallingBlock entity with invalid LootTable:
/summon minecraft:falling_block ~ ~ ~ {BlockState:{"Name":"suspicious_sand"},TileEntityData:{LootTable:"?"}}Steps to Reproduce (Spawner)
⚠️ This may cause severe FPS lag.
Run the command below (attempting to right-click this spawn egg on the ground will also output an exception and not spawn anything):
/give @s minecraft:breeze_spawn_egg[minecraft:entity_data={id:arrow,inBlockState:{Name:"?"}}]Place a monster spawner below you, and right-click the spawner with the spawn egg.
Run the command below while on top of the spawner:
/data modify block ~ ~-1 ~ SpawnData.entity.inBlockState set value {Name:"?"}View the game logs and note if stack trace exceptions are spammed or not.
Observed Results
Exceptions are sometimes spammed to the game's log. In some cases, an FPS and TPS drop is noticeable. In the case of the spawner bug, errors continue to be spammed even when on the Esc menu in singleplayer.
The log file can also be huge due to these exceptions being spammed.
See the following text files for the exceptions experienced. They are all named respective to the thing which caused it.
Expected Result
There would be no spammed exceptions. Instead, an error message could be logged informing the player of the issue.
Attachments
Comments 6
I've added the exceptions that occur for each case in its separate text file, as otherwise, the description would be too large. Please let me know if the exceptions need to be in the description.
Thanks, I've added the main error message to the description directly. It's possible that this counts as two distinct bugs (one for loot table, the other for name) since the error messages are different.
No that's not necessary. Checking the exceptions further, the "Loading entity NBT" errors are also caused by the same underlying exception of non-[a-z0-9/._-] characters in the resource location. The main issue here is that the message is spammed and the client lags.
What's the exact exception / error message that shows up in the log when these happen? Please add that as "Observed behavior".