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:
- Get two players and label them "Player A" and "Player B".
- Have "Player A" obtain some wheat and summon a baby cow by using the command provided below.
/summon minecraft:cow ~ ~ ~ {NoAI:1b,Age:-25000} - Get "Player B" to look at the baby cow and have "Player A" feed it multiple pieces of wheat.
- 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)