PaperMC / Paper

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

TraderLlama setLeashHolder Causes Spawn Failure #10937

Closed Mikison closed 1 week ago

Mikison commented 1 week ago

Expected behavior

TraderLlama entities should spawn correctly and be leashed to the specified WanderingTrader when using setLeashHolder.

Observed/Actual behavior

When setLeashHolder is called on a TraderLlama, the entity fails to spawn. Without calling setLeashHolder, the TraderLlama spawns correctly but without a leash. The issue does not occur with regular Llama entities, which spawn and leash correctly to the WanderingTrader.

Steps/models to reproduce

  1. Create a command or method to spawn a WanderingTrader and two TraderLlama entities.
  2. Use the setLeashHolder method to leash the TraderLlama entities to the WanderingTrader.
  3. Observe that the TraderLlama entities fail to spawn when setLeashHolder is used.
  4. Comment out the setLeashHolder call and observe that the TraderLlama entities spawn without the leash.
  5. Change the entity to Llama and observe that setLeashHolder works correctly.

I am willing to provide code sample if needed

Plugin and Datapack List

LuckPerms, Command API and private plugin that i am developing

Paper version

This server is running Paper version 1.20.6-147-ver/1.20.6@e41d44f (2024-06-17T19:24:35Z) (Implementing API version 1.20.6-R0.1-SNAPSHOT) You are running the latest version Previous version: 1.20.6-146-122c9d3 (MC: 1.20.6)

Other

No response

Lulu13022002 commented 1 week ago

Can replicate, you should probably set the despawn delay of the wandering trader first with WanderingTrader#setDespawnDelay. So i would say it's a WAI.

Mikison commented 1 week ago

Yeah, you're right. Checked the Trading Llama docs once again, turns out

has its DespawnDelay set to 47999 ticks

Thank you for quick reply