Gun Generator


The datapack, Gamingbarn's Guns, allows for players to add their own guns with their own custom stats. There are some limits to what can and cannot be done with this system, however. By using this generator, you assure that you do not try to give yourself a malformed gun that will break the game.


arrow_back Section 1 of 1 arrow_forward add_box delete

Name

Name Color






Gun Model

Gun Sound

Reload Type

Damage

Range

Fire Rate (in ticks)

Max Ammo

Reload Speed (in ticks)

Recoil Strength

Zoom Strength

Projectile Type

Ammo Type


You will need to put the give command in a command block

Usage Instructions


Below is a summary of each attribute a gun can have, and the appropriate values they can have.


Gun Name

Pretty self-explanitory, the name of the gun. You can change the colors and format settings of the name, and you can add sections to have different parts of the name have different format settings and colors.

Gun Model

The model of the gun, this is quite important as what the gun looks like is often an important part of its identity. You can choose to either use a currently-existing model from Gamingbarn's Guns, or you can use your own by putting in your own CustomModelData.

When choosing your CustomModelData, there are some things you need to do for it to work properly. The first, is that the CustomModelData needs to be between 889100 and 999999. This is to prevent CustomModelDatas from either replacing or overiding one another.

When making the model for your gun, you will need to create two models. The first model is just the gun, everything looks and feels as you would expect. The second model is almost completly unchanged, the only thing different about the second model is that the first person view places the gun below the crosshair.

The CustomModelData of the second model must be exactly 1 number above the first model. For example:
{ "predicate": {"custom_model_data": 899120}, "model": "item/mygun"},
{ "predicate": {"custom_model_data": 899121}, "model": "item/mygun_zoom"}

The CustomModelData that you give to the gun in the give command is the first one; the unzoomed model.

Gun Sound

Currently, at the moment you can only pick from the list of currently implimented gun shooting+reloading sounds used in Gaminbarn's Guns. Support for custom sounds will be added in a future update.

Recoil Strength

The recoil the guns has when shot. Recoil moves the players camera up a little. There are 3 tiers of recoil: weak, medium and strong.

Zoom Strength

The amount the camera zooms in when players Aim Down Sight (ADS) (triggered by sneaking). The zoom amount is rather neglegable at the current moment and will be negated completly if players decide to turn of "FOV Effects" in their settings.

Projectile Type

The projectile that is shot out of the gun. There are 10 projectile types at the present moment. Support for custom projectile types will be added in a later update.

A brief description of each projectile type is below:
Bullet: Small black particles, damages entities upon contact
Rocket: Large white particles, creates explosion upon contact with block or entity, destroys blocks
Fire: Small fire particles, travles in a downward curve, damages and lights targets on fire
Blaze Fire: Small fire particles, travles in a downward curve, blocks around projectile path on fire, damages and lights targets on fire
Laser: Small red particles, damages entities upon contact
Explosive Laser: Large red particles, creates explosion upon contact with block or entity, does not destroy blocks
Green: Small green particles, damages entities upon contact
Blue: Small blue particles, damages entities upon contact
Pink: Small pink particles, travles in a downward curve, creates explosion upon contact with block or entity, does not destroy blocks
Red: Small orange/red particles, damages entities upon contact

Damage

When the Projectile Type of the gun is set to Bullet, Fire, Blaze Fire, Laser, Green, Blue, or Red the damage attribute will deal the specified amount of damage to the target.

When the Projectile Type of the gun is set to Rocket, Explosive Laser, or Pink the damage attribute is instead used as the explosion radius of the impact explosion.

Range

How many blocks the projectile will go before dissipating. Values over 500 are not supported as the maxiumum render distance setting will only load around 500 blocks. Greater values can lead to issues and unexpected behavior.

Fire Rate

The amount of ticks that you must wait after shooting a gun before you can shoot or reload again; triggered when you shoot your gun. This cooldown is universal, meaning a long cooldown on one gun will render you unable to use any other gun until the timer expires. Any value can be used, but keep in mind that there are 20 ticks in a second.

Max Ammo

The maximum amount of shots that can be held in a gun before needing to reload. This number can be any value above 0, but values larger than a couple thousand will effectivly result in never running out of ammo. If you would like a gun to not require ammo at all, click the "Doesn't use ammo?" checkbox at the top of the generator.

Reload Speed

The amount of ticks that you must wait after shooting a gun before you can shoot or reload again; triggered when you reload your gun. This cooldown is universal, meaning a long cooldown on one gun will render you unable to use any other gun until the timer expires. Any value can be used, but keep in mind that there are 20 ticks in a second.

Ammo Type

The ammo that the gun uses when it reloads. Currently, guns can only choose to use a currently existing ammo. In the future, you will be able to add and specify your own ammo for use with your custom guns.

Realod Type

The style in which you reload your gun. There are currently only two types: Magazine and Shell. Magazine fills the gun completly when reloading. Shell fills only 1 ammo of the gun.