AmmoType: Difference between revisions

From EXW Docs
Jump to navigation Jump to search
Created page with "== AmmoType (extends BaseType) == For each type, the table lists each field, type, default value (if applicable), and definition. {| class="wikitable" style="margin:auto; width: 100%" |- ! Field !! Type !! Default !! Definition |- | numBullets || int || 1 || Number of bullets fired per shot. |}"
 
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
|-
|-
| numBullets || int || 1 || Number of bullets fired per shot.
| 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]][] || <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.
|-
| 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.
|-
|}
|}

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.