PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
10.02k stars 2.32k forks source link

Aquatic creatures spawned using buckets do not have the persistent tag #10625

Open Lightningtow opened 6 months ago

Lightningtow commented 6 months ago

Expected behavior

According to the wiki, creatures spawned using a Bucket of should be marked as persistent and not despawn. Note this seems to be a bug within vanilla Minecraft itself. I have also reported this to Mojang here.

Observed/Actual behavior

Placing creatures via Bucket of \<creature> doesn't properly give them the persistent tag, leading to them quickly despawning.

The fish didn't spawn with the persistent tag regardless of survival or creative, or whether placing the animal into water that was already there. It doesn't matter whether the item was obtained from the creative inventory, or was an empty bucket that later picked up a fish. It affects buckets of cod, salmon, tropical fish, pufferfish, axolotl, and tadpole.

Steps/models to reproduce

  1. Place a bucket of \<creature>.
  2. Run /data get entity @e[limit=1,sort=nearest,type=!player]
  3. Note that the tag "PersistenceRequired" is equal to 0b instead of 1b as it should be. (The tag "FromBucket" is 1b, as intended.)

Plugin and Datapack List

This reproduced on a fresh installation of paper with no plugins or additional datapacks. /datapack list returns only [vanilla (built-in)], [file/bukkit (world)].

Paper version

This server is running Paper version git-Paper-496 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 7ac24a1 on ver/1.20.4) You are running the latest version

Other

Within the blurb returned by the /data get entity command, amongst it was Paper.SpawnReason: "SPAWNER_EGG". I don't know if this should be "spawned with a bucket" instead, or if it's at all relevant to this issue. paper_1 20 4_bucket_thing 2024-04-29_15 05 52

Machine-Maker commented 6 months ago

Are you sure the entities are actually despawning? Setting that tag isn't the only thing the game uses to know if the entity can be despawned.

Lightningtow commented 6 months ago

They definitely disappeared from my aquarium I built, but it's possible they simply died. I'm not sure what specifically you mean by "Setting that tag isn't the only thing the game uses to know if the entity can be despawned." Are you saying the presence of the FromBucket:1b tag or some other tag is enough to prevent it from despawning?

From the wiki:

Tropical fish caught in buckets then released do not despawn, unlike mobs that spawn naturally in their aquatic environments.

Machine-Maker commented 6 months ago

Yes, the from bucket check should be enough to prevent despawning.

Lightningtow commented 6 months ago

Any suggestions on how to track whether they're despawning vs dying? Only thing I can think of is that EssX tracks named deaths, but that would require naming them thus messing up the despawning test