Shots Fired adds casing drops to tacz weapons. Shoot a gun, get an empty casing.
A THANK YOU TO THE PEOPLE WHO MADE THIS MOD POSSIBLE:
MarbledNull:Â Coached me through the very basics of modding.
Corrinedev/jeducklet: Wrote more than half of the core systems of this mod, and had my back every step of the way.
Couldn't have done it without you guys. Go check them out here and here. They're both in the midst of developing some very cool projects, so join their Discords and take a peek if you can.
Tutorial and Explanation.
(By the way folks, if it's not clear, this mod does require tacz to do anything, so make sure you have it installed.)
Shots Fired adds casing drops to tacz weapons. Shoot a gun, get an empty casing. Currently, there are no casing items or uses for these items. Such default configuration will be added by a yet unreleased mod of mine called Create: Mass Munitions, an Create automation mod for all the gun mods. In the mean time, use our config to add your own items.
How to use Shots Fired:
As S-F currently only supports tacz, this mini tutorial will only explain how tacz works and what to do to get the mod functioning to your liking with it.
All tacz guns are the same forge item. They are seperated by their nbt. When I refer to "gunId" I do NOT mean the literal itemId, which would be tacz:modern_kinetic_weapon. I mean tacz's custom nbt called "GunId," represented in our code by "gunId" per normal style formatting. If you didn't understand that, don't worry, the important stuff is after this paragraph and I'm available for support through my discord.
There are 2 important configs that this mod relies on.
The first simply delineates tacz's gunId data and the forge item that is dropped when the gun is fired in the form "tacz:yourGunIdnbtdatahere"|"forge:itemid". In practice this looks like "tacz:glock_17|minecraft:apple".
The second specifies how many casings should be dropped when a tacz weapon fires whilst in burst fire mode. (If you'd like to know why this is important, skip to the end where I explain how this works.) If you do not use this config, firing a weapon in burst mode will drop less casings than it should.
I reccomend using KubeJS's "/kubejs hand" command to get the full nbt of the item you're holding as it makes it trivially easy to get the nbt of your gun. As such it makes it far easier to add weapons to the config.
The full configurability of this mod makes it a powerful tool for modpack creators who are looking to provide a more immersive experience for their players. Players themselves haven't been forgotten either, active development is underway for a full reloading / recycling system for empty casings with proper 3d models (that don't violate copyright law like a couple of my competitors unfortunately do) that Shots Fired will natively support.
Code Explanation for Configs and Burst Fire
Why two configs?
Essentially, here's how it works. When tacz's API tells us you shot a gun, the code cross references your gun to shotsfired.json and drop the casing item accordingly. When you shoot a gun with burst fire, the code cross references your gun to shotsfired.json AND shotsfiredburst.json. The latter tells the code how many casings to drop for every burst fire, but the casing item to be dropped is reference from shotsfired.json. It sounds complicated but it really isn't, I assure you. I'm available to assist via my discord if you'd like the help as well.
Why so much trouble for Burst Fire?
When you shoot once, tacz's API sees one shoot and our code reacts accordingly. Automatic firing triggers the gunShootEvent once per shot, as it should. Burst firing, however, triggers the gunShootEvent only once. Firing 3 shots drops 3 casings, firing 3 shots in a burst only drops one. shotsfiredburst.json exists to eliminate this discrepancy until tacz fixes this part of their API, if they ever do so.
90% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+