Mojira Archive
MC-247034

Particles produced from entities growing cannot be seen by other players

The Bug:

When a player feeds a baby entity its desired food, green growth particles can only be seen by the person who fed the entity, and not other players.

Steps to Reproduce:

  1. Get two players and label them "Player A" and "Player B".
  2. Have "Player A" obtain some wheat and summon a baby cow by using the command provided below.
    /summon minecraft:cow ~ ~ ~ {NoAI:1b,Age:-25000}
  3. Get "Player B" to look at the baby cow and have "Player A" feed it multiple pieces of wheat.
  4. Take note as to whether or not growth particles can be seen by other players.

Observed Behavior:

Green growth particles can only be seen by the person feeding the entity its desired food, and not other players.

Expected Behavior:

Green growth particles would be seen by all players.

Code Analysis:

Code analysis by [Mod] Avoma can be found below.

The following is based on a decompiled version of Minecraft 1.18.1 using MCP-Reborn.

net.minecraft.world.entity.AgeableMob.java
public abstract class AgeableMob extends PathfinderMob {
   ...
   public void aiStep() {
      super.aiStep();
      if (this.level.isClientSide) {
         if (this.forcedAgeTimer > 0) {
            if (this.forcedAgeTimer % 4 == 0) {
               this.level.addParticle(ParticleTypes.HAPPY_VILLAGER, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), 0.0D, 0.0D, 0.0D);
            }
            ...

If we look at the above class, we can see that particles produced from entities growing are only produced client-side. This is evident through the following line of code:

if (this.level.isClientSide)

Unresolved

[Mod] Avoma

2021-12-29, 03:02 PM

2024-12-09, 01:18 PM

9

5

Confirmed

Low

Platform

Networking, Particles

1.18.1 - 1.21.41.18.1, 22w03a, 22w05a, 22w06a, 22w07a, 1.18.2 Pre-release 1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 23w18a, 1.20.1, 1.21, 1.21.4

-