Paper
Paper copied to clipboard
Aquatic creatures spawned using buckets do not have the persistent tag
Expected behavior
According to the wiki, creatures spawned using a Bucket of
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
- Place a bucket of <creature>.
- Run
/data get entity @e[limit=1,sort=nearest,type=!player] - Note that the tag "PersistenceRequired" is equal to
0binstead of1bas it should be. (The tag "FromBucket" is1b, 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.
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.
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.
Yes, the from bucket check should be enough to prevent despawning.
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