Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-247034

Particles produced from entities growing cannot be seen by other players

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.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
    • None
    • Confirmed
    • Networking, Particles
    • Low
    • Platform

      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 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)

        1. MC-247034.mp4
          6.32 MB
        2. MC-247034.png
          MC-247034.png
          2.18 MB
        3. MC-247034 - Analysis.png
          MC-247034 - Analysis.png
          1.78 MB

            Unassigned Unassigned
            Avoma [Mod] Avoma
            Votes:
            8 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              CHK: