AmmoType: Difference between revisions

From EXW Docs
Jump to navigation Jump to search
 
Line 25: Line 25:
| allowEmptyMagazines || boolean || true || Override ammo deletion, to allow for enabling or disabling of returned empty magazines.
| allowEmptyMagazines || boolean || true || Override ammo deletion, to allow for enabling or disabling of returned empty magazines.
|-
|-
| refillCost || JsonItemStack[] || [{"id": "gunpowder", "count": 2}] || Cost to refill this magazine, per each missing bullet. Set to null to disable magazine refilling.
| refillCost || [[JsonItemStack]][] || <code>[{"id": "gunpowder", "count": 2}]</code> || Cost to refill this magazine, per each missing bullet. Set to null to disable magazine refilling.
|-
|-
| subAmmo || String[] || - || The ammo type(s) that can be loaded into this item.
| subAmmo || String[] || - || The ammo type(s) that can be loaded into this item.
|-
|-
| potionEffects || PotionEntry[] || - || Array of potion effects applied to an entity upon bullet impact.
| potionEffects || [[PotionEntry]][] || - || Array of potion effects applied to an entity upon bullet impact.
|-
|-
| explosionSize || Integer || null || When set and greater than zero, this will cause an explosion on impact with a block.
| explosionSize || Integer || null || When set and greater than zero, this will cause an explosion on impact with a block.
|-
|-
|}
|}

Latest revision as of 08:20, 4 June 2026

AmmoType (extends BaseType)

For each type, the table lists each field, type, default value (if applicable), and definition.

Field Type Default Definition
numBullets int 1 Number of bullets fired per shot.
ammoCapacity int 30 Ammo capacity amount.
magazineCount Integer - Magazine count.
reloadTime float - Number of seconds it should take to reload.
recoilPitch float 0.0F Base value for upwards cursor/view recoil.
recoilYaw float 0.0F Base value for left/right cursor/view recoil.
bulletDamage float 1 Damage inflicted per bullet, multiplied by the gun damage value.
bulletSpread float - The amount that bullets spread out when fired.
emptyOnCraft boolean false Will this ammo item be loaded or empty when crafted?
allowEmptyMagazines boolean true Override ammo deletion, to allow for enabling or disabling of returned empty magazines.
refillCost JsonItemStack[] [{"id": "gunpowder", "count": 2}] Cost to refill this magazine, per each missing bullet. Set to null to disable magazine refilling.
subAmmo String[] - The ammo type(s) that can be loaded into this item.
potionEffects PotionEntry[] - Array of potion effects applied to an entity upon bullet impact.
explosionSize Integer null When set and greater than zero, this will cause an explosion on impact with a block.