A powerful API whichs allows developers to change a players name and UUID on login.

Overview

UUIDSwitcher

An easy to use but powerful API for spigot servers which gives developers control over the UUID and name a player logs in with. This changes the result of Player#getUniqueId and Player#getName effectively giving the player a "new minecraft account" for that specific server, as plugins and minecraft itself don't connect them to the previous uuid in any way. Using this API players can connect as brand-new accounts, or connect to the server as a different players account.

Documentation

Using UUIDSwitcher is extremely simple and can work in all minecraft versions 1.8 - 1.19 without any extra work from the developer.

To enable UUIDSwitcher (typically in the onEnable method of your plugin) simply call UUIDSwitcher.onEnable();

After it is enabled whenever a player logs in a PlayerProfileCreationEvent event will be fired

@EventHandler
public void onLogin(PlayerProfileCreationEvent event) {
    event.setName(myName);
    event.setUUID(myUUID);
}

As shown above you can set the name and uuid a player will have through a listener and UUIDSwitcher will handle the rest.

How it works

When the onEnable method is called, UUIDSwitcher gets the nms MinecraftServer instance, finds the ServerConnection object, and replaces the connection list (client list) with a custom list wrapper. Whenever a connection is added to that list the channel initializer is swapped with a custom one. That initializer still runs the previous one (to ensure login works correctly and to be compatible with other plugins using a similar method eg: ViaVersion).

Normally the Minecraft initializer would assign a HandshakeListener to the clients NetworkManager to accept a handshake packet (that is what starts the login process). However, UUIDSwitcher replaces that with a custom HandshakeListener. This has been coded and tested separately for every spigot version to ensure compatibility, it works exactly like the normal HandshakeListener, but when the handshake packet to start the login process is received, it sets the packet listener to a custom LoginListener rather than the vanilla one. That listener also works exactly like the vanilla one, but it overrides the method called after login is complete, to fire the event and change the obtained GameProfile before calling the normal method to add the player to the server.

API Usage

To use UUIDSwitcher in your own project, simply import it through maven.
First add the Jitpack repository.

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>

Then depend on the core module (you may depend on other modules but they are unlikely to be of any use to you)

<dependency>
    <groupId>com.github.BeefDev.UUIDSwitcher</groupId>
    <artifactId>core</artifactId>
    <version>{VERSION}</version>
    <scope>compile</scope>
</dependency>
You might also like...

A proper Name Spoofer mod for Minecraft Forge 1.8.9.

A proper Name Spoofer mod for Minecraft Forge 1.8.9.

Name-Spoofer Change ANY text displayed on your screen visually. *It does not actually change any strings and is client side (If you spoof a 1 characte

Dec 15, 2022

Java library to perform reverse Domain Name Service (rDNS) lookups with ease.

ipregistry-rdns Java library to perform reverse Domain Name Service (rDNS) lookups with ease. The library is async, thread-safe and has built-in suppo

Jul 18, 2022

Spring Boot & MongoDB Login and Registration example with JWT, Spring Security, Spring Data MongoDB

Spring Boot & MongoDB Login and Registration example with JWT, Spring Security, Spring Data MongoDB

Spring Boot Login and Registration example with MongoDB Build a Spring Boot Auth with HttpOnly Cookie, JWT, Spring Security and Spring Data MongoDB. Y

Dec 30, 2022

Spring Boot Security Login example with JWT and H2 example

 Spring Boot Security Login example with JWT and H2 example

Spring Boot Security Login example with JWT and H2 example Appropriate Flow for User Login and Registration with JWT and HttpOnly Cookie Spring Boot R

Dec 21, 2022

The in-game login system for Grasscutter is based on oauth and GCAuth.

GCAuth OAuth The in-game login system for Grasscutter is based on oauth and GCAuth. Current Features: Use Twitter oauth to login Custom pages Importan

Nov 14, 2022

The in-game login system for Grasscutter is based on oauth and GCAuth.

GCAuth OAuth The in-game login system for Grasscutter is based on oauth and GCAuth. Current Features: Use Twitter oauth to login Custom pages Importan

Aug 3, 2022

In the application, users should be able to register, login and create/update/delete their own to-do lists.

Mini TO-DO app About the project Todoist In the application, users should be able to register, login and create/update/delete their own to-do lists. Y

Nov 22, 2022

NeverScapeAlone! Instantly match with other players and take the hassle out of finding partners for bosses, minigames, skills, pking, and more!

NeverScapeAlone An Old School RuneScape Matchmaking Plugin on RuneLite! Tired of having to scour friend's chats, discords, and forums to find friends

Sep 2, 2022

This is a small library written in Java for minecraft login.

minecraft-auth-library This is a small library written in Java for minecraft login. Usage: Login with microsoft MinecraftAuthenticator minecraftAuthen

Feb 5, 2022
Comments
  • [Question] Can this plugin make you impersonate other players?

    [Question] Can this plugin make you impersonate other players?

    Let's say we switch the UUID of a player into another player's UUID. Will this make that player have the other's data and inventory? and will other plugins recognize him as the other (e.g. having his permissions)?

    Also, if I understand correctly, the UUID switcher only work when a player joins the server. But is it possible theoretically to switch UUID in-game without having to rejoin it again (maybe by faking player leave & join events then forcing him to re-render)?

    opened by iMrDJAi 13
Releases(v1.0.3)
Owner
BeefDev
BeefDev
NoChatLag fixes lagspikes caused by chat by removing the sender UUID from the chat packet. Please note that this breaks the vanilla client side block list.

NoChatLagServer Fabric Version | Forge Version Downloads: SpigotMC | GitHub Releases NoChatLagServer fixes WEB-5587 by setting the sender-uuid to that

Noah van der Aa 3 Jan 10, 2022
WebRTC for React-Native. Allows camera to zoom on the fly while streaming and change max bitrate.

rn-webrtc This repo is forked from react-native-webrtc. A WebRTC module for React Native. Support iOS / macOS / Android. Support Video / Audio / Data

SAURABH KAYASTH A. 7 Aug 7, 2022
1.7 - 1.18 utility class that allows you to change blocks at blazing fast speeds

BlockChanger 1.7 - 1.18 utility class that allows you to change blocks at blazing fast speeds Setup Just import the class to your project. Usage Playe

null 25 Dec 23, 2022
QuickShop is a shop plugin that allows players to easily sell/buy any items from a chest without any commands.

QuickShop is a shop plugin that allows players to easily sell/buy any items from a chest without any commands. In fact, none of the commands that QuickShop provides are ever needed by a player.

Ghost_chu 24 Dec 30, 2022
RR4J is a tool that records java execution and later allows developers to replay locally.

RR4J [Record Replay 4 Java] RR4J is a tool that records java execution and later allows developers to replay locally. The tool solves one of the chall

Kartik  kalaghatgi 18 Dec 7, 2022
A simple and lightweight Minecraft GUI API for developers to use.

Current Version: 1.0.0 Requirements: - You must be using PaperMC or a fork of it (This will not work with just Spigot/Bukkit! - Curently this API only

Sammy Aknan 2 May 14, 2022
A simple Plugin to allow server admins and user with Permissions to change fast and easy thier own Gamemode

A simple Plugin to allow server admins and user with Permissions to change fast and easy thier own Gamemode

Qubik Studios 1 Jan 17, 2022
GodType is a very simple Bukkit plugin to allow the console (or a player) to chat as a defined name.

GodType GodType is a very simple Bukkit plugin to allow the console (or a player) to chat as a defined name. Config A config.yml file will be created

null 1 Dec 24, 2021
Bank Statement Analyzer Application that currently runs in terminal with the commands: javac Application.java java Application [file-name].csv GUI coming soon...

Bank Statement Analyzer Application that currently runs in terminal with the commands: javac Application.java java Application [file-name].csv GUI coming soon...

Hayden Hanson 0 May 21, 2022
Library to programatically return the name of fields similar to the C# nameof operator

nameof() A Java library to programmatically return the name of fields similar to the C# nameof expression How to use? The library is part of the Centr

MoebiusCode 12 Aug 10, 2022