JJK Minecraft Mod
- 17 Devlogs
- 157 Total hours
A minecraft mod! it has a bunch of random stuff that I make but the main focus is probably the Jujitsu kaisen power system that I am trying to recreate
A minecraft mod! it has a bunch of random stuff that I make but the main focus is probably the Jujitsu kaisen power system that I am trying to recreate
Build and Read me update
This is the final devlog here is a youtube link to the showcase: Showcase
After finishing the backend, I got a lot of progress done! I recommend watching the showcase but I managed to easily get all the abilities to a semi functional state. Thanks to the hard work of previous me, this wasn’t a hard task and I had no major problems. One interesting thing I did was how I worked with red. I used dot products to make red more usable, it actually pushes enemies back like in the show if they are in the same area as the direction red is moving. Other then that the systems were pretty easy to make. A big reason it took so long to get here was because I had no idea how to mod. Unfortunately in order to get everything done today, I had to cut a few corners, meaning that the power renderer is still a particle system. I could go on and on about what i want to add though (that will be in the ship) so I’ll just end it here
It’s weird getting a feeling of satisfaction when deleting the most important part of my code. Thats what I felt when deleting the static variables that stored my data. All of the internal systems are now working and my code is so much cleaner. Now entity data is saved successfully, if you die, leave the world or exit the game. In order to do this I had to learn how to use interfaces well. Turns out casting is a lot more useful then one might expect. You can cast interfaces into classes and vise versa and you can use interfaces with getter and setter methods to get data from classes. I always though interfaces were a useless thing that people use to make better looking code but they are helpful. Anyway, I faced a few major bugs throughout the transition into CCA, the main one being the fact that I had to put an entrypoint in the fabric.mod.json file to render entities. It took a long time and I only found it because of some random reddit thread I found. The main issue was that when I implemented an interface, it was supposed to save data for that class in all entities. Heres a tip, if something is wrong and you can’t find the issue, think about whats happening under the hood. For me, I assumed that the entity data would automatically be initialized but interfaces can’t do that. I’m probably explaining it wrong (I’m a little tired rn with coding and college apps). Anyway, theres a lot more I want to do and I wish that stardance had lasted another week so that I could show you all my cool Ideas. I’ll make the final devlog and ship my project later today. So hopefully it works well :D (I worked on a lot of other stuff in these 10 hours but none are finished enough to devlog about; images have a peak)
Finished Cardinal Component re-design. It was really weird to get it working because I needed to use an interface and cast variables which I used to avoid doing. Nothing new unfortunately, next update will go into more detail on how I did this!
(with new system this /stats command works :D)
Sorry, this update will probably be really boring. I’ve been sick for the past 3ish days but have still been trying to code. Unfortunately, that means most of my code is pretty bad. The basic rundown of what’s been happening is a realization that player data was being handled really stupidly. I wasn’t even saving things to files meaning once the server shut down, all the information would be deleted. Now I thought at first I could pretty easily deal with this after finishing the mod so I ignored it, but then I started having issues that came from synchronization with client and server. To those of you who looked at my previous devlogs, you can see that I constantly rewrote a lot of my code. This is because sometimes the client and server use the same static variables while other times they don’t. As a result of these two things, I decided to use a library to handle it called Cardinal Components. For most of my coding projects I’ve always wanted to ignore libraries to the best of my abilities and make stuff myself. I believe it’s a good to learn how the internals of a system work but the problem with me was that I would always stay low level. As I learned more about minecraft development, I learned how important it is to have both high and low level skills in order to make bigger projects. There will probably be only 2 or 3 more devlogs before I ship so I’ll try to get as much cool stuff done before then as possible. Big things are coming!
[upgrades showcase] (https://youtu.be/m7zWsrxv2mA) uh the devlog link is broken lol (or im just bad idk).
I could talk about the things that I worked on behind the scenes unrelated to the innate upgrades but that’s very boring and I talked about them before, the main thing that I fixed was the handling of non-Living Entities with the limitless innate. Basically I used mixins to edit the move code as well as added some things to the client code. I talked a lot about how this worked in a previous devlog, but it took a lot of reading and understanding code to learn how to fix it. Unfortunately my command blocks were broken so I couldn’t showcase the projectile innate system, but otherwise most of the info is in the video
I was working on fixing my innate technique for limitless. The bug in question was an issue where falling non-living entities would end up rubber-banding before sometimes hitting the ground. (I’m not making a showcase video for this use the screenshot and ur imagination) The issue ended up being due to 2 things, one was that minecraft runs the move() function right after applyGravity() so my code would never get the chance to change the gravity. The second was the fact that move() calls are run both by the server and client. The first issue was relatively simple to fix, I just had to learn about advanced mixins and using @ModifyVariable correctly. However the second issue meant that I either had to send a ton of data with packets, or I could do what I had always wanted to do but knew it would take forever… code in client side compatibility. Anyway as of right now I am “almost” done with getting it working. I swear one of these days I am going to share something cool. probably next update or the one after, it’ll come out by Monday if I lock in.
Video Showcase
The showcase above includes some of the older versions, skip to 0:40 for official version (it was lagging at the time of recording though)
The hardest part of this step was the value adjustments. Given my mod gives each player a random value for cursed energy and , a player needs to feel the diffrence between a weak sorcerer and a strong one. I’ll probably continue tweaking the settings for blue until I believe it is good enough. Anyway right now blue isn’t very complicated, it just detects all entities in a certain radius and gives them a velocity based on the gravitational force which is calculated based on radius and constants. I tried using the real life equations but had trouble with them.
Finally, in case your wondering, I am planning on switching the particle renderer that is super laggy with a LWJGL openGL sphere renderer or maybe a block display but in order to do that I need to get good at rendering and make a client linear interpolate to simulate smooth movement and overall I really don’t want to but its gotta happen. Next update will either be a finished blue, or me whining about how trash my code is
I got the first power to work! you can find a showcase here: https://youtu.be/t6oah7P1Fyk it may not seem like much, but this means the lower level systems are working, and I can start focusing on making cool stuff. Other then that I also made the combo system more advanced by having it so u can run actions mid combo and you can detect how fast you did the combo. There are a few more things I want to add to the combo system and tbh I thought about re-coding it again (which is a pretty annoying habit that I’ve gotten #OCD) Next update if I can do it in under 10 hours is gonna be really cool and probably coming tomorrow, following might let u see it earlier :D
I finalized the system! The idea is that most of the boring stuff happens in semi-abstract classes like the Sorcery class and the Ability class, which handle server side management and universal methods. Meanwhile, I can initialize real logic through child classes such as the Limitless calss which extends sorcery or the Blue class which extends Ability. I copied the idea from minecrafts Entity system. I’ve also managed to get nearly all of the key binds to work including scrolling (I used a mixin for scrolling). A lot of the hours that were described in this update actually ended up in the previous devlog so in reality it took about 9ish hours of work. Anyway, mostly a programming update, but next time I’m going to start actually adding powers to my modpack!
The hud system is officially complete! I meant to post this devlog earlier but I had some problems :/ I spent a ton of time figuring out how to render images and I realized it was much easier to just make very specific math that draws lines to the HUD (It doesn’t help that you can’t draw curvy or diagnol lines) I fixed a ton of other problems as well that you can’t read in my commit history I think. This devlog was supposed to be posted a lot earlier but I ended up forgeting to post after writing it lmao. For that reason, I also have to say that the structure of the power system is done and now I’m working on bug fixes as well as making working powers. I really wish I could post a video showing you guys, I’ll try to do so next devlog using something less powerful then OBS. See ya
The main summery for today is mindless progress, I’ve continued to work on the Hud system for my combo system but faced multiple issues that took hours to fix (hence the lack of progress) for starters, somewhere during my modding jurney, I forgot that identifiers can’t have uppercase letters, leading me to try remaking the system multiple times. Additionally, while in my original system I added hud elements to the registry when updating, and removed hud elements when reseting, in the new system, I replace that with static variables and if loops. If I don’t face any more major bugs, the HUD system should be done by the next devlog!
I’ve been creating a HUD system, though it’s pretty boring so I get distracted and do other stuff. Anyway the combo system is fully functional. Through this I learned that static maps are completely unnecessary as static variables update in each client side jvm. I won’t get into the implementation of my HUD system or the other stuff I’m working on because they’re unfinished so this is more of a minor update
I made a combo system! right now it’s really buggy but what it does is similar to street fighter system, you can make a combo and then assign key’s to it. You need to press the key’s in the required number of time for the combo to work. there are a lot of problems with reset rn but the base system is there. Each player has a value called a “combo key” which have a timer that increase by one every tick and resets to 0 when the kye is pressed. these are values that are mapped to each player and only one instance of each key is allowed per player (for better latency and client2server stuff) A combo is created using a bunch of if logic. I used a builder sytem for object creation so instead of new object() you do Combo.build().key1(timeNeeded to press).key2… Each combo can be used for abilities that I’m going to work on next. Speaking about abilities I decided what my mod would be based on, Jujitsu Kaisen! While i’m not a diehard fan of the show, the power system is one of the coolest in all of fiction, so I thought it would be fun to try and implement some abilities (hence the pocket dimention my screenshots are in) anyway, gonna fix the combo system and then work on a simple power see ya!
Made Laser Eyes! When you click the laser button which you can change in the controls menu, a particle will appear (which is purely visual) and it will make a raycast, targeting the nearest entity/block. It will damage an entity and turn the block into a redstone block (temporary until i feel like making ash). It also works in multiplayer, where the particles are summoned from the eye of the shooter from everyones persepective except the shooter who only sees the beam if a few blocks away that way they don’t get blinded by particles (the pictures use free cam and i have no friends so I can’t show this but u can see how it works in the code)
My project didn’t have documentation so it was difficult figuring out how to make a raycast (combination of .clip and .getEntityHitResult) and how to tell if the player really pressed the laser button which requires client to server packet management.
the first devlog has a large number of hours on it because of some issues with git and project stuff (you didn’t miss any updates other then reading don’t worry), Anyway, I’m chilling in my new dimention with my new potion effect that I get after using a new item (with iron helmet texture cause i’m bad). I’ve been trying to get a raycasting system to work I just wanted to update the project so that my hours can be counted correctely, future update coming soon!
I looked through minecrafts source code, The version of minecraft I am coding is 1.21.11 and on fabric there are two “mappings” or interpretations of minecrafts source code. the first version is the community one called yarn which was the one that I was planning on using when I was watching a tutorial series on Youtube however the documentation uses the other mappings called the “mojang mappings”. I switched to the mojang mappings and looked through minecrafts source code using that. I figured out how to handle terrain generation, add new things to minecrafts registry system, and access player data. My next goal is to look through some real applications of mods and this is how I recommend others who are interested to do so to!