Hope you're doing well!
devlog I will cover why I decided to use FabricMC instead of Forge, how to set up a basic mod, and the current and future state of Tenor.
NOTE: I do not endorse hacking, mostly. This post is not intended as a guide to doing so, it's just my journey and experiences, and is intended for learning.
- Why did I go with FabricMC?
- Mod Setup
- Tenor, what's the state?
- Wrap up
Well, long story short, I had loads of trouble with Forge, as it lacked documentation, and could not wrap my head around it, quite messy.
I actually started with Forge as I knew this was usually how mods were done, based on the research I did. But after trying for a while and struggling with simple things like showing a text on the screen. I decided to check FabricMC out, as I heard it was a more welcoming modding platform.
As you will see in the setup part, getting started creating a mod is really straightforward, and quite simple at first. Although, there are some complex topics like mixins, or accessWideners, which I will try to cover in detail in a future devlog.
After implementing most of the things I had trouble with using Forge, I decided to move to Fabric instead.
Though Fabric's docs still lack quite a bit, they're a lot better than forge in my honest opinion. Now, that you kinda know the reasons, let me show you how to set up a dev environment for modding with Fabric.
For this just follow the guides over at FabricMCs docs, they do the job quite well!
This setup will mainly follow, the guide over at Fabric, for VSCode. You can check it out over at their site here if you prefer.
- A Java Development Kit (JDK) for Java 8 (recommended) or newer https://adoptopenjdk.net/
- Any Java IDE, for example Intellij IDEA and Eclipse. You may also use any other code editors, such as Visual Studio Code.
The first thing we need is to generate the project, there are various ways to do it but they provide a GitHub template repo, so we can just clone that repo and start with a base created for us already.
For this we just need to:
- Use FabricMC/fabric-example-mod template to generate a repository from the template.
- Clone locally
- Make sure to set
maven_groupto your preferred values.
- Make sure to update the versions of Minecraft, the mappings, and the loader - all of which can be queried through this website - to match the versions you wish to target.
- Add any other dependencies you plan to use in
- Make sure to set
I will be coding with VSCode so we can then follow the VSCode instructions.
Import the project in VScode by:
- Using the menu:
File → Open
- In console:
- Drag folder into editor.
For us to be able to run the game from inside VSCode and with debugging support enabled we will need to generate the run configs. This is done by running the Gradle
This is easy enough, open a terminal and run:
this will automatically generate the necessary
launch.jsonfile containing the run configs.
After this we will have access to the run config, to be able to run the game. For this, select the debug menu item on the left taskbar. This will then build the mod and launch the game.
If we want to browse and look at the Minecraft source we can use the Gradle
genSources task. This can be done by running the following command in our terminal:
Next, we will need to refresh our Java project, this can be done by pressing
Shift + Alt + U while having the build.gradle file open.
To search for Minecraft classes we can open the search pane with
Ctrl + P, you can prefix your searches with
# to search for the Minecraft classes.
After the above steps are done, we should have a project ready. I will explain some of the most important files:
This is the mod's metadata file, you can read more here, but it's like a
Metadata for mixins.
This is what Fabric calls entrypoints, it's basically the Main classes of the mod. We can have multiple of them.
Well, at the moment Tenor is at a point where I am mostly happy with it, in the sense of how it's structured and designed. I'm sure I will change my opinion in the future, after realizing I need to redo a whole system 😂
Tenor currently has a "Core", and a set of modules that amplify Tenor's abilities, all working together. I've done it like this for a couple of reasons:
- Decoupling tenors core functionality like Events, from specific functionality like rendering a HUD or Pathfinding.
- Also letting the modules interact with one another, allows for them to use functionality from one module in another module.
- Allows for easy toggling of specific modules, for example, we can disable the HUD in the settings, and that will not update the module, making it inactive.
- Easily add new functionality in the future, as I intend to work on this for a long time.
The core handles low-level stuff (Events, Mixins, etc), and each module higher level stuff (HUD).
Sorry if I'm not 100% clear with how the code is structured, but I'm not very good at that. Hopefully, I will improve as the devlog goes on!
Currently Tenor can:
- Handle commands, from in-game chat
- Rendering a HUD
- Overworld Coords
- Nether Coords
- Super precarious pathfinding and movement (Flat terrain for now, lol)
- This will be part of the devlog.
- Weather hack, prevents wheater rendering.
- Advanced pathfinding
- More hacks
- Jesus hacks
- Speed hacks
- Flight hacks
- Auto fish
- Auto farm
- Auto eat
- Auto walk forwards
- And many more...
Well, I hope you got an idea on how to create a Fabric Mod, and what state tenor is at the moment, and going forwards.
I still don't have the repo ready, but hopefully in a week or so I will be making it public, so you can check it out as the log progresses!
In the next devlog I will dive into what I had to do to get to the current state, oh boy was it a bumpy ride! So you can expect that soon.
And as always, thanks for taking the time to read my devlog!