Jump to content

Change an entity's UUID


Recommended Posts

Hello!  I need to change an entity's UUID:  I am able to retrieve the entity's UUID, but am unable to set it.  I am currently in 1.6.2, and am hoping that 1.7.2 will hold the changes to UUIDs necessary to be able to do this, or is this already implemented without reflection?

Link to comment
Share on other sites

UUID = Universally Unique Identifier

You're not supposed to be able to change it.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.


Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.


DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

You do know that EntityID and UUID's are different things?

Also do you want to despawn a specific mob (i.e That 1 zombie to the left there) or all of a given type (i.e. all zombies)?



Even if you where to despawn something based on it's UUID why would you want to change the value of it? O.o use the value it already has, it's what it's for -_-'

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

I'm using the UUID to identify each mob individually, otherwise you have eight Zombies but no idea which is which.  I do realize that EntityIDs and UUIDs are different things.  I want to despawn all entities and prevent any from existing unless it has the specific UUID (which is why i need to set the UUID; The EntityHandler uses the UUID and MobType to determine whether or not to despawn the entity) that is contained in my data storage.

Link to comment
Share on other sites

We need to clarify things, i think.

The main difference between entityId and UUID is that the UUID is kept with the world data, while the entityId will change with each loading of the world.


In either case, they are not meant to be changed at will.

You can easily set whatever new flag you need in the entity NBT data. You don't need to change any of the vanilla ones.


If you want your own UUIDs, go for it. But you can only set them inside your own mobs classes, and only once, or it wouldn't make sense.


By the way, the LivingSpawnEvent may help you do what you want.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.