How to create new guns with Quality Armory

Oct 10, 2018
How to create new guns with Quality Armory
  • Introduction:
    QualityArmory allows users to create new weapons or edit existing ones. However, due to the fact this QA uses resoucepacks, the steps for creating these guns may seem complicated. This guide will go step-by-step through the process of making a new gun.

    #1: Create a new gun.yml file
    Before we focus on updating the resoucepack, we must first create the effects for the gun. To do that, we must go into /plugins/QualityArmory/newGuns/ directory. In it, you should see two files: ExampleKnife and ExampleGun. Since we want to add a new gun, copy the ExampleGun file and re-name it to the gun you want (not required, but it helps sort which guns you currently have). Then, you should open the file and make the following changes:

    • 'Invalid' must be set to false. This will mean the gun will now appear in the game.
    • 'name' must be set to the name of the gun, however, it does not have to be the displayname. This is the name that will be used when registering the internal name for the gun.
    • 'Displayname' is the name of the gun that will be visible. You can set this to anything you want. Chatcolors are supported.
    • 'ID' is the durability for the gun. This needs to be set to an open, unused durability value for Diamond Hoes. For custom models, these values should be between 27 and 36. In the past, this wiki explained to use the highest values, however, doing this would cause the textures and guns to break every time new official guns were added to QA. However, if you wish to use existing models, you can set the ID to the id for the model, and just increase "variant" to a new id.
    Though the rest are all important as well, they should all be self explanatory
    .
    After setting all of these values, save the file and reload the server, or use /QA reload to reload the plugin. When you join the game, you should now be able to see your gun using /qa craft.
    [​IMG]
    However, it should just look like a diamond hoe. To fix this, we need to update the resoucepack.

    #2: Find the Resoucepack URL
    Finding the resoucepack url is actually quite simple; All you need to do in go into the /plugins/QualityArmory/config.yml file. If you scroll down, you should see the resoucepack link next to the "DefaultResoucepack" value. Copy and paste that link into a web-browser and download the resoucepack.


    #3: Create a new model
    The next step is to create the gun that you want. For creating 3D models, I recommend you follow these tutorials by Samasaurus6:

    Though MrCrayfishes modeler will work fine if you just want to add a simple gun, I would recommend you use BlockBench if you need a more advanced editor for displays and groups. You can get BlockBench here:
    http://blockbench.net

    Build the model you want, and then once you are finished creating your gun, you can export the gun as a Json file. The name of the file should be the same as the name of the gun( This makes it easier to sort or find in the resoucepack if you need to update it) Remember, for 1.12 and up, the names must be all lower case.

    [OPTIONAL] In case you wanted to add iron sights, you would need to add specific offsets to the gun. Since QA uses the player's off-hand to use scopes, you will need to set the display values for the offhand 1st person so they appear in the right hand, and the 3rd person values so the iron sights are where they should be. You can open any of the existing models to see how they handle iron sights.


    Finally, once you got the the model, you will need to make some changes to the diamond_axe.json file in the /assets/minecraft/model/item/ directory inside the resoucepack file. In it, scroll down to the *middle* where you find the following:
    Code (Text):

           {
              "predicate": {
                 "damaged": 0,
                 "damage": 0.0155
              },
              "model": "item/assaultmask"
           },
           {
              "predicate": {
                 "damaged": 0,
                 "damage": 0.0161
              },
              "model": "item/aa12"
           },
           {
              "predicate": {
                 "damaged": 0,
                 "damage": 0.0237
              },
              "model": "item/medkit"
           },
     
    What you will need to do is make a new entry after the " }, " for the aa12. In there, you will copy the following:
    Code (Text):
           {
              "predicate": {
                 "damaged": 0,
                 "damage": ID
              },
              "model": "item/MODEL"
           },
    Where:
    1. ID will be replaced with the number 0.0167 for the ID 27, 0.0173 for ID 28, ect (add 0.006 to get the next ID)
    2. MODEL will be the name of the file (without the .json at the end).

    And with this, you should now be able to see the gun in-game. Activate your resourcepack, and once you join the server, you should now be able to see the texture, even if it gets overriden by the default pack shortly afterwards[​IMG]

    Now, once you verify that it works, we need to upload the file somewhere.

    #4: Upload the resoucepack
    There are many places which you can host the resoucepack. Depending on where you host it, the steps may be different, so I won't go into specifics. However, if you use dropbox or any other file-hosting site, make sure you get the direct URL to the file (For dropbox, that means making sure there is a =1 at the end of the url instead of =0).

    #5: Replace the url in the config
    Once you got the URL, you need to make the following changes to the config.yml
    You need to set "DefaultResoucepackOverride" to true so, in case I want to add a new gun, your resoucepack will still be used.

    #Done
    Once you have done everything above, you should now see you gun in-game.[​IMG]
  • Loading...
  • Loading...