I’ve been working on some of my Minecraft 1.20.1 mods a bit a lot lately. As I mentioned in my previous entry, college starts again this week, so I’ve been a bit fixated on coding and getting new features in and fixing bugs before I don’t have the time to. Do note that I mostly mod for myself, so it will be a while before I move on to the latest version of the game. Just for fun I’ll go over the changelogs and provide some commentary.
BotaniaCombat
The Terrasteel weapon code was reworked for better compatibility with BetterCombat.This is the first time I’ve done any kind of proper networking code in Minecraft, so the 3.0 versions are marked as a beta; I anticipate issues.
- Added a bunch of new config options that alter some damage numbers relating to Botania items, allowing you to nerf or buff them. (If you want to change melee weapon attributes, use a mod like Custom Item Attributes)
- For the most part, these were simple mixins. The Soulscribe one I added letter ended up being more complicated because of non-deterministic mod loading
- If RangedWeaponAPI is installed, the Damage Lens on a Mana Blaster now gets boosted by ranged_weapon:damage attribute. I recommend lowering the base damage of the damage lens to balance this.
- This gives Archers in my personal modpack a way to deal magic damage. Plus it’s just fun to have a your magical gun’s damage boosted by archer armor.
- If BetterCombat is installed, Terrasteel weapons and the Starcaller are now properly networked instead of piggybacking off of Botania’s LeftClickPacket. This means the beam will fire during the swing instead of the start of it. It also fixes some issues with durability
- This was a learning process. I had to make a Client-to-Server packet and register it with the Fabric Networking API. When you take a step back, the actual data being sent isn’t that complicated – I’m sending a 1 or 0 over the network for if the weapon is held in the offhand or not. But that betrays the reality that is networking code (even if Fabric API makes it simple). Shoutouts to brokenk3yboard for providing me examples of Fabric Networking API. The issue with durability was an unreported bug I noticed where dual-wielding Terrasteel weapons and swinging with one of them would damage both.
- Altered Spear, Dagger, and Gaia Greatsword default stats to be more in line with RPG Series weapons
- Self-explanatory, users can still alter the stats in the config if they don’t like my defaults
- The Snowshoes from the Artifacts mod now fulfills the condition for Gaia Gift 3, assuming you also have Cardinal Components API installed
- The Trinkets mod, which is what the Artifacts mod uses, doesn’t have a native way for Advancements to check if a player is wearing a trinket. However, Cardinal Components API adds worn trinkets to the player entities’ data. This way, it can be checked through a predicate.
- Nerf Gaia Gift 1 melee effect slightly
- Mjolnir lightning now loses 2 damage per hop.
- Spears and Gaia Greatsword have had their model adjusted
- To be more in line with the RPG series mods (and to be less invasive in first-person)
- Mod no longer includes tinyconfig jar (oops)
- This is definitely because I carelessly copypasted dependencies into my build.gradle. This reduces mod filesize by 12.7 KiB.
- Add Conform Soulscribe config option to conform Botania’s Soulscribe to the stats specified for the other daggers (Enderman extra damage is unchanged)
- Since mod loading order isn’t deterministic on Fabric, and my mixin used my BotaniaNerfConfiguredValues class (which contains the default values until my mod is initialized and the config is loaded), and weapon stats (at least, in 1.20.1) are set when items are registered, sometimes, when launching the game, this option would not apply. So, what I ended up doing, is reading from the config file directly (as opposed to using my config library’s method), just for this one specific case. If the variable is its default value when the item is being registered, then it double-checks the actual text of the config file to confirm if the user wants it that way.
- Add Flugel Tiara nerf config options
- At the request of one of my users. Again, simple mixins. This is how I found out that apparently the text in Botania’s guidebook stating the Flugel Tiara grants 30 seconds of flight is wrong – the code has a max flight time of 1200 ticks, or 60 seconds.
RPGAttr
This mod has significantly increased in scope, now providing 3 gamerules.
- Add Difficulty Damage Scaling gamerule, set to false to use Normal mob damage on all difficulties
- Simple mixin. I wanted to use the other effects of world difficulty in my personal modpack without affecting the damage amount. Did you know that Minecraft multiplies damage by 3 and then divides it by 2 on Hard difficulty instead of just multiplying it by 1.5?
- Add zenithCritsMeleeOnly gamerule, if Zenith Attributes is installed
- Another simple mixin. For some reason I assumed that Zenith Attributes critical hits already worked this way.
- Partially fix #2 – Botania crit mixin doesn’t work: all wills beside Verac should now work with Zenith crits
- This is a longstanding issue. Now 5 out of the 6 Botania crit effects are working with Zenith critical hits. As stated in the issue: Verac doesn’t work because it modifies the DamageSource from the player, but the lambda apothCriticalStrike() is run on LivingEntity#hurt (which occurs after Player#attack where the DamageSource is supplied from)
Familiar Weapons
- Elegant Reaper Scythe can now accept Hoe enchants in addition to sword enchants
- Turns out this only works in the enchanting table and not the anvil. I will fix that later. I am very much looking forward to the enchanting internal rework in the newest Minecraft versions for things like this.
Mixins are awesome, and I feel myself becoming more comfortable with using them. Although “code injection” might sound scary they’re actually quite fun.