Is there way to delete player?

Hello. Is there way to “delete” player? Including inventory, location, exp, food, health and anything other.

Delete <worldname>/playerdata/<UUID>.dat.

Question: Why?

3 Likes

Thank you very much, it works!
Answer: I want be able to delete players who not joined server for some time or permanently banned players.

doesnt deleting the players UUID make it possible to re-join your server? ik there is a file that saves the users UUID but i noticed it changes everytime you remove that file (atleast it did that for me)

No, ban status is stored in banned-players.json.

2 Likes

oh then i was wrong sorry bout that :smiley: but still isn’t the players “OLD UUID” saved in the json? as said i noticed when i removed my Player Data and logged in my UUID’s where different so thats what made me wondering

… A player’s UUID is always the same no matter what. My UUID is 2909e677-9c53-46cc-872a-b1a4ca26bc29 on every server I’ve ever been on, and that’ll never change. I have no idea what you mean by ‘old UUID’.

1 Like

@GWM You posted this in Plugin Development, are you looking for an API method to do so?

Yes, for API method. Currently Im doind like that:

new File(world.getDirectory().toFile(), "playerdata" + File.separator + target_uuid.toString() + ".dat"). delete()
And it is working!

1 Like