If you are switching from Spigot’s mappings (with class names like EntityZombie, WorldServer, PacketPlayOutSpawnEntity…) to Mojang mappings, you will notice that many of the classes you were using can’t be found anymore, since they now have different names. You will have to change all your references to those classes to their new names.
Setup Mojang mappings
I assume that you already have setup Mojang mappings for your plugin. If not, please read this blog post first.
How to find out the new class names?
There is this extremely handy tool called NMS mapping browser: https://nms.screamingsandals.org/
First, scroll down a bit and select the proper Spigot version you are using. In my example. 1,19.2:
Now, let’s try to find out the Mojang-mapped name for “PacketPlayOutSpawnEntity”. In the top right, you have a search field. Since you wanna know the mapping between “Spigot -> Mojang”, you set the search to “Spigot”, then enter “PacketPlayOutSpawnEntity” and click on the class.
The website will now tell you the proper Mojang mapped name, which in this case is “ClientboundAddEntityPacket”:
If you’re switching to Mojang Mappings while coming from Spigot 1.16.5 and older, then you can also see the mappings between Spigot <> Mojang for field and method names. For example, in the WorldServer (Spigot) / ServerLevel (Mojang) class, there’s a method that was called “addPlayerRespawn” in Spigot mappings, but “addRespawnedPlayer” in Mojang Mappings.
That’s it! You can now replace all your occurrences of the old class, method and field names with the new ones!
Join my Discord Server for feedback or support. Just check out the channel