1. Hello All!

    So I was reading the recent dev post #8, and I was quite blown away by what they have accomplished. (GG to them).

    Of course with this in mind, I wanted to learn where the developers learn their concepts, NMS and working with packets from? I know how to code, I have around 3 years of experience in programming Java, and I mostly code core systems for smaller servers so I do have a very basic understanding on NMS and packet handling.

    I, of course, want to up this and learn from the very best (Hypixel developers of course) and eventually learn and get the skill they have accumulated over the years, then likely apply when I have enough working skill and proof to work with packets and NMS (which is, of course, a major requirement for these guys).

    To also add onto this, what program do you believe programming would be a good investment for learning new skills, concepts etc? (e.g. programming an anti-cheat, a system critical system like the main controller HP have for their network, etc). I have myself thinking an anti-cheat could be a great way to go with packet handling, and potentially NMS, though I believe anti-cheats are more based on packet listening and what not.

    Thanks for all the help! :)
  2. 1. Be creative
    2. Be creative
    3. Be creative
    • Funny Funny x 1
  3. To understand NMS and packets, you need to read the raw source code and the packets themselves to see what things mean (which is pretty much the goal of deobfuscation). After having enough knowledge, you will be able to figure out how to wire things together, making something that you want.
    • Like Like x 1
  4. That's on internet side, you must learn a base language eg python, c or java
  5. https://wiki.vg/ is an extensive wiki which describes packets and other Minecraft protocol-related stuff in detail. If you're making things like Minecraft bots for example, it can be a very valuable source of information.

    As for learning NMS, I will describe my own ways of learning it which allow me to get over a lot of hurdles that many developers face when trying to dive in it:
    1. Read mappings: Mappings happen to be a super useful way to simplify the reading of the obfuscated Minecraft code.
      My personal favorite are https://github.com/Techcable/MinecraftMappings.

    2. Use MCP: MCP stands for Minecraft Coder Pack (pretty sure you've heard of it when making clients). You can use it to access Minecraft's deobfuscated and half-documented code. I suggest always going for MC 1.12.2, as it has the best documents and least SRG obfuscation. If you do not want to set up an MCP environment, I recommend Setting up a forge workspace, and access Minecraft's code from it. This is the best way to access Minecraft's code efficiently.

    3. When looking for a method or field, either look for where Bukkit events are fired, OR compare difference between MCP and NMS: For example, in one of my projects, I was trying to use NMS to create explosions with a custom yield. So, looking at the obfuscated class net.minecraft.server.vXXX.Explosion, I barely understood a thing. However, looking at MCP, everything became much clearer
      Now, to be able to modify the yield property, I had to look for the Bukkit events EntityExplodeEvent and BlockExplodeEvent, because they have a method called "getYield()".

      Soon, I found that it's Explosion#a(boolean), but you know absolutely nothing about this method or the boolean parameter it takes, which takes us back to MCP:
      So now we know everything about Explosion#a(boolean), thanks to MCP, and then we can easily do whatever we want

    4. Look at CraftBukkit's code: CraftBukkit is basically the implementation of the abstracted Bukkit. Looking at CB is particularly useful because Bukkit converts most of the complicated NMS methods and their weird names to simple, human-readable methods.

      Example: Talking about explosions, we need to make our explosions done completely with NMS so we're not limited by Bukkit. So, we can see how explosions are initially created by looking at the source of CraftWorld:
      So, there's WorldServer#createExplosion(Entity, double, double, double, float, boolean, boolean). We now know what parameters it takes, and what we need to give it to create our customized explosions.
    Last edited: Jan 31, 2020
    • Like Like x 2
  6. Yeah, I do know this, I suppose this would be the general way to go for a lot of people. I'm not sure if Mojang mapping stuff they released would be any help for this (since I plan to only write for 1.13+ regardless).

    Learning Java and using reflections and what not is certainly the way you have to go down this side for sure!

    Wow! Extremely in-depth I love it! I will certainly follow your method as it seems a quite simple robust solution for learning NMS, and a very handy wiki for the packets, which luckily I do already know about!

    I think as for now, I might go ahead and code a small anti-cheat to start getting into packets, as packets seem to be a large area of interest for me at the moment due to its capabilities that I have seen
  7. If you are going to start an anti cheat, I'm positive you will need to listen to the packets the client sends. I suggest you hook into ProtocolLib and use its adapters in order to achieve that.
  8. Yeah, luckily I do have a friend who is experienced in coding anti-cheats who will be mentoring me, getting started off with coding an AC using only bukkit events, then he will demo to me why they can't be trusted etc, which is pretty neat :)

Share This Page