When you summon an Area Effect Cloud which displays an "item" particle, the particle returns to the default "entity_effect" particle after relogging.
How to reproduce:
1. Summon an Area Effect Cloud using the following command:
/summon minecraft:area_effect_cloud ~ ~ ~ {Duration:1000,Radius:1.0f,Particle:"minecraft:item minecraft:cooked_chicken"}
The Area Effect Cloud will display cooked_chicken particles that would display when you eat a cooked_chicken. However, if you then get the entity data of the Area Effect Cloud using the following command, you will see that the item is no longer specified.
/data get entity @e[type=minecraft:area_effect_cloud,limit=1,sort=nearest] Particle
The command will return: Area Effect Cloud has the following entity data "minecraft:item "
even though you would expect "minecraft:item minecraft:cooked_chicken"
2. Relog. After relogging, the Area Effect Cloud will display its default "entity_effect" particle. This behaviour does not occur with any other particle.
*Code analysis by @intsuc*
https://bugs.mojang.com/browse/MC-169828?focusedCommentId=636817&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-636817
Item names are not serialized because of the incorrect usage of StringBuilder. Item ids are used for its initial capacity.
// net.minecraft.commands.arguments.item.ItemInput
public String serialize() {
StringBuilder builder = new StringBuilder(Registry.ITEM.getId(item));
if (tag != null) {
builder.append(tag);
}
return builder.toString();
}
It should be
new StringBuilder(Registry.ITEM.getKey(item).toString())
Confirmed for 1.15.2 and 20w08a.
Code analysis
Item names are not serialized because of the incorrect usage of
StringBuilder
. Item ids are used for its initial capacity.It should be