-
Notifications
You must be signed in to change notification settings - Fork 149
Gun File
Gun files are .txt files placed in the /guns/ folder of a content pack. Here is an example of a gun file:
Name M1 Carbine
ShortName kem1carbine
Ammo kem1carbineammo
Icon kem1carbine
Colour 255 255 255
ItemID 26513
ReloadTime 70
Recoil 4
Damage 8
Accuracy 3
ShootDelay 2
ShootSound kem1carbineshoot
ReloadSound kem1carbinereload
Mode SemiAuto
Scope kem1carbine
ZoomLevel 1.5
DistortSound false
Deployable False
DeployedModel None
BulletSpeed 5
//pouch = 58
Here are the fields used in gun files.
//: A comment. This is not parsed by Java, so you can use this to put notes in your files.
Name: The displayed name of a gun.
ShortName: The name of a gun used in content pack code.
Ammo: The ShortName of the bullet file used for the gun.
Icon: The icon of the gun, placed in /textures/items/.
Colour: [someone explain this?]
ItemID: The item ID of the gun.
ReloadTime: The time (in ticks, which are 0.05 seconds) that it takes to reload the gun.
Recoil: How much the gun's muzzle rises when fired.
Damage: The amount of damage the gun does in half hearts when a projectile strikes a mob/player.
Accuracy: The precision of the gun when fired. Smaller = More precise
ShootDelay: How long the gun must wait before firing again. RPM = 1200 / ShootDelay
ShootSound: The sound (.ogg) that plays when the gun is fired.
ReloadSound: The sound that plays when the gun empties a bullet file.
Mode: The firing mode of a gun. Currently, there are two modes: SemiAuto and FullAuto.
Scope: The image (.png) that is displayed when a player presses the left mouse button. None means that zooming in is disallowed.
ZoomLevel: The amount of zoom that is applied when the player presses the left mouse button.
DistortSound: If set to true, the shoot sound receives a random fluctuation in pitch (within a specific hardcoded range) every shot. If set to false, the shoot sound is played the same time every time. This does not affect the ReloadSound.
Deployable: Determines if the gun is deployable.
DeployedModel: The model the gun uses when deployed (only affects guns that use Deployed True).
BulletSpeed: The velocity of the projectile when fired out of the gun.
LoadIntoGun: The amount of cartridges loaded into the gun when using bullet files that have RoundsPerItem set to 1.
MeleeDamage: The amount of damage in half hearts dealt when hitting a mob/player with the melee function of the gun. This is useful for knives and guns with bayonets.
NumBullets: The number of projectiles fired by the gun per shot. This is useful for shotguns.
I would like some help with the Deployable Gun fields.
Note to editors: I would like this page to be a documentation of ALL of the fields usable in gun files.