How to create new guns with Quality Armory

May 8, 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. [edit] 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.
    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)

    [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.


    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/kevlarmk1"
           },
           {
              "predicate": {
                 "damaged": 0,
                 "damage": 0.0161
              },
              "model": "item/aa12"
           },
           {
              "predicate": {
                 "damaged": 0,
                 "damage": 0.0167
              },
              "model": "EMPTY_SPACE_FOR_CUSTOM_GUN_TEXTURES_ID_27"
           },
           {
              "predicate": {
                 "damaged": 0,
                 "damage": 0.0173
              },
              "model": "EMPTY_SPACE_FOR_CUSTOM_GUN_TEXTURES_ID_28"
           },
           {
              "predicate": {
                 "damaged": 0,
                 "damage": 0.0179
              },
              "model": "EMPTY_SPACE_FOR_CUSTOM_GUN_TEXTURES_ID_29"
           },
     
    [Edit] This method will be easier than the one previously specified. Simply replace the "model" section with the name of the model you exported. Doing this will make it easier for you, so you don't have to figure out exact damage values (as this has already been done for you) or figure out which ID you are using (as the id is right in the model tag)

    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...