mojira.dev
MC-93826

Breeding hearts only show once and not all the time an animal can breed anymore

The bug

In 1.8.8 and maybe later animals which can breed showed hearts the whole time they were able to breed.

Now the hearts are only shown once.

The reason

The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.

The reason why this happens is because the client never receives the InLove value from the server. In 1.8.9 and earlier the method net.minecraft.entity.EntityAgeable.getGrowingAge() (MCP 9.10) returned for the client the stored value whether or not the animal is a child (for 1.8 entry 12 of the data watcher, for 1.9 net.minecraft.entity.EntityAgeable.field_184751_bv). In 1.9 it returns -1 if the animal is a child, 1 if it is not. This breaks some logic for the net.minecraft.entity.passive.EntityAnimal class.

Besides that the client should receive the InLove value because neither in 1.8.9 nor in the latest versions summoning an animal with InLove greater than 0 shows particles.

/summon pig ~ ~ ~ {InLove:2147483647}

Note: The server should not run the particle spawning code of the method net.minecraft.entity.passive.EntityAnimal.onLivingUpdate().

Related issues

Attachments

Comments

migrated
[media][media]
Fusseel

Issue still exists up to latest version, Minecraft 1.9.1-pre3.

Fusseel

I do not quiet understand the reason that was given by Marcono1234. It was working in 1.8 and prior versions, why does it only occur since the 1.9 snapshots? Clients are using an internal server since 1.3, so the issue should have appeared back then already, but it did not. So why now in 1.9?

marcono1234

You are right, I kind of messed up yesterday. The reason seems to be that the client does not receive the InLove value anymore, because in 1.8 the client had the correct InLove value, in 1.9 it does not. I will update the report in a moment.

Fusseel

Still not fixed in 16w15a.

Fusseel

Still present in 1.9.3-pre2.

migrated

Present in 1.9.4 & 16w21b

Also might want to add MC-88230 as a related ticket.

tryashtar

Still here up through 16w42a.

migrated

Exists in 16w43a

Fusseel

1.12 is affected

Fusseel

Still an issue in 1.13.

muzikbike

Reproduced in 1.13.2

TheBoy358

Confirmed in 19w04b, 19w05a and 19w06a.

Fusseel

Confirmed for 19w14b. Really hoping this is fixed soon since a lot of related bugs were taken care of very recently. 

TheBoy358

Confirmed in 19w38b.

TheBoy358

Confirmed in 19w45a.

TheBoy358

Confirmed in 19w45b.

TheBoy358

Confirmed in 19w46b.
 

migrated

Confirmed 1.15.2 FIX THIS BUG please

Orbic

Still in 20w09a

numeritos

Affects 1.16-rc1

Avoma

Can confirm in 20w51a.

Avoma

Can confirm in 21w03a.

Avoma

Can confirm in 21w05a.

migrated

Affects 1.17 Pre-release 1

Orbic

In 1.17

ampolive

Can confirm in 1.17.1.

Orbic

Can confirm for 1.18 Pre-1

Orbic

In 22w05a, actually was quite annoying in experience of trying to breed a blue Axolotl 

Orbic

In 1.19 Pre-1

Orbic

Can confirm for 1.19 Pre-2

Orbic

Affects 1.19 Pre-3

Orbic

In 1.19 Pre-4

Orbic

In 1.19 Pre-5

Jeuv

Still in 1,19.2.

Orbic

In 22w44a

Orbic

Can confirm for 22w46a

muzikbike

Can confirm in the 1.20.2 release candidate.

BeeTeeKay

Can confirm in 24w19b and release 1.20.6

BeeTeeKay

Affects 1.21

insane96mcp

This is easily fixed

Using Mojmaps 1.20.1
In the aiStep method the code calls the addParticles method but as pointed out by other users the inLove ticks aren't sent client side.

if (this.inLove > 0) {
  --this.inLove;
  if (this.inLove % 10 == 0) {
      double d0 = this.random.nextGaussian() * 0.02D;
      double d1 = this.random.nextGaussian() * 0.02D;
      double d2 = this.random.nextGaussian() * 0.02D;
      this.level().addParticle(ParticleTypes.HEART, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), d0, d1, d2);
  }
}

This can be fixed by checking if the code is running server side and then send the particles to clients

if (this.inLove > 0) {
  --this.inLove;
  if (this.inLove % 10 == 0) {
    double d0 = this.random.nextGaussian() * 0.02D;
    double d1 = this.random.nextGaussian() * 0.02D;
    double d2 = this.random.nextGaussian() * 0.02D;
    //Note, I didn't use the speed calculated above
    if (this.level instanceof ServerLevel serverLevel)
      serverLevel.sendParticles(ParticleTypes.HEART, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), 1, 0, 0.1f);
  }
}
Duffy Springpat

Still in 1.21.5 and 1.21.6 snapshots.

marcono1234

(Unassigned)

Confirmed

Gameplay

Low

Mob behaviour

animal, breeding, hearts, particle

Minecraft 15w33c, Minecraft 15w49b, Minecraft 16w06a, Minecraft 1.9.1 Pre-Release 3, Minecraft 16w15a, ..., 22w44a, 22w46a, 1.20.4, 24w11a, 1.21

Retrieved