[SPIGOT-2726] Possible to spawn two seperate entities with the same UUID Created: 12/Oct/16  Updated: 16/Oct/16  Resolved: 16/Oct/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Rick W Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: duplicate, entity, uuid
Environment:

Occurred both on a dedicated Cent-OS server and my private Windows server.


Plugin: None

 Description   

Situation:
Running the /summon Villager ~ ~1 ~

{UUIDLeast:1,UUIDMost:0}

command twice will spawn two Villagers with both the same UUID.
Expected result:
Running the summon command the second time, the summon command should cancel and inform the player that the Entity cannot be summoned. (Vanilla 1.10.2 behaviour)
Problems:
Because the entities have the same UUID, commands that include the UUIDs of these entities (like /kill @e, /entitydata @e, etc.) do not work as expected, especially after one of the duplicates is killed with /kill)



 Comments   
Comment by pokechu22 [ 16/Oct/16 ]

I've submitted a PR that fixes this issue.

Comment by pokechu22 [ 16/Oct/16 ]

Notably, this behavior differs from vanilla, where it's not possible to summon two entities with the same UUID (see MC-44904). Attempting to do so will result in "Unable to summon object" being printed.

You can see that both villagers have the same UUID by running

/say @e[type=Villager]

and then hovering over their names. Upon relogging, one of the two villagers is removed.

I'm not sure why it would allow the summoning to happen. Or rather, why the code in vanilla that's supposed to prevent it isn't triggering here. I'll investigate.

Generated at Sun Mar 16 22:57:15 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.